Avalanche - JSON-RPC

JSON-RPC methods supported on Avalanche Mainnet and Avalanche Testnet through Tatum RPC Gateway, with base URLs and an example request.

Call Avalanche JSON-RPC methods through Tatum RPC Gateway. Send an HTTP POST request with a JSON-RPC 2.0 body to the network's base URL, with your API key in the x-api-key header. See Authentication.

Avalanche has 3 JSON-RPC interfaces, each with its own base URLs and methods: C-Chain, P-Chain and X-Chain.

C-Chain

Base URLs

NetworkBase URL
Avalanche Mainnethttps://avalanche-mainnet.gateway.tatum.io
Avalanche Testnethttps://avalanche-testnet.gateway.tatum.io

Example request

curl 'https://avalanche-mainnet.gateway.tatum.io' \
  --header 'content-type: application/json' \
  --header 'x-api-key: {YOUR_API_KEY}' \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Methods

53 methods. Parameters and responses are described in the Avalanche C-Chain API reference.

MethodDescription
debug_getBadBlocksReturns the last bad blocks the node has seen on the network.
debug_storageRangeAtReturns the storage of a contract at a given block and transaction index.
debug_traceBlockReplays all transactions of an RLP-encoded block and returns their traces.
debug_traceBlockByHashReplays all transactions of a block, selected by hash, and returns their traces.
debug_traceBlockByNumberReplays all transactions of a block, selected by number, and returns their traces.
debug_traceCallRuns a call on top of a given block without creating a transaction and returns its trace.
debug_traceTransactionReplays a transaction and returns its execution trace.
eth_blockNumberReturns the number of the most recent block.
eth_callExecutes a message call immediately without creating a transaction on the chain.
eth_callManyExecutes a list of message calls in sequence on top of a given block, without creating transactions.
eth_chainIdReturns the chain ID used for signing replay-protected transactions.
eth_estimateGasEstimates the gas needed to execute a transaction without adding it to the chain.
eth_feeHistoryReturns base fees, gas usage ratios and priority fee percentiles for a range of blocks.
eth_gasPriceReturns the current gas price in wei.
eth_getBalanceReturns the balance of an address in wei.
eth_getBlockByHashReturns information about a block by hash.
eth_getBlockByNumberReturns information about a block by number.
eth_getBlockReceiptsReturns the receipts of all transactions in a block.
eth_getBlockTransactionCountByHashReturns the number of transactions in a block, selected by hash.
eth_getBlockTransactionCountByNumberReturns the number of transactions in a block, selected by number.
eth_getCodeReturns the bytecode at an address.
eth_getLogsReturns the logs that match a filter object.
eth_getProofReturns the Merkle proof of an account and, optionally, of some of its storage slots.
eth_getStorageAtReturns the value of a storage slot at an address.
eth_getTransactionByBlockHashAndIndexReturns a transaction by block hash and transaction index.
eth_getTransactionByBlockNumberAndIndexReturns a transaction by block number and transaction index.
eth_getTransactionByHashReturns a transaction by hash.
eth_getTransactionCountReturns the number of transactions sent from an address (its nonce).
eth_getTransactionReceiptReturns the receipt of a transaction by transaction hash.
eth_getUncleByBlockHashAndIndexReturns an uncle of a block, selected by block hash and uncle index.
eth_getUncleByBlockNumberAndIndexReturns an uncle of a block, selected by block number and uncle index.
eth_getUncleCountByBlockHashReturns the number of uncles in a block, selected by hash.
eth_getUncleCountByBlockNumberReturns the number of uncles in a block, selected by number.
eth_maxPriorityFeePerGasReturns a suggested priority fee (tip) per gas in wei.
eth_sendRawTransactionSubmits a signed, RLP-encoded transaction to the network.
eth_signTypedDataSigns EIP-712 typed structured data.
eth_signTypedData_v3Signs EIP-712 typed structured data (version 3 of the format).
eth_simulateV1Simulates a sequence of blocks and calls on top of a given block and returns the results.
eth_syncingReturns the sync status of the node, or false when it is not syncing.
net_listeningReturns true when the client is listening for network connections.
net_peerCountReturns the number of peers connected to the client.
net_versionReturns the current network ID.
trace_blockReturns the traces of all transactions in a block.
trace_callRuns a call and returns the requested traces (trace, vmTrace, stateDiff) without creating a transaction.
trace_callManyRuns a list of calls in sequence, each on top of the state of the previous one, and returns their traces.
trace_rawTransactionTraces a signed raw transaction without broadcasting it.
trace_replayBlockTransactionsReplays all transactions of a block and returns the requested traces.
trace_replayTransactionReplays a transaction and returns the requested traces.
trace_transactionReturns all traces of a transaction.
txpool_contentReturns the pending and queued transactions in the transaction pool.
txpool_inspectReturns a text summary of the pending and queued transactions in the transaction pool.
txpool_statusReturns the number of pending and queued transactions in the transaction pool.
web3_clientVersionReturns the client version.

The gateway lists its supported methods at runtime:

P-Chain

Base URLs

NetworkBase URL
Avalanche Mainnethttps://avalanche-mainnet.gateway.tatum.io/ext/bc/P
Avalanche Testnethttps://avalanche-testnet.gateway.tatum.io/ext/bc/P

Example request

curl 'https://avalanche-mainnet.gateway.tatum.io/ext/bc/P' \
  --header 'content-type: application/json' \
  --header 'x-api-key: {YOUR_API_KEY}' \
  --data '{"jsonrpc":"2.0","method":"platform.getHeight","params":{},"id":1}'

Methods

21 methods. Parameters and responses are described in the Avalanche P-Chain API reference; each method name links to its page there.

MethodDescription
platform.getBlockReturns a block by its ID.
platform.getBlockByHeightReturns a block by its height.
platform.getBlockchainStatusReturns the status of a blockchain.
platform.getCurrentSupplyReturns an upper bound on the number of tokens that can stake a Subnet.
platform.getCurrentValidatorsLists the current validators of a Subnet.
platform.getFeeConfigReturns the dynamic fee configuration of the P-Chain.
platform.getFeeStateReturns the current fee state of the P-Chain.
platform.getHeightReturns the height of the last accepted block.
platform.getL1ValidatorReturns a current L1 validator by its validation ID.
platform.getMinStakeReturns the minimum validator and delegator stake for a Subnet.
platform.getProposedHeightReturns the node's current proposer VM height.
platform.getStakingAssetIDReturns the asset ID of a Subnet's staking asset.
platform.getSubnetReturns the owners and details of a Subnet or L1.
platform.getTimestampReturns the current P-Chain timestamp.
platform.getTotalStakeReturns the total amount of tokens staked on a Subnet.
platform.getTxReturns a transaction by its ID.
platform.getTxStatusReturns the status of a transaction by its ID.
platform.getUTXOsReturns the UTXOs that reference a given set of addresses.
platform.issueTxSubmits a signed transaction to the P-Chain.
platform.validatedByReturns the Subnet that validates a given blockchain.
platform.validatesLists the IDs of the blockchains a Subnet validates.

The gateway lists its supported methods at runtime:

X-Chain

Base URLs

NetworkBase URL
Avalanche Mainnethttps://avalanche-mainnet.gateway.tatum.io/ext/bc/X
Avalanche Testnethttps://avalanche-testnet.gateway.tatum.io/ext/bc/X

Example request

curl 'https://avalanche-mainnet.gateway.tatum.io/ext/bc/X' \
  --header 'content-type: application/json' \
  --header 'x-api-key: {YOUR_API_KEY}' \
  --data '{"jsonrpc":"2.0","method":"avm.getHeight","params":{},"id":1}'

Methods

8 methods. Parameters and responses are described in the Avalanche X-Chain API reference; each method name links to its page there.

MethodDescription
avm.getAssetDescriptionReturns the name, symbol and denomination of an asset.
avm.getBlockReturns a block by its ID.
avm.getBlockByHeightReturns a block by its height.
avm.getHeightReturns the height of the last accepted block.
avm.getTxReturns a transaction by its ID.
avm.getTxFeeReturns the transaction and asset creation fees of the network.
avm.getUTXOsReturns the UTXOs that reference given addresses, including atomic UTXOs from another chain.
avm.issueTxSubmits a signed transaction to the X-Chain.

The gateway lists its supported methods at runtime:

Method unavailable?

If you need a method we don't support yet, contact support.