getTokenAccountsByDelegate RPC Method
Returns all SPL Token accounts by approved Delegate.
params
stringrequired
Pubkey of account delegate to query, as base-58 encoded string
objectrequired
A JSON object with one of the following fields:
objectoptional
Configuration object containing the following fields:
result
array
An array of JSON objects containing:
Request
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "getTokenAccountsByDelegate",> "params": [> "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",> {> "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"> },> {> "encoding": "jsonParsed"> }> ]> }> '
Response
{"jsonrpc": "2.0","result": {"context": { "slot": 1114 },"value": [{"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp","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,"space": 165}}]},"id": 1}
Request
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "getTokenAccountsByDelegate",> "params": [> "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",> {> "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"> },> {> "encoding": "jsonParsed"> }> ]> }> '
params
stringrequired
Pubkey of account delegate to query, as base-58 encoded string
objectrequired
A JSON object with one of the following fields:
objectoptional
Configuration object containing the following fields:
result
Response
{"jsonrpc": "2.0","result": {"context": { "slot": 1114 },"value": [{"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp","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,"space": 165}}]},"id": 1}
array
An array of JSON objects containing:
Is this page helpful?