Solana — Methods
API reference for Solana. All methods ->
getMultipleAccounts
Returns the account information for a list of pubkeys.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<array>: an array of Pubkeys to query, as base-58 encoded strings (up to a maximum of 100).<object>(optional): the configuration object containing the following fields:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
encoding(string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedatafield is typestring.dataSlice(object): limits the returned account data using the providedoffset: <usize>andlength: <usize>fields; only available for "base58", "base64" or "base64+zstd" encodings.minContextSlot(number): sets the minimum slot that the request can be evaluated at.
Returns
The result will be a JSON object with value equal to an array of:
null: if the account at that Pubkey doesn't exist.<object>: otherwise, a JSON object containing:lamports(u64): the number of lamports assigned to this account, as a u64.owner(string): a base-58 encoded Pubkey of the program this account has been assigned to.data([string, encoding]|object): data associated with the account, either as encoded binary data or JSON format{<program>: <state>}, depending on the encoding parameter.executable(boolean): a boolean indicating if the account contains a program (and is strictly read-only).rentEpoch(u64): the epoch at which this account will next owe rent, as u64.
Request example 1
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getMultipleAccounts",
"params": [
[
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
"4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
],
{
"dataSlice": {
"offset": 0,
"length": 0
}
}
]
}'
Response example 1
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374443766
},
"value": [
{
"data": [
"",
"base64"
],
"executable": false,
"lamports": 88860054690252,
"owner": "11111111111111111111111111111111",
"rentEpoch": 18446744073709551615,
"space": 0
},
{
"data": [
"",
"base64"
],
"executable": false,
"lamports": 7998763451,
"owner": "2WRuhE4GJFoE23DYzp2ij6ZnuQ8p9mJeU6gDgfsjR4or",
"rentEpoch": 18446744073709551615,
"space": 0
}
]
}
}
Request example 2
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getMultipleAccounts",
"params": [
[
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
"4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
],
{
"encoding": "base58"
}
]
}'
Response example 2
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374443852
},
"value": [
{
"data": [
"",
"base58"
],
"executable": false,
"lamports": 88860054690252,
"owner": "11111111111111111111111111111111",
"rentEpoch": 18446744073709551615,
"space": 0
},
{
"data": [
"",
"base58"
],
"executable": false,
"lamports": 7998763451,
"owner": "2WRuhE4GJFoE23DYzp2ij6ZnuQ8p9mJeU6gDgfsjR4or",
"rentEpoch": 18446744073709551615,
"space": 0
}
]
}
}
getProgramAccounts
Returns all accounts owned by the provided program Pubkey.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<string>: the Pubkey of a program, as base-58 encoded string.<object>(optional): the configuration object containing the following fields:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
encoding(string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedatafield is typestring.dataSlice(object): limits the returned account data using the providedoffset: <usize>andlength: <usize>fields; only available for "base58", "base64" or "base64+zstd" encodings.filters(array): filters the results using up to 4 filter objects; the account must meet all the filter criteria to be included in results:memcmp(object): compares a provided series of bytes with program account data at a particular offset. Fields:offset(usize): an offset into program account data to start comparison.bytes(string): the data to match, as encoded string.encoding(string): an encoding for the filter bytes data, either "base58" or "base64". Data is limited in size to 128 or fewer decoded bytes. NEW: This field, and base64 support generally, is only available in solana-core v1.14.0 or newer. Please omit when querying nodes on earlier versions.
dataSize(u64): compares the program account data length with the provided data size
withContext(boolean): wraps the result in a JSON object.minContextSlot(number): sets the minimum slot that the request can be evaluated at.
Returns
By default, the result field will be an array of JSON objects. If withContext flag is set, the array will be wrapped in a JSON object.
pubkey(string): the account Pubkey as base-58 encoded string.account(object): a JSON object, with the following subfields:lamports(u64): the number of lamports assigned to this account, as a u64.owner(string): the base-58 encoded Pubkey of the program this account has been assigned to.data([string,encoding]|object): the data associated with the account, either as encoded binary data or JSON format{<program>: <state>}, depending on encoding parameter.executable(bool): a boolean indicating if the account contains a program (and is strictly read-only).rentEpoch(u64): the epoch at which this account will next owe rent, as a u64.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
{
"encoding": "base64"
}
]
}'
Response example
{
"jsonrpc": "2.0",
"result": [
{
"account": {
"data": [
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"base64"
],
"executable": false,
"lamports": 8017920,
"owner": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
"rentEpoch": 18446744073709551615,
"space": 1024
},
"pubkey": "6uSF3nNb8ZZahnLEgDjXVFWTBeS9WVMh89BiRnJKhCT8"
}
],
"id": 1
}
getRecentPerformanceSamples
Returns a list of recent performance samples, in reverse slot order.
Performance samples are taken every 60 seconds and include the number of transactions and slots that occur in a given time window.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):limit(usize; optional): the number of samples to return (max: 720).
Returns
The result object containing the following parameters:
slot(u64): the slot in which sample was taken at.numTransactions(u64): the number of transactions in a sample.numSlots(u64): the number of slots in a sample.samplePeriodSecs(u16): the number of seconds in a sample window.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getRecentPerformanceSamples",
"params": [4]
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"numNonVoteTransactions": 4059,
"numSlots": 152,
"numTransactions": 6339,
"samplePeriodSecs": 60,
"slot": 374448056
},
{
"numNonVoteTransactions": 5343,
"numSlots": 150,
"numTransactions": 7592,
"samplePeriodSecs": 60,
"slot": 374447904
},
{
"numNonVoteTransactions": 5971,
"numSlots": 153,
"numTransactions": 8250,
"samplePeriodSecs": 60,
"slot": 374447754
},
{
"numNonVoteTransactions": 6379,
"numSlots": 155,
"numTransactions": 8719,
"samplePeriodSecs": 60,
"slot": 374447601
}
]
}
getSignaturesForAddress
Returns signatures for confirmed transactions that include the given address in their
accountKeyslist.
Returns signatures backwards in time from the provided signature or most recent confirmed block.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<string>(required): the account address as a base-58 encoded string.<object>(optional): the configuration object containing the following fields:limit(number): the maximum transaction signatures to return (between 1 and 1,000, default: 1,000).before(string): starts searching backwards from this transaction signature. If not provided the search starts from the top of the highest max confirmed block.until(string): searches until this transaction signature, if found before limit reached.commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
minContextSlot(number): sets the minimum slot that the request can be evaluated at.
Returns
The result field is an array of transaction signature information, ordered from newest to oldest transaction:
signature(string): the transaction signature as base-58 encoded string.slot(u64): the slot that contains the block with the transaction.err(object|null): Error if transaction failed, null if transaction succeeded. See the TransactionError definitions.memo(string|null): the memo associated with the transaction, null if there is no memo.blockTime(i64|null): estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.confirmationStatus(string|null): the transaction's cluster confirmation status; either processed, confirmed, or finalized.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSignaturesForAddress",
"params": [
"Vote111111111111111111111111111111111111111",
{
"limit": 1
}
]
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"blockTime": 1744731098,
"confirmationStatus": "finalized",
"err": null,
"memo": null,
"signature": "3wG35yPiT69tZSJRQJ9VTsU9dNR6nd4sQkU7FSyK5cc9Fpt7DXrvYSwbLLBuEo4Sz7DNwSGmTc5bx5mf3MSjZcNN",
"slot": 374448329
}
]
}
getSignatureStatuses
Returns the statuses of a list of signatures.
Unless the searchTransactionHistory configuration parameter is included, this method only searches the recent status cache of signatures, which retains statuses for all active slots plus MAX_RECENT_BLOCKHASHES rooted slots.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<array>: an array of transaction signatures to confirm, as base-58 encoded strings (up to a maximum of 256).<object>(optional): the object containing the following field:searchTransactionHistory(boolean): iftrue, a Solana node will search its ledger cache for any signatures not found in the recent status cache.
Returns
null: an unknown transaction.<object>: a known transaction; contains the following parameters:slot(u64): the slot the transaction was processed at.confirmations(usize|null): the number of blocks since signature confirmation, null if rooted, as well as finalized by a supermajority of the cluster.err(object|null): Error if transaction failed, null if transaction succeeded. See the TransactionError definitions.confirmationStatus(string|null): the transaction's cluster confirmation status; eitherprocessed,confirmed, orfinalized.- [DEPRECATED]
status(object): the transaction status:"Ok": <null>: the transaction was successful."Err": <ERR>: the transaction failed withTransactionError.
Request example 1
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSignatureStatuses",
"params": [
[
"5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
"5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7"
]
]
}'
Response example 1
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374449074
},
"value": [
null,
null
]
}
}
Request example 2
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSignatureStatuses",
"params": [
[
"5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"
],
{
"searchTransactionHistory": true
}
]
}'
Response example 2
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374449161
},
"value": [
null
]
}
}
getSlot
Returns the slot that has reached the given (finalized/confirmed/processed) or default (finalized) commitment level.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<object>(optional): the configuration object containing the following fields:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
minContextSlot(number): sets the minimum slot that the request can be evaluated at.
Returns
<u64>: the current slot.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlot"
}'
Response example
{
"jsonrpc": "2.0",
"result": 374449197,
"id": 1
}
getSlotLeader
Returns the current slot leader.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<object>: the configuration object containing the following fields:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
minContextSlot(number): sets the minimum slot that the request can be evaluated at.
Returns
<string>: the node identity Pubkey as base-58 encoded string.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeader"
}'
Response example
{
"jsonrpc": "2.0",
"result": "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS",
"id": 1
}
getSlotLeaders
Returns the slot leaders for a given slot range.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<u64>: the start slot, as u64 integer.<u64>: the limit, as a u64 integer (between 1 and 5,000).
Returns
<array[string]>: the node identity public keys as base-58 encoded strings.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeaders",
"params": [374449190, 10]
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": [
"dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
"dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
"dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS",
"dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS",
"dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS",
"dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS",
"dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
"dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
"dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
"dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB"
]
}
getSupply
Returns information about the current supply.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<object>: the configuration object containing the following fields:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
excludeNonCirculatingAccountsList(boolean): set totrueto exclude non-circulating accounts list from response.
Returns
The result contains the value object with the following fields:
total(u64): the total supply in lamports.circulating(u64): the circulating supply in lamports.nonCirculating(u64): the non-circulating supply in lamports.nonCirculatingAccounts(array): an array of account addresses of non-circulating accounts, as strings. IfexcludeNonCirculatingAccountsListis enabled, the returned array will be empty.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSupply"
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374451103
},
"value": {
"circulating": 968499669854531580,
"nonCirculating": 315864946596719089,
"nonCirculatingAccounts": [
"AsrYX4FeLXnZcrjcZmrASY2Eq1jvEeQfwxtNTxS5zojA",
"CY7X5o3Wi2eQhTocLmUS6JSWyx1NinBfW7AXRrkRCpi8",
"CHmdL15akDcJgBkY6BP3hzs98Dqr6wbdDC5p8odvtSbq",
"3fV2GaDKa3pZxyDcpMh5Vrh2FVAMUiWUKbYmnBFv8As3",
"9xbcBZoGYFnfJZe81EDuDYKUm8xGkjzW8z4EgnVhNvsv",
"3vSVZC7LfnnyGuacykWoWrbzrmTyFVSXxCbKJUFbJcKS",
"CuatS6njAcfkFHnvai7zXCs7syA9bykXWsDCJEWfhjHG",
"APnSR52EC1eH676m7qTBHUJ1nrGpHYpV7XKPxgRDD8gX",
"9NFMpkv65d2G7UMMFYHeXrBAaB6rVD3BgQ95bKiwr448",
"4U9iUGSHj1kJa7AefG4UdEPd1xVvMyK3suDhngnvazyf",
"6Uz9bTkdAtmzsDWk3Jso9YzzfYiNpEShBZbxUsvMnRbJ",
"8MrstTxNJpwXSFxn5FGwvre2uCcCaRPs94f2FcknVUyr"
],
"total": 1284364616451250669
}
},
"id": 1
}
getTokenAccountBalance
Returns the token balance of an SPL Token account.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<string>(required): the pubkey of Token account to query, as base-58 encoded string.<object>(optional): the configuration object containing the following field:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
Returns
The result contains the value object with the following fields:
amount(string): the raw balance without decimals, a string representation of u64.decimals(u8): the number of base 10 digits to the right of the decimal place.uiAmount(number|null): the balance, using mint-prescribed decimals [DEPRECATED].uiAmountString(string): the balance as a string, using mint-prescribed decimals.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountBalance",
"params": ["7nxXxpEEsAFf5CSqapwjBjt65xnQUBAdug2pXS89YzmY"]
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374621302
},
"value": {
"amount": "828545484",
"decimals": 6,
"uiAmount": 828.545484,
"uiAmountString": "828.545484"
}
}
}
getTokenAccountsByDelegate
Returns all SPL Token accounts by approved Delegate.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<string>(required): the pubkey of account delegate to query, as base-58 encoded string.<object>(required): either:mint(string): the pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; orprogramId(string): the pubkey of the Token program that owns the accounts, as base-58 encoded string.
<object>(optional): the configuration object containing the following fields:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
encoding(string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedatafield is typestring.dataSlice(object; optional): limits the returned account data using the providedoffset: <usize>andlength: <usize>fields; only available for "base58", "base64" or "base64+zstd" encodings.minContextSlot(number; optional): sets the minimum slot that the request can be evaluated at.
Returns
The result contains the value object with the following fields:
pubkey(string): the account Pubkey as base-58 encoded string.account(object): a JSON object, with the following subfields:lamports(u64): the number of lamports assigned to this account, as a u64.owner(string): the base-58 encoded Pubkey of the program this account has been assigned to.data(object): the Token state data associated with the account, either as encoded binary data or in JSON format{<program>: <state>}.executable(boolean): a boolean indicating if the account contains a program (and is strictly read-only).rentEpoch(u64): the epoch at which this account will next owe rent, as u64.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByDelegate",
"params": [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed"
}
]
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"account": {
"data": {
"program": "spl-token",
"parsed": {
"info": {
"tokenAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"state": "initialized",
"isNative": false,
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
"owner": "CnPoSPKXu7wJqxe59Fs72tkBeALovhsCxYeFwPCQH9TD"
},
"type": "account"
},
"space": 165
},
"executable": false,
"lamports": 1726080,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 4
},
"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp"
}
]
},
"id": 1
}
getTokenAccountsByOwner
Returns all SPL Token accounts by token owner.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<string>(required): the pubkey of account owner to query, as base-58 encoded string.<object>(required): either:mint(string): the pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; orprogramId(string): the pubkey of the Token program that owns the accounts, as base-58 encoded string.
<object>(optional): the configuration object containing the following fields:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
encoding(string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedatafield is typestring.dataSlice(object): limits he returned account data using the providedoffset: <usize>andlength: <usize>fields; only available for "base58", "base64" or "base64+zstd" encodings.minContextSlot(number): sets the minimum slot that the request can be evaluated at.
Returns
The result contains the value object with the following fields:
pubkey(string): the account Pubkey as base-58 encoded string.account(object): a JSON object, with the following subfields:lamports(u64): the number of lamports assigned to this account, as a u64.owner(string): the base-58 encoded Pubkey of the program this account has been assigned to.data(object): the Token state data associated with the account, either as encoded binary data or in JSON format{<program>: <state>}.executable(boolean): a boolean indicating if the account contains a program (and is strictly read-only).rentEpoch(u64): the epoch at which this account will next owe rent, as u64.
Request parameters
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwner",
"params": [
"4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F",
{
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"
},
{
"encoding": "jsonParsed"
}
]
}'
Response parameters
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"account": {
"data": {
"program": "spl-token",
"parsed": {
"accountType": "account",
"info": {
"tokenAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"state": "initialized",
"isNative": false,
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
"owner": "4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F"
},
"type": "account"
},
"space": 165
},
"executable": false,
"lamports": 1726080,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 4
},
"pubkey": "C2gJg6tKpQs41PRS1nC8aw3ZKNZK3HQQZGVrDFDup5nx"
}
]
},
"id": 1
}
getTokenLargestAccounts
Returns the 20 largest accounts of a particular SPL Token type.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<string>(required): the Pubkey of token Mint to query, as base-58 encoded string.<object>(optional): the configuration object containing the following field:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
Returns
The result contains the value object with the following fields:
address(string): the address of the token account.amount(string): the raw token account balance without decimals, a string representation of u64.decimals(u8): the number of base 10 digits to the right of the decimal place.uiAmount(number|null): the token account balance, using mint-prescribed decimals [DEPRECATED].uiAmountString(string): the token account balance as a string, using mint-prescribed decimals.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenLargestAccounts",
"params": ["So11111111111111111111111111111111111111112"]
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374624734
},
"value": [
{
"address": "35akt5uJn73ZN9FkGgBKpRwbW5scoqV7M1N59cwb4TKV",
"amount": "11109337918819635",
"decimals": 9,
"uiAmount": 11109337.918819636,
"uiAmountString": "11109337.918819635"
},
{
"address": "2ceB4kejtRYjPi2tC6KP9pvmRfcEtrukPT18rWV4yejb",
"amount": "1003836020391687",
"decimals": 9,
"uiAmount": 1003836.020391687,
"uiAmountString": "1003836.020391687"
}
]
},
"id": 1
}
getTokenSupply
Returns the total supply of an SPL Token type.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<string>(required): the Pubkey of token Mint to query, as base-58 encoded string.<object>(optional): the configuration object containing the following field:commitment(string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
Returns
The result contains the value object with the following fields:
amount(string): the raw total token supply without decimals, a string representation of u64.decimals(u8): the number of base 10 digits to the right of the decimal place.uiAmount(number|null): the total token supply, using mint-prescribed decimals [DEPRECATED].uiAmountString(string): the total token supply as a string, using mint-prescribed decimals.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenSupply",
"params": ["So11111111111111111111111111111111111111112"]
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374624888
},
"value": {
"amount": "0",
"decimals": 9,
"uiAmount": 0.0,
"uiAmountString": "0"
}
}
}
getTransaction
Returns transaction details for a confirmed transaction.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<string>(required): the transaction signature as base-58 encoded string.<object>(optional): the configuration object containing the following optional fields:encoding(string): encoding for each returned Transaction, either "json", "jsonParsed", "base58" (slow), "base64". If parameter not provided, the default encoding is "json". "jsonParsed" encoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in thetransaction.message.instructionslist. If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts,data, andprogramIdIndexfields).commitment(string; default: "finalized"): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
maxSupportedTransactionVersion(number): sets the max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and any versioned transaction will prompt the error.
Returns
null: if transaction is not found or not confirmed.<object>: if transaction is confirmed, an object with the following fields:slot(u64): the slot this transaction was processed in.transaction(object|[string,encoding]): a transaction object, either in JSON format or encoded binary data, depending on encoding parameter.blockTime(i64|null): the estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available.meta(object|null): the transaction status metadata object:err(object|null): Error if transaction failed, null if transaction succeeded. See the TransactionError definitions.fee(u64): the fee this transaction was charged, as u64 integer.preBalances(array): an array of u64 account balances from before the transaction was processed.postBalances(array): an array of u64 account balances after the transaction was processed.innerInstructions(array|null): the list of inner instructions ornullif inner instruction recording was not enabled during this transaction.preTokenBalances(array|undefined): the list of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction.postTokenBalances(array|undefined): the list of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction.logMessages(array|null): an array of string log messages or null if log message recording was not enabled during this transaction.- [DEPRECATED]
status: <object>: the transaction status:"Ok": <null>: the transaction was successful."Err": <ERR>: the transaction failed with TransactionError.
rewards(array|null): the transaction-level rewards, populated if rewards are requested; an array of JSON objects containing:pubkey(string): the public key, as base-58 encoded string, of the account that received the reward.lamports(i64): the number of reward lamports credited or debited by the account, as a i64.postBalance(u64): the account balance in lamports after the reward was applied.rewardType(string): the type of reward: currently only "rent", other types may be added in the future.commission(u8|undefined): a vote account commission when the reward was credited, only present for voting and staking rewards.
loadedAddresses(object|undefined): the transaction addresses loaded from address lookup tables. Undefined ifmaxSupportedTransactionVersionis not set in request params.writable(array[string]): the ordered list of base-58 encoded addresses for writable loaded accounts.readonly(array[string]): the ordered list of base-58 encoded addresses for readonly loaded accounts.
returnData(object|undefined): the most-recent return data generated by an instruction in the transaction, with the following fields:programId(string): the program that generated the return data, as base-58 encoded Pubkey.data([string, encoding]): the return data itself, as base-64 encoded binary data.
computeUnitsConsumed(u64|undefined): the number of compute units consumed by the transaction.
version("legacy"|number|undefined): the transaction version. Undefined ifmaxSupportedTransactionVersionis not set in request params.
Request example 1
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransaction",
"params": [
"jS5UBJWbrxL9DM86LoGznZtqg8q8rP3xPmMv77s7F7qdCwQFg7cchxWHdRSw5X7Bmuvy6dTaejMcgjv2XJQ9dfD",
{
"encoding": "json",
"maxSupportedTransactionVersion": 0
}
]
}'
Response example 1
{
"jsonrpc": "2.0",
"result": {
"blockTime": 1744798149,
"meta": {
"computeUnitsConsumed": 4726,
"err": null,
"fee": 5000,
"innerInstructions": [],
"loadedAddresses": {
"readonly": [],
"writable": []
},
"logMessages": [
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]",
"Program log: Instruction: Transfer",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4726 of 200000 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success"
],
"postBalances": [
35199803303,
2039280,
2039280,
934087680
],
"postTokenBalances": [
{
"accountIndex": 1,
"mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
"owner": "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "828545485",
"decimals": 6,
"uiAmount": 828.545485,
"uiAmountString": "828.545485"
}
},
{
"accountIndex": 2,
"mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
"owner": "DjGkZ6k5hMkaxMAboqc9MUrL8zq59Q8aQUuF6Fmr6DUD",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "1109995438",
"decimals": 6,
"uiAmount": 1109.995438,
"uiAmountString": "1109.995438"
}
}
],
"preBalances": [
35199808303,
2039280,
2039280,
934087680
],
"preTokenBalances": [
{
"accountIndex": 1,
"mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
"owner": "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "828545486",
"decimals": 6,
"uiAmount": 828.545486,
"uiAmountString": "828.545486"
}
},
{
"accountIndex": 2,
"mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
"owner": "DjGkZ6k5hMkaxMAboqc9MUrL8zq59Q8aQUuF6Fmr6DUD",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "1109995437",
"decimals": 6,
"uiAmount": 1109.995437,
"uiAmountString": "1109.995437"
}
}
],
"rewards": [],
"status": {
"Ok": null
}
},
"slot": 374619973,
"transaction": {
"message": {
"accountKeys": [
"EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo",
"7nxXxpEEsAFf5CSqapwjBjt65xnQUBAdug2pXS89YzmY",
"HdUKfS4QwKUQawoLXNyDdsut11mtoYRyntFrhhjdhgR1",
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
],
"addressTableLookups": [],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 1,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [
1,
2,
0,
0
],
"data": "3DdGGhkhJbjm",
"programIdIndex": 3,
"stackHeight": null
}
],
"recentBlockhash": "5jKHQZzdu7kazYmicjPgwANsDwAqJnjWCYR1yjEVDZBL"
},
"signatures": [
"jS5UBJWbrxL9DM86LoGznZtqg8q8rP3xPmMv77s7F7qdCwQFg7cchxWHdRSw5X7Bmuvy6dTaejMcgjv2XJQ9dfD"
]
},
"version": 0
},
"id": 1
}
Request example 2
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransaction",
"params": [
"jS5UBJWbrxL9DM86LoGznZtqg8q8rP3xPmMv77s7F7qdCwQFg7cchxWHdRSw5X7Bmuvy6dTaejMcgjv2XJQ9dfD",
{
"encoding": "base64",
"maxSupportedTransactionVersion": 0
}
]
}'
Response example 2
{
"jsonrpc": "2.0",
"result": {
"blockTime": 1744798149,
"meta": {
"computeUnitsConsumed": 4726,
"err": null,
"fee": 5000,
"innerInstructions": [],
"loadedAddresses": {
"readonly": [],
"writable": []
},
"logMessages": [
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]",
"Program log: Instruction: Transfer",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4726 of 200000 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success"
],
"postBalances": [
35199803303,
2039280,
2039280,
934087680
],
"postTokenBalances": [
{
"accountIndex": 1,
"mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
"owner": "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "828545485",
"decimals": 6,
"uiAmount": 828.545485,
"uiAmountString": "828.545485"
}
},
{
"accountIndex": 2,
"mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
"owner": "DjGkZ6k5hMkaxMAboqc9MUrL8zq59Q8aQUuF6Fmr6DUD",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "1109995438",
"decimals": 6,
"uiAmount": 1109.995438,
"uiAmountString": "1109.995438"
}
}
],
"preBalances": [
35199808303,
2039280,
2039280,
934087680
],
"preTokenBalances": [
{
"accountIndex": 1,
"mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
"owner": "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "828545486",
"decimals": 6,
"uiAmount": 828.545486,
"uiAmountString": "828.545486"
}
},
{
"accountIndex": 2,
"mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
"owner": "DjGkZ6k5hMkaxMAboqc9MUrL8zq59Q8aQUuF6Fmr6DUD",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "1109995437",
"decimals": 6,
"uiAmount": 1109.995437,
"uiAmountString": "1109.995437"
}
}
],
"rewards": [],
"status": {
"Ok": null
}
},
"slot": 374619973,
"transaction": [
"ASSXkS4gFdRPjAgYMtI83mxAdkQQxNnrNjVo0/8n3PuyIfJiogZfy+QQZYpG/KbPbARMNWYYkgyNQtgHSfk+AgiAAQABBMxddFcL+KHOvfWKqE5HeL1iR4V7zrweiMVtVjfN1B7OZOwM3pq0f7lZsDDur9i+ue/ujyUjQwUnXvJRe7/+3hP3EsrzEUsyPOtXf0utjSb34dXGwknd9iobwU0NFQ5NrAbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCpRkXQbtykq1Yx/ZUrutYrW1qb5/p2XC9uMes1kL5LbhcBAwQBAgAACQMBAAAAAAAAAAA=",
"base64"
],
"version": 0
},
"id": 1
}
getTransactionCount
Returns the current Transaction count from the ledger.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<object>(optional): the configuration object containing the following fields:- commitment (string; optional): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:
finalized: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmed: the node will query the most recent block that has been voted on by supermajority of the cluster.- it incorporates votes from gossip and replay.
- it does not count votes on descendants of a block, only direct votes on that block.
- this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
processed: the node will query its most recent block. Note that the block may still be skipped by the cluster.
minContextSlot(number): sets the minimum slot that the request can be evaluated at.
- commitment (string; optional): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment:
Returns
<u64>: the count.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransactionCount"
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": 15541529698
}
getVersion
Returns the current solana versions running on the node.
Parameters
id(integer; required): a request ID (example: 1).jsonrpc(string; required): a JSON RPC spec used (example: 2.0).method(string; required): a method used for the request.params(array; required): None.
Returns
The result object contains the following parameters:
solana-core: the software version of solana-core.feature-set: a unique identifier of the current software's feature set.
Request parameters
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getVersion"
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"feature-set": 3294202862,
"solana-core": "2.2.3"
}
}