SolanaドキュメントRPC
Query account states, balances, token holdings, and program-specific storage data.
getProgramAccounts
Get program accounts owned by a specific program ID.
Parameters
| Name | Type | Description |
|---|---|---|
programId* | string | The public key of the program, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ filters | array | Filters to apply to the program accounts. Each filter is a base58-encoded string representing an address or a specific filter type. |
└ minContextSlot | integer | The minimum context slot for the account info. |
└ sortResults | boolean | Whether to sort the results. |
└ withContext | boolean | Whether to include the context in the response. |
Result
| Field | Type | Description |
|---|---|---|
result | array<RpcKeyedAccount> | getProgramAccounts - Returns program-owned accounts |
└ [] | object | Array item |
└ account | object | |
└ data | array<string> | Account data |
└ executable | boolean | Whether this account contains executable code |
└ lamports | integer | Account balance in lamports |
└ owner | string | Program that owns this account |
└ rentEpoch | integer | Epoch at which this account will next owe rent |
└ pubkey | string |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
{
"commitment": "Processed",
"dataSlice": {
"length": 0,
"offset": 0
},
"encoding": "binary",
"filters": [],
"minContextSlot": 123456789,
"sortResults": true,
"withContext": true
}
]
}getLargestAccounts
Returns the 20 largest accounts by lamport balance.
Parameters
| Name | Type | Description |
|---|---|---|
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ filter | string | The filter to apply to the largest accounts. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<RpcAccountBalance> | |
└ [] | object | Array item |
└ address | string | |
└ lamports | integer |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getLargestAccounts",
"params": [
{
"commitment": "Processed",
"filter": "circulating"
}
]
}getSupply
Returns information about the current token supply.
Parameters
| Name | Type | Description |
|---|---|---|
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ excludeNonCirculatingAccountsList | boolean | Whether to exclude non-circulating accounts. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | object | |
└ circulating | integer | |
└ nonCirculating | integer | |
└ nonCirculatingAccounts | array<string> | |
└ total | integer |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getSupply",
"params": [
{
"commitment": "Processed",
"excludeNonCirculatingAccountsList": true
}
]
}getTokenLargestAccounts
Returns the largest accounts for a given token mint.
Parameters
| Name | Type | Description |
|---|---|---|
mint* | string | The public key of the token mint, as a base-58 encoded string. |
commitment | object | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<RpcTokenAccountBalance> | |
└ [] | object | Array item |
└ address | string | |
└ amount | string | Token amount as string |
└ decimals | integer | Number of decimals |
└ uiAmount | number | Human readable amount as float |
└ uiAmountString | string | Human readable amount as string |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenLargestAccounts",
"params": [
"<some-mint>",
{
"commitment": "Processed"
}
]
}getTokenAccountsByOwner
Returns all SPL Token accounts by owner.
Parameters
| Name | Type | Description |
|---|---|---|
owner* | string | The public key of the account owner, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ minContextSlot | integer | The minimum context slot for the account info. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<RpcKeyedAccount> | |
└ [] | object | Array item |
└ account | object | |
└ data | array<string> | Account data |
└ executable | boolean | Whether this account contains executable code |
└ lamports | integer | Account balance in lamports |
└ owner | string | Program that owns this account |
└ rentEpoch | integer | Epoch at which this account will next owe rent |
└ pubkey | string |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwner",
"params": [
"11111111111111111111111111111111",
{
"commitment": "Processed",
"dataSlice": {
"length": 0,
"offset": 0
},
"encoding": "binary",
"minContextSlot": 123456789
}
]
}getTokenAccountsByDelegate
Returns all SPL Token accounts by delegate.
Parameters
| Name | Type | Description |
|---|---|---|
delegate* | string | The public key of the delegate, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ minContextSlot | integer | The minimum context slot for the account info. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<RpcKeyedAccount> | |
└ [] | object | Array item |
└ account | object | |
└ data | array<string> | Account data |
└ executable | boolean | Whether this account contains executable code |
└ lamports | integer | Account balance in lamports |
└ owner | string | Program that owns this account |
└ rentEpoch | integer | Epoch at which this account will next owe rent |
└ pubkey | string |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByDelegate",
"params": [
"<some-delegate>",
{
"commitment": "Processed",
"dataSlice": {
"length": 0,
"offset": 0
},
"encoding": "binary",
"minContextSlot": 123456789
}
]
}getAccountInfo
Returns detailed information about an account given its public key.
Parameters
| Name | Type | Description |
|---|---|---|
pubkey* | string | The public key of the account to query, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ minContextSlot | integer | The minimum context slot for the account info. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | object | |
└ data | array<string> | Account data |
└ executable | boolean | Whether this account contains executable code |
└ lamports | integer | Account balance in lamports |
└ owner | string | Program that owns this account |
└ rentEpoch | integer | Epoch at which this account will next owe rent |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getAccountInfo",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
{
"commitment": "Processed",
"dataSlice": {
"length": 0,
"offset": 0
},
"encoding": "binary",
"minContextSlot": 123456789
}
]
}getBlockCommitment
Returns commitment levels for a given block (slot).
Parameters
| Name | Type | Description |
|---|---|---|
block* | integer | The slot to query for block commitment. |
Result
| Field | Type | Description |
|---|---|---|
commitment | array | |
totalStake | integer |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getBlockCommitment",
"params": [
0
]
}getMultipleAccounts
Returns account information for multiple public keys in a single call.
Parameters
| Name | Type | Description |
|---|---|---|
pubkeys* | array[string] | An array of public keys to query, as base-58 encoded strings. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ minContextSlot | integer | The minimum context slot for the account info. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<any> |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getMultipleAccounts",
"params": [
[
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
],
{
"commitment": "Processed",
"dataSlice": {
"length": 0,
"offset": 0
},
"encoding": "binary",
"minContextSlot": 123456789
}
]
}getTokenAccountBalance
Returns the balance of a token account, given its public key.
Parameters
| Name | Type | Description |
|---|---|---|
pubkey* | string | The public key of the token account to query, as a base-58 encoded string. |
commitment | object | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | object | |
└ amount | string | Token amount as string |
└ decimals | integer | Number of decimals |
└ uiAmount | number | Human readable amount as float |
└ uiAmountString | string | Human readable amount as string |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountBalance",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
{
"commitment": "Processed"
}
]
}getTokenSupply
Returns the total supply of a token, given its mint address.
Parameters
| Name | Type | Description |
|---|---|---|
mint* | string | The public key of the token mint, as a base-58 encoded string. |
commitment | object | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | object | |
└ amount | string | Token amount as string |
└ decimals | integer | Number of decimals |
└ uiAmount | number | Human readable amount as float |
└ uiAmountString | string | Human readable amount as string |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenSupply",
"params": [
"<some-mint>",
{
"commitment": "Processed"
}
]
}getBalance
Returns the balance for a given address.
Parameters
| Name | Type | Description |
|---|---|---|
pubkey* | string | The public key of the account to query, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ minContextSlot | integer | The minimum context slot for the context. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | integer |
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "getBalance",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
{
"commitment": "Processed",
"minContextSlot": 123456789
}
]
}Is this page helpful?