curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByDelegateV2",
"params": [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed",
"limit": 1000,
"excludeZero": true
}
]
}
'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"apiVersion": "3.0.0",
"slot": 372910193
},
"value": {
"accounts": [
{
"account": {
"data": {
"parsed": {
"info": {
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "250000000",
"decimals": 6,
"uiAmount": 250,
"uiAmountString": "250"
},
"isNative": false,
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"owner": "CnPoSPKXu7wJqxe59Fs72tkBeALovhsCxYeFwPCQH9TD",
"state": "initialized",
"tokenAmount": {
"amount": "1482093115",
"decimals": 6,
"uiAmount": 1482.093115,
"uiAmountString": "1482.093115"
}
},
"type": "account"
},
"program": "spl-token",
"space": 165
},
"executable": false,
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 18446744073709552000,
"space": 165
},
"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp"
}
],
"hasMore": true,
"nextCursor": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp",
"totalCount": 2841
}
}
}
Custom queries
getTokenAccountsByDelegateV2 RPC Method
Page through every token account that approved a delegate, with a cursor, exact totals, changedSince and excludeZero. getTokenAccountsByDelegateV2 RPC parameters and examples.
POST
/
curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByDelegateV2",
"params": [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed",
"limit": 1000,
"excludeZero": true
}
]
}
'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"apiVersion": "3.0.0",
"slot": 372910193
},
"value": {
"accounts": [
{
"account": {
"data": {
"parsed": {
"info": {
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "250000000",
"decimals": 6,
"uiAmount": 250,
"uiAmountString": "250"
},
"isNative": false,
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"owner": "CnPoSPKXu7wJqxe59Fs72tkBeALovhsCxYeFwPCQH9TD",
"state": "initialized",
"tokenAmount": {
"amount": "1482093115",
"decimals": 6,
"uiAmount": 1482.093115,
"uiAmountString": "1482.093115"
}
},
"type": "account"
},
"program": "spl-token",
"space": 165
},
"executable": false,
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 18446744073709552000,
"space": 165
},
"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp"
}
],
"hasMore": true,
"nextCursor": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp",
"totalCount": 2841
}
}
}
Page through every token account that approved an address as its delegate with getTokenAccountsByDelegateV2. Powered by Ridge DB. It takes the same arguments as getTokenAccountsByDelegate, plus paging options, so a delegate approved by thousands of accounts loads in pages instead of one huge reply.
- Pass exactly one of
mintorprogramId.programIdmust be the SPL Token or Token-2022 program. limitis 1 to 10,000 per page (default 1,000). PassnextCursorback ascursor, with the same filter and options, untilhasMoreis false.- Every page includes
totalCount, the exact number of matching accounts. excludeZeroskips empty accounts and returns the largest balances first. Without it, accounts come back in address order.changedSincereturns only accounts changed after that slot.- Without
encoding, account data comes back as base64.
Body
application/json
Parameters for paging through token accounts approved to a delegate.
- Option 1 · string
- Option 2 · object
- Option 3 · object
Delegate address to query, as a base-58 encoded string. Returns token accounts that approved this address as their delegate.
Example:
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T"
Was this page helpful?