JSON-RPC Reference

MoltChain exposes a JSON-RPC 2.0 API for querying blockchain state and submitting transactions. Every validator node runs the RPC server, typically on port 8899. Requests are rate-limited per IP (configurable, default 100 req/s). A companion WebSocket API provides real-time event subscriptions on port 8900.

Endpoint & Format

Default endpoint: http://localhost:8899

All requests are HTTP POST with Content-Type: application/json.

JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "METHOD_NAME",
  "params": [...]
}

Successful responses contain a result field. Errors contain an error object with code and message.

Units: All MOLT amounts are returned in shells (1 MOLT = 1,000,000,000 shells) unless a separate molt field is provided.

Chain Methods

getSlot

Returns the current slot number of the chain tip.

Parameters

None

Returns

u64 — Current slot number.

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getSlot","params":[]}'

# Response
{"jsonrpc":"2.0","id":1,"result":42}

getLatestBlock

Returns the most recently produced block.

Parameters

None

Returns

Object — { slot, hash, parentHash, transactions, timestamp, validator, stateRoot }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getLatestBlock","params":[]}'

# Response
{"jsonrpc":"2.0","id":1,"result":{
  "slot":42,"hash":"a1b2c3...","parentHash":"d4e5f6...",
  "transactions":5,"timestamp":1738800000,"validator":"7xK...","stateRoot":"abc..."
}}

getRecentBlockhash

Returns a recent blockhash required for signing transactions. The blockhash is valid for a limited number of slots.

Parameters

None

Returns

string — Hex-encoded recent blockhash, or object { blockhash }.

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getRecentBlockhash","params":[]}'

# Response
{"jsonrpc":"2.0","id":1,"result":"a1b2c3d4e5f6..."}

health

Returns node health status. Use this as a liveness probe.

Parameters

None

Returns

Object — { "status": "ok" }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"health","params":[]}'

# Response
{"jsonrpc":"2.0","id":1,"result":{"status":"ok"}}

getMetrics

Returns current chain performance metrics including TPS, total transactions, total blocks, and average block time.

Parameters

None

Returns

Object — { tps, totalTransactions, totalBlocks, averageBlockTime }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getMetrics","params":[]}'

# Response
{"jsonrpc":"2.0","id":1,"result":{
  "tps":120,"totalTransactions":500000,"totalBlocks":42000,"averageBlockTime":400
}}

getChainStatus

Returns comprehensive chain status including current slot, validator count, total stake, TPS, transaction & block counts, average block time, and health flag.

Parameters

None

Returns

Object — { currentSlot, validatorCount, totalStake, tps, totalTransactions, totalBlocks, averageBlockTime, isHealthy }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getChainStatus","params":[]}'

Account Methods

getBalance

Returns the MOLT balance for the given public key, in both shells (raw) and MOLT.

Parameters

NameTypeRequiredDescription
pubkeystringYesBase58-encoded public key

Returns

Object — { shells: u64, molt: f64 }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getBalance","params":["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"]}'

# Response
{"jsonrpc":"2.0","id":1,"result":{"shells":5000000000,"molt":5.0}}

getAccount

Returns raw account data including balance, owner, executable flag, and data field.

Parameters

NameTypeRequiredDescription
pubkeystringYesBase58-encoded public key

Returns

Object — { shells, owner, executable, data }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getAccount","params":["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"]}'

getAccountInfo

Returns enhanced account information including balance, transaction count, and additional metadata.

Parameters

NameTypeRequiredDescription
pubkeystringYesBase58-encoded public key

Returns

Object — Enhanced account details with balance, owner, executable flag, transaction history summary.

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getAccountInfo","params":["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"]}'

getAccountTxCount

Returns the number of transactions involving the given account.

Parameters

NameTypeRequiredDescription
pubkeystringYesBase58-encoded public key

Returns

u64 — Transaction count.

Block Methods

getBlock

Returns a block by its slot number, including header fields and transaction list.

Parameters

NameTypeRequiredDescription
slotu64YesSlot number of the block

Returns

Object — { slot, hash, parentHash, transactions, timestamp, validator, stateRoot }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getBlock","params":[42]}'

# Response
{"jsonrpc":"2.0","id":1,"result":{
  "slot":42,"hash":"a1b2...","parentHash":"d4e5...",
  "transactions":[...],"timestamp":1738800000
}}

Transaction Methods

getTransaction

Returns detailed transaction information by its signature hash.

Parameters

NameTypeRequiredDescription
signaturestringYesHex-encoded transaction signature

Returns

Object — Transaction details including signatures, instructions, slot, timestamp, fee, and status.

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getTransaction","params":["a1b2c3d4..."]}'

sendTransaction

Submits a signed, serialized transaction to the mempool. The transaction must be base64-encoded bincode.

Parameters

NameTypeRequiredDescription
transactionstringYesBase64-encoded serialized transaction

Returns

string — Hex-encoded transaction signature.

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"sendTransaction","params":["BASE64_ENCODED_TX"]}'

# Response
{"jsonrpc":"2.0","id":1,"result":"a1b2c3d4e5f6..."}

simulateTransaction

Dry-runs a transaction without committing it to the chain. Useful for estimating fees and checking validity.

Parameters

NameTypeRequiredDescription
transactionstringYesBase64-encoded serialized transaction

Returns

Object — Simulation result with logs, runtime error messages, and returnCode for contract-level result inspection.

Debugging tip: A transaction can be structurally valid but contract-semantically rejected; inspect returnCode to detect these cases.

getTransactionsByAddress

Returns a list of transactions involving the given address.

Parameters

NameTypeRequiredDescription
pubkeystringYesBase58-encoded public key
limitu64NoMax number of results (default 10)

Returns

Array — List of transaction objects.

getTransactionHistory

Returns paginated transaction history for an account with detailed metadata.

Parameters

NameTypeRequiredDescription
pubkeystringYesBase58-encoded public key
limitu64NoMax results (default 10)

Returns

Object — Paginated transaction history.

Validator Methods

getValidators

Returns the list of all registered validators with their stake, reputation, blocks proposed, votes cast, and last active slot.

Parameters

None

Returns

Object — { validators: [ { pubkey, stake, reputation, blocksProposed, votesCast, correctVotes, lastActiveSlot } ] }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getValidators","params":[]}'

getValidatorInfo

Returns detailed information for a specific validator by its public key.

Parameters

NameTypeRequiredDescription
pubkeystringYesValidator's base58-encoded public key

Returns

Object — Validator details including stake, reputation, and performance counters.

getValidatorPerformance

Returns performance metrics for a validator including block production rate, vote accuracy, and uptime.

Parameters

NameTypeRequiredDescription
pubkeystringYesValidator's base58-encoded public key

Returns

Object — Performance metrics.

Staking Methods

getStakingStatus

Returns staking status for an account — active stake, delegated validator, rewards earned.

Parameters

NameTypeRequiredDescription
pubkeystringYesStaker's base58-encoded public key

Returns

Object — Staking status details.

getStakingRewards

Returns accumulated staking rewards for the given account.

Parameters

NameTypeRequiredDescription
pubkeystringYesStaker's base58-encoded public key

Returns

Object — Reward details.

stake

Submits a signed stake transaction (system instruction opcode 9).

Parameters

NameTypeRequiredDescription
transaction_base64stringYesBase64-encoded signed transaction payload. Call shape: stake([transaction_base64])

Returns

string — Transaction signature.

unstake

Submits a signed unstake transaction (system instruction opcode 10).

Parameters

NameTypeRequiredDescription
transaction_base64stringYesBase64-encoded signed transaction payload. Call shape: unstake([transaction_base64])

Returns

string — Transaction signature.

Network Methods

getNetworkInfo

Returns network-level information including chain ID, network ID, version, current slot, validator count, and peer count.

Parameters

None

Returns

Object — { chainId, networkId, version, currentSlot, validatorCount, peerCount }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getNetworkInfo","params":[]}'

getPeers

Returns a list of connected P2P peers.

Parameters

None

Returns

Object — { peers: [ address strings ] }

Contract Methods

getContractInfo

Returns information about a deployed smart contract including owner, code size, storage, and call count.

Parameters

NameTypeRequiredDescription
contractIdstringYesBase58-encoded contract public key

Returns

Object — Contract metadata.

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getContractInfo","params":["ContractPubkey..."]}'

getAllContracts

Returns a list of all deployed contracts on the chain.

Parameters

None

Returns

Array — List of contract info objects.

getContractLogs

Returns execution logs emitted by a contract.

Parameters

NameTypeRequiredDescription
contractIdstringYesBase58-encoded contract public key

Returns

Array — Log entries.

getContractAbi

Returns the ABI/IDL (machine-readable interface definition) for a contract, if one has been registered.

Parameters

NameTypeRequiredDescription
contractIdstringYesBase58-encoded contract public key

Returns

Object — ABI JSON, or null if not set.

Program Methods

getProgram

Returns detailed information about a deployed program.

Parameters

NameTypeRequiredDescription
programIdstringYesBase58-encoded program public key

Returns

Object — Program info including owner, code size, deploy slot.

getPrograms

Returns a list of all deployed programs.

Parameters

None (optional limit param).

Returns

Array — List of program summaries.

getProgramStats

Returns execution statistics for a program — call count, unique callers, storage used.

Parameters

NameTypeRequiredDescription
programIdstringYesBase58-encoded program public key

Returns

Object — Program stats.

getProgramCalls

Returns recent call history for a program.

Parameters

NameTypeRequiredDescription
programIdstringYesBase58-encoded program public key

Returns

Array — Call records.

getProgramStorage

Returns on-chain storage summary for a program.

Parameters

NameTypeRequiredDescription
programIdstringYesBase58-encoded program public key

Returns

Object — Storage summary.

Token Methods

getTokenBalance

Returns the balance of a specific token for an account.

Parameters

NameTypeRequiredDescription
ownerstringYesBase58-encoded owner public key
tokenMintstringYesBase58-encoded token mint address

Returns

Object — Token balance details.

getTokenHolders

Returns a list of holders for a given token.

Parameters

NameTypeRequiredDescription
tokenMintstringYesBase58-encoded token mint address

Returns

Array — Token holder entries.

getTokenTransfers

Returns recent transfer events for a token.

Parameters

NameTypeRequiredDescription
tokenMintstringYesBase58-encoded token mint address

Returns

Array — Transfer event records.

NFT & Marketplace Methods

getCollection

Returns metadata for an NFT collection.

Parameters

NameTypeRequiredDescription
collectionIdstringYesBase58-encoded collection public key

Returns

Object — Collection metadata (name, symbol, total supply, etc.).

getNFT

Returns a specific NFT by collection and token ID.

Parameters

NameTypeRequiredDescription
collectionIdstringYesCollection public key
tokenIdu64YesToken ID within the collection

Returns

Object — NFT details (owner, metadata URI, attributes).

getNFTsByOwner

Returns all NFTs owned by a given address.

Parameters

NameTypeRequiredDescription
ownerstringYesBase58-encoded owner public key

Returns

Array — List of NFT objects.

getMarketListings

Returns active marketplace listings with price, seller, and collection info.

Parameters

NameTypeRequiredDescription
collectionIdstringNoFilter by collection (optional)

Returns

Array — Active listings.

getMarketSales

Returns recent marketplace sales history.

Parameters

NameTypeRequiredDescription
collectionIdstringNoFilter by collection (optional)

Returns

Array — Completed sale records.

getMarketOffers

Returns active marketplace offers (bids) optionally filtered by collection or token.

Parameters

NameTypeRequiredDescription
collectionIdstringNoFilter by collection public key
tokenIdu64NoFilter by specific token ID

Returns

Array — Active offer records.

getMarketAuctions

Returns active and recent marketplace auctions with current bid state.

Parameters

NameTypeRequiredDescription
collectionIdstringNoFilter by collection public key
statusstringNoFilter by auction status (`active`, `ended`, `cancelled`)

Returns

Array — Auction records including reserve, leading bid, and end slot/time.

Burn Methods

getTotalBurned

Returns the total amount of MOLT that has been permanently burned (removed from circulation).

Parameters

None

Returns

Object — { shells: u64, molt: f64 }

cURL
curl -X POST http://localhost:8899 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getTotalBurned","params":[]}'

# Response
{"jsonrpc":"2.0","id":1,"result":{"shells":1500000000000,"molt":1500.0}}

Fee & Rent Methods

getFeeConfig

Returns the current fee configuration for the chain (base fee, priority fee multiplier).

Parameters

None

Returns

Object — Fee configuration.

getRentParams

Returns the current rent parameters (rent per byte per epoch, rent-exempt minimum).

Parameters

None

Returns

Object — Rent parameters.

Additional Implemented Methods

These JSON-RPC methods are implemented in the live server dispatch (`rpc/src/lib.rs`) and may not yet have individual method cards on this page.

Compatibility endpoints: POST /solana and POST /evm are also supported in addition to POST /.

Chain / Account / Tx

  • confirmTransaction
  • getRecentTransactions
  • getTokenAccounts
  • getTreasuryInfo
  • getGenesisAccounts

Fee / Network / Validator

  • setFeeConfig
  • setRentParams
  • getClusterInfo

Staking (ReefStake)

  • stakeToReefStake
  • unstakeFromReefStake
  • claimUnstakedTokens
  • getStakingPosition
  • getReefStakePoolInfo
  • getUnstakingQueue
  • getRewardAdjustmentInfo

Contracts / Registry / Program

  • setContractAbi
  • deployContract
  • upgradeContract
  • getContractEvents
  • getSymbolRegistry
  • getSymbolRegistryByProgram
  • getAllSymbolRegistry

MoltyID / Names / Identity

  • getMoltyIdIdentity, getMoltyIdReputation, getMoltyIdSkills, getMoltyIdVouches, getMoltyIdAchievements, getMoltyIdProfile
  • resolveMoltName, reverseMoltName, batchReverseMoltNames, searchMoltNames
  • getMoltyIdAgentDirectory, getMoltyIdStats
  • getEvmRegistration, lookupEvmAddress

NFT / Market / Prediction / Platform Stats

  • getNFTsByCollection
  • getNFTActivity
  • getPredictionMarketStats, getPredictionMarkets, getPredictionMarket, getPredictionPositions, getPredictionTraderStats, getPredictionLeaderboard, getPredictionTrending, getPredictionMarketAnalytics
  • getDexCoreStats, getDexAmmStats, getDexMarginStats, getDexRewardsStats, getDexRouterStats, getDexAnalyticsStats, getDexGovernanceStats
  • getMoltswapStats, getLobsterLendStats, getClawPayStats, getClawVaultStats, getBountyBoardStats, getComputeMarketStats, getReefStorageStats, getMoltMarketStats, getMoltAuctionStats, getMoltPunksStats
  • getMusdStats, getWethStats, getWsolStats, getMoltBridgeStats, getMoltDaoStats, getMoltOracleStats
  • requestAirdrop (testnet utility)

Bridge

  • createBridgeDeposit — initiate a cross-chain bridge deposit
  • getBridgeDeposit — query a bridge deposit by ID
  • getBridgeDepositsByRecipient — list deposits for a recipient address

Shielded Pool (Privacy)

  • getShieldedPoolState — query shielded pool state (tree size, root, nullifier count)
  • getShieldedPoolStats — aggregated pool statistics
  • getShieldedMerkleRoot — current Merkle tree root
  • getShieldedMerklePath — Merkle proof for a leaf index
  • isNullifierSpent — check if a nullifier has been spent
  • checkNullifier — alias for isNullifierSpent
  • getShieldedCommitments — list commitments in the tree
  • computeShieldCommitment — compute commitment hash for shield operation
  • generateShieldProof — generate ZK proof for shield (deposit)
  • generateUnshieldProof — generate ZK proof for unshield (withdraw)
  • generateTransferProof — generate ZK proof for private transfer

Contract Execution

  • callContract — execute a read-only contract call (no state change)
  • getNameAuction — query MoltyID .molt name auction by name

Solana-Compatible Endpoint (/solana)

  • getLatestBlockhash, getRecentBlockhash, getBalance, getAccountInfo, getBlock, getBlockHeight, getSignaturesForAddress, getSignatureStatuses, getSlot, getTransaction, sendTransaction, getHealth, getVersion

EVM-Compatible Endpoint (/evm)

  • eth_getBalance, eth_sendRawTransaction, eth_call, eth_chainId, eth_blockNumber, eth_getTransactionReceipt, eth_getTransactionByHash, eth_accounts, net_version
  • eth_gasPrice, eth_maxPriorityFeePerGas, eth_estimateGas, eth_getCode, eth_getTransactionCount
  • eth_getBlockByNumber, eth_getBlockByHash, eth_getLogs, eth_getStorageAt
  • net_listening, web3_clientVersion

Looking for real-time events? Check out the WebSocket Reference for subscription-based streaming of blocks, transactions, and account changes.