Solana — Methods
API reference for Solana. All methods ->
getAccountInfo
Returns all information associated with the account of provided 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>: pubkey of account to query, as base-58 encoded string.<object>(optional): 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): limit 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
<null>: if the requested account doesn't exist.<object>: otherwise a JSON object containing:lamports(u64): number of lamports assigned to this account, as a u64.owner(string): 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): 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",
"method": "getAccountInfo",
"params": [
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
{
"encoding": "base58"
}
],
"id": 1
}'
Response example 1
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374431575
},
"value": {
"data": [
"",
"base58"
],
"executable": false,
"lamports": 88860054690252,
"owner": "11111111111111111111111111111111",
"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",
"method": "getAccountInfo",
"params": [
"4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA",
{
"encoding": "jsonParsed"
}
],
"id": 1
}'
Response example 2
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374431699
},
"value": {
"data": [
"",
"base64"
],
"executable": false,
"lamports": 7998763451,
"owner": "2WRuhE4GJFoE23DYzp2ij6ZnuQ8p9mJeU6gDgfsjR4or",
"rentEpoch": 18446744073709551615,
"space": 0
}
}
}
getBalance
Returns the balance of the account of provided 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>: pubkey of account to query, as base-58 encoded string. -
<object>: 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; optional): sets the minimum slot that the request can be evaluated at.
-
Returns
value(u64): an account balance.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getBalance",
"params": [
"4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
],
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374431850
},
"value": 7998763451
}
}
getBlock
Returns identity and transaction information about a confirmed block in 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):<u64>: slot, as a u64 integer.<object>(optional): 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).transactionDetails(string): level of transaction detail to return, either "full", "accounts", "signatures", or "none". If parameter not provided, the default detail level is "full". If "accounts" are requested, transaction details only include signatures and an annotated list of accounts in each transaction. Transaction metadata is limited to only: fee, err, pre_balances, post_balances, pre_token_balances, and post_token_balances.rewards(boolean): whether to populate therewardsarray. If parameter not provided, the default includes rewards.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 block contains a transaction with a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and a block containing any versioned transaction will prompt the error.
Returns
<null>: if specified block is not confirmed.<object>: if block is confirmed, an object with the following fields:blockhash(string): the blockhash of this block, as base-58 encoded string.previousBlockhash(string): the blockhash of this block's parent, as base-58 encoded string; if the parent block is not available due to ledger cleanup, this field will return "11111111111111111111111111111111".parentSlot(u64): the slot index of this block's parent.transactions(array): to be included if "full" transaction details are requested; an array of JSON objects containing:transaction(object|[string,encoding]): a transaction object, either in JSON format or encoded binary data, depending on encoding parameter.meta(object): a transaction status metadata object, containingnullor:err(object|null): an error if transaction failed, null if transaction succeeded. TransactionError definitions.fee(u64): a fee this transaction was charged with, 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 or null if 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 ornullif log message recording was not enabled during this transaction.rewards(array|null): 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 an i64.postBalance(u64): an account balance in lamports after the reward was applied.rewardType(string|undefined): the type of reward: "fee", "rent", "voting", "staking".commission(u8|undefined): a vote account commission when the reward was credited, only present for voting and staking rewards.
- [DEPRECATED]
status(object): a transaction status:"Ok": <null>: a transaction was successful."Err": <ERR>: a transaction failed with TransactionError.
loadedAddresses(object|undefined): transaction addresses loaded from address lookup tables. Undefined ifmaxSupportedTransactionVersionis not set in request params:writable(array[string]): an ordered list of base-58 encoded addresses for writable loaded accounts.readonly(array[string]): an 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): a transaction version; undefined ifmaxSupportedTransactionVersionis not set in request params.
signatures(array): to be included if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the block.rewards(array|undefined): block-level rewards, present 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 an i64.postBalance(u64): an account balance in lamports after the reward was applied.rewardType(string|undefined): the type of reward: "fee", "rent", "voting", "staking".commission(u8|undefined): the vote account commission when the reward was credited, included for voting and staking rewards only.
blockTime(i64|null): estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available.blockHeight(u64|null): the number of blocks beneath this block.
Request example 1
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getBlock",
"params": [370774640, {"encoding": "json","maxSupportedTransactionVersion":0,"transactionDetails":"full","rewards":false}],
"id": 1
}'
Response example 1
{
"jsonrpc": "2.0",
"result": {
"blockHeight": 358752908,
"blockTime": 1743307608,
"blockhash": "HF4FCaWTHZqoTSqeZS5xtqfvKB3crSHgqugWCC2CrF6N",
"parentSlot": 370774639,
"previousBlockhash": "2f1r7z58nr7HX92YDko28wAHTyWAHYvmDHfVjSApvw7T",
"transactions": [
{
"meta": {
"computeUnitsConsumed": 150,
"err": null,
"fee": 5000,
"innerInstructions": [],
"loadedAddresses": {
"readonly": [],
"writable": []
},
"logMessages": [
"Program 11111111111111111111111111111111 invoke [1]",
"Program 11111111111111111111111111111111 success"
],
"postBalances": [
10804309975,
10804407530,
1
],
"postTokenBalances": [],
"preBalances": [
10804315088,
10804407417,
1
],
"preTokenBalances": [],
"rewards": null,
"status": {
"Ok": null
}
},
"transaction": {
"message": {
"accountKeys": [
"ANVUJaJoVaJZELtV2AvRp7V5qPV1B84o29zAwDhPj1c2",
"4PkiqJkUvxr9P8C1UsMqGN8NJsUcep9GahDRLfmeu8UK",
"11111111111111111111111111111111"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 1,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [
0,
1
],
"data": "3Bxs4KkuG3n7y751",
"programIdIndex": 2,
"stackHeight": null
}
],
"recentBlockhash": "2XvJSKxQXyiYzdVdWQ3hQkb7FZMRnevWUtyttLCtweha"
},
"signatures": [
"32wUcJEURNhdDJve1y7giwE1zhMWRgGbNwfn3cxsLmtTznnunGEbvDjkispJCVnu7XfTmHreeLfRDpETgzczMG8B"
]
},
"version": "legacy"
}
]
},
"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",
"method": "getBlock",
"params": [370774640, "base64"],
"id": 1
}'
Response example 2
{
"jsonrpc": "2.0",
"result": {
"blockHeight": 358752908,
"blockTime": 1743307608,
"blockhash": "HF4FCaWTHZqoTSqeZS5xtqfvKB3crSHgqugWCC2CrF6N",
"parentSlot": 370774639,
"previousBlockhash": "2f1r7z58nr7HX92YDko28wAHTyWAHYvmDHfVjSApvw7T",
"rewards": [
{
"commission": null,
"lamports": 77800,
"postBalance": 1012068020241072,
"pubkey": "dv2eQHeP4RFrJZ6UeiZWoc3XTtmtZCUKxxCApCDcRNV",
"rewardType": "Fee"
}
],
"transactions": [
{
"meta": {
"computeUnitsConsumed": 150,
"err": null,
"fee": 5000,
"innerInstructions": [],
"loadedAddresses": {
"readonly": [],
"writable": []
},
"logMessages": [
"Program 11111111111111111111111111111111 invoke [1]",
"Program 11111111111111111111111111111111 success"
],
"postBalances": [
10804309975,
10804407530,
1
],
"postTokenBalances": [],
"preBalances": [
10804315088,
10804407417,
1
],
"preTokenBalances": [],
"rewards": [],
"status": {
"Ok": null
}
},
"transaction": [
"AWW00bg6XvEKFL0bfYFKxozs1lqn2iXsNGSISW8ecRprGyocrjVocrAFanSZbvhHxCtlHHELDHJQwMzkvi7AtQwBAAEDizqSQJGZ3Exs17wQBP+BB3AlC5LWj0lppkJp/w/nr98yZ0Y8gaZ3Klk/NF/WDYIThTzpRp42PYFbnRVVqliKHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFsdg39g9WrKEsn+BDMcD8H/kmr6+KwxKnn0feVGtoSUBAgIAAQwCAAAAcQAAAAAAAAA=",
"base64"
]
}
]
},
"id": 1
}
getBlockHeight
Returns the current block height of 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):<object>(optional): 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>: a current block height.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getBlockHeight",
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": 362409082,
"id": 1
}
getBlockProduction
Returns recent block production information from the current or previous epoch.
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): configuration object containing the following optional 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.
range(object): a slot range to return block production for. If parameter not provided, defaults to current epoch:firstSlot(u64): the first slot to return block production information for (inclusive).lastSlot(u64): the last slot to return block production information for (inclusive). If parameter not provided, defaults to the highest slot.
identity(string): only return results for this validator identity (base-58 encoded).
Returns
value(object): the value containing the following parameters:byIdentity(object): a dictionary of validator identities, as base-58 encoded strings. Value is a two element array containing the number of leader slots and the number of blocks produced.range(object): a block production slot range:firstSlot(u64): the first slot of the block production information (inclusive).lastSlot(u64): the last slot of block production information (inclusive).
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getBlockProduction",
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374432777
},
"value": {
"byIdentity": {
"3zvXem8vqvDYos6BKu66FV84tmDdQwgLxYSempy8tSrs": [
984,
984
],
"4mdQGkbfrFvo5eG722xCXik4hn3xzu2EJD47g7Hd4HfH": [
16,
16
],
"97YUjL2EK42M6jG5VA4fKuVxGXDfxsC5Zawd9haLQJGk": [
200,
200
]
},
"range": {
"firstSlot": 374112000,
"lastSlot": 374432777
}
}
}
}
getBlockCommitment
Returns commitment for particular 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):<u64>(required): the block identified by slot.
Returns
commitment: a commitment, comprising either:null: an unknown block.<array>: a commitment, array of u64 integers logging the amount of cluster stake in lamports that has voted on the block at each depth from 0 toMAX_LOCKOUT_HISTORY+ 1.
totalStake: a total active stake, in lamports, of the current epoch.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getBlockCommitment",
"params": [5],
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"commitment": null,
"totalStake": 157766894165168736
}
}
getBlocks
Returns a list of confirmed blocks between two 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):<u64>:start_slot, as a u64 integer.<u64>:end_slot, as u64 integer (must be no more than 500,000 blocks higher than thestart_slot).<object>: a configuration object containing the following field: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.
Returns
The result field will be an array of u64 integers listing confirmed blocks between start_slot and either end_slot, if provided, or latest confirmed block, inclusive. Max range allowed is 500,000 slots.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getBlocks",
"params": [374434259, 374434262],
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": [
374434259,
374434260,
374434261,
374434262
]
}
getBlocksWithLimit
Returns a list of confirmed blocks starting at the given slot.
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>:start_slot, as u64 integer.<u64>: limit, as u64 integer (must be no more than 500,000 blocks higher than thestart_slot).<object>(optional): a configuration object containing the following field: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.
Returns
The result field will be an array of u64 integers listing confirmed blocks starting at start_slot for up to limit blocks, inclusive.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getBlocksWithLimit",
"params": [370778924, 3],
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": [
370779536,
370779537,
370779538
]
}
getBlockTime
Returns the estimated production time of a block.
Each validator reports their UTC time to the ledger on a regular interval by intermittently adding a timestamp to a Vote for a particular block. A requested block's time is calculated from the stake-weighted mean of the Vote timestamps in a set of recent blocks recorded on 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):<u64>: the block identified by slot.
Returns
<i64>: estimated production time, as Unix timestamp (seconds since the Unix epoch).null: the timestamp is not available for this block.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getBlockTime",
"params": [374436187],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": 1744726372,
"id": 1
}
getClusterNodes
Returns information about all the nodes participating in the cluster.
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 field will be an array of JSON objects, each with the following subfields:
pubkey(string): the node public key, as base-58 encoded string.gossip(string|null): a gossip network address for the node.tpu(string|null): a TPU network address for the node.rpc(string|null): a JSON RPC network address for the node, or null if the JSON RPC service is not enabled.version(string|null): the software version of the node, or null if the version information is not available.featureSet(u32|null): the unique identifier of the node's feature set.shredVersion(u16|null): the shred version the node has been configured to use.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getClusterNodes",
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": [
{
"featureSet": 3294202862,
"gossip": "63.251.106.87:21810",
"pubkey": "DiwJZxYKQbWBn59EhUhkiB3hM1TLWiQoGvD5mpUHJscu",
"pubsub": "63.251.106.87:21812",
"rpc": "63.251.106.87:21811",
"serveRepair": "63.251.106.87:11812",
"shredVersion": 2405,
"tpu": "63.251.106.87:11803",
"tpuForwards": "63.251.106.87:11804",
"tpuForwardsQuic": "63.251.106.87:11810",
"tpuQuic": "63.251.106.87:11809",
"tpuVote": "63.251.106.87:11805",
"tvu": "63.251.106.87:11801",
"version": "2.2.3"
}
],
"id": 1
}
getEpochInfo
Returns information about the current epoch.
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): 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
The result field will be an object with the following fields:
absoluteSlot(u64): the current slot.blockHeight(u64): the current block height.epoch(u64): the current epoch.slotIndex(u64): the current slot relative to the start of the current epoch.slotsInEpoch(u64): the number of slots in this epoch.transactionCount(u64|null) total number of transactions processed without error since genesis.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getEpochInfo",
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"absoluteSlot": 374436745,
"blockHeight": 362413120,
"epoch": 866,
"slotIndex": 324745,
"slotsInEpoch": 432000,
"transactionCount": 15534671467
}
}
getEpochSchedule
Returns epoch schedule information from this cluster's genesis config.
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 is an object containing the following parameters:
slotsPerEpoch(u64): the maximum number of slots in each epoch.leaderScheduleSlotOffset(u64): the number of slots before beginning of an epoch to calculate a leader schedule for that epoch.warmup(boolean): whether epochs start short and grow.firstNormalEpoch(u64): the first normal-length epoch, log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH).firstNormalSlot(u64): MINIMUM_SLOTS_PER_EPOCH * (2.pow(firstNormalEpoch) - 1).
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getEpochSchedule",
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"firstNormalEpoch": 0,
"firstNormalSlot": 0,
"leaderScheduleSlotOffset": 432000,
"slotsPerEpoch": 432000,
"warmup": false
}
}
getFeeForMessage
Returns the fee the network will charge for a particular message.
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):message(string, required): a base-64 encoded message.<object>(optional): a configuration object containing the following optional fields:commitment(string): used for retrieving blockhash; 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; optional): sets the minimum slot that the request can be evaluated at.
Returns
<u64|null>: the fee corresponding to the message at the specified blockhash.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getFeeForMessage",
"params":[
"AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA",
{
"commitment": "processed"
}
],
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374437860
},
"value": null
}
}
getFirstAvailableBlock
Returns the slot of the lowest confirmed block that has not been purged 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): None.
Returns
<u64>: a slot.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getFirstAvailableBlock",
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": 370779475,
"id": 1
}
getGenesisHash
Returns the genesis hash.
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
<string>: the hash 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",
"method": "getGenesisHash",
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG",
"id": 1
}
getHealth
Returns the current health of the node.
If one or more --known-validator arguments are provided to solana-validator, "ok" is returned when the node has within HEALTH_CHECK_SLOT_DISTANCE slots of the highest known validator, otherwise an error is returned. "ok" is always returned if no known validators are provided.
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
If the node is healthy: "ok" If the node is unhealthy, a JSON RPC error response is returned. The specifics of the error response are UNSTABLE and may change in the future.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getHealth",
"id": 1
}'
Response example (healthy)
{
"jsonrpc": "2.0",
"result": "ok",
"id": 1
}
Response example (unhealthy)
{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "Node is unhealthy",
"data": {}
},
"id": 1
}
Response example (unhealthy; additional info)
{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "Node is behind by 42 slots",
"data": {
"numSlotsBehind": 42
}
},
"id": 1
}
getHighestSnapshotSlot
NEW: This method is only available in solana-core v1.9 or newer. Please use getSnapshotSlot for solana-core v1.8
Returns the highest slot information that the node has snapshots for.
This will find the highest full snapshot slot, and the highest incremental snapshot slot based on the full snapshot slot, if there is one.
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
<object>:full(u64): the highest full snapshot slot.incremental(u64|undefined): the highest incremental snapshot slot based onfull.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getHighestSnapshotSlot",
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"full": 374423617,
"incremental": 374438029
}
}
Response example (no snapshot)
{
"jsonrpc": "2.0",
"error": {
"code": -32008,
"message": "No snapshot"
},
"id": 1
}
getIdentity
Returns the identity pubkey for the current 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 parameter containing the following field:
identity(base-58 encoded string): the identity pubkey of the current node.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getIdentity",
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"identity": "6ZaNrpjNZMmtAaZ4Tjj7GhmgbqpRR9vnipoCgwqjCHR5"
}
}
getInflationGovernor
Returns the current inflation governor.
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 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
initial(f64): the initial inflation percentage from time 0.terminal(f64): the terminal inflation percentage.taper(f64): the rate per year at which inflation is lowered. Rate reduction is derived using the target slot time in genesis config.foundation(f64): the percentage of total inflation allocated to the foundation.foundationTerm(f64): the duration of foundation pool inflation in years.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getInflationGovernor",
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"foundation": 0.0,
"foundationTerm": 0.0,
"initial": 0.08,
"taper": 0.15,
"terminal": 0.015
}
}
getInflationRate
Returns the specific inflation values for the current epoch.
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
total(f64): the total inflation.validator(f64): the inflation allocated to validators.foundation(f64): the inflation allocated to the foundation.epoch(u64): the epoch for which these values are valid.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getInflationRate",
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"epoch": 866,
"foundation": 0.0,
"total": 0.03846001179398413,
"validator": 0.03846001179398413
}
}
getInflationReward
Returns the inflation / staking reward for a list of addresses for an epoch.
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 addresses to query, as base-58 encoded strings:<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.
epoch(u64; optional): an epoch for which the reward occurs. If omitted, the previous epoch will be used.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
epoch(u64): the epoch for which reward occurred.effectiveSlot(u64): the slot in which the rewards are effectiveamount(u64): the reward amount in lamports.postBalance(u64): the post balance of the account in lamports.commission(u8|undefined): the vote account commission when the reward was credited.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getInflationReward",
"params": [["vgcDar2pryHvMgPkKaZfh8pQy4BJxv7SpwUG7zinWjG"], {"epoch": 865}],
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"amount": 62104278891217,
"commission": 95,
"effectiveSlot": 374112000,
"epoch": 865,
"postBalance": 10748380652807189
}
]
}
getLargestAccounts
Returns the 20 largest accounts, by lamport balance (results may be cached up to two hours).
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 optional 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.
filter(string; optional): filters results by account type; currently supported:circulating|nonCirculating.
- 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
The result will be a JSON object with value equal to an array of:
<object>: a JSON object containing the following fields:address(string): the base-58 encoded address of the account.lamports(u64): the number of lamports in the account, 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",
"method": "getLargestAccounts",
"params": [
{ "filter": "nonCirculating" }
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": [
{
"lamports": 999999990000000000,
"address": "11111111111111111111111111111111"
},
{
"lamports": 854321560000000000,
"address": "SysvarC1ock11111111111111111111111111111111"
},
{
"lamports": 732000000000000000,
"address": "Stake11111111111111111111111111111111111111"
},
{
"lamports": 690000000000000000,
"address": "Vote111111111111111111111111111111111111111"
},
{
"lamports": 540000000000000000,
"address": "NativeLoader1111111111111111111111111111111"
},
{
"lamports": 500000000000000000,
"address": "Config1111111111111111111111111111111111111"
}
],
"id": 1
}
getLatestBlockhash
NEW: This method is only available in solana-core v1.9 or newer. Please use getRecentBlockhash for solana-core v1.8
Returns the latest blockhash.
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): used for retrieving blockhash); 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; optional): sets the minimum slot that the request can be evaluated at.
Returns
<object>: a JSON object with value field set to a JSON object including:blockhash(string): a hash as base-58 encoded string.lastValidBlockHeight(u64): the last block height at which the blockhash will be valid.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getLatestBlockhash",
"params": [
{
"commitment": "processed"
}
],
"id": 1
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 374442143
},
"value": {
"blockhash": "5SVbJEwUwvS2PmGSMKcshCanrCnYcDBEpCp3aR7up6GV",
"lastValidBlockHeight": 362418664
}
}
}
getLeaderSchedule
Returns the leader schedule for an epoch.
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>(optional): fetches the leader schedule for the epoch that corresponds to the provided slot. If unspecified, fetches the leader schedule for the current epoch.<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.
identity(string): returns only the results for this validator identity (base-58 encoded).
Returns
null: if requested epoch is not found.<object>: otherwise, the result field will be a dictionary of validator identities, as base-58 encoded strings, and their corresponding leader slot indices as values (indices are relative to the first slot in the requested epoch).
Request example 1
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getLeaderSchedule",
"params": [374442395],
"id": 1
}'
Response example 1
{
"jsonrpc": "2.0",
"result": {
"3zvXem8vqvDYos6BKu66FV84tmDdQwgLxYSempy8tSrs": [
2576,
2577,
2578,
2579,
3448,
3449,
3450
]
},
"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",
"method": "getLeaderSchedule",
"params": [
null,
{
"identity": "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS"
}
],
"id": 1
}'
Response example 2
{
"jsonrpc": "2.0",
"result": {
"dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS": [
12,
13,
14,
15,
32,
33,
34,
35,
44,
45,
46,
47
]
},
"id": 1
}
getMaxRetransmitSlot
Returns the max slot seen from retransmit stage.
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
<u64>: the slot.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getMaxRetransmitSlot",
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": 374443337,
"id": 1
}
getMaxShredInsertSlot
Returns the max slot seen from after shred insert.
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
<u64>: the slot.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getMaxShredInsertSlot",
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": 374443465,
"id": 1
}
getMinimumBalanceForRentExemption
Returns minimum balance required to make account rent exempt.
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):<usize>: the account data length.<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
<u64>: the minimum lamports required in an account.
Request example
curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "getMinimumBalanceForRentExemption",
"params": [50],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": 1238880,
"id": 1
}