JSON RPC Methods
Getcompressedtokenaccountbydelegate
Retrieve compressed token accounts that are partially or fully delegated to a given delegate. Overview with RPC method guide.
POST
/
getCompressedTokenAccountsByDelegate
cURL
curl --request POST \
--url https://devnet.helius-rpc.com/getCompressedTokenAccountsByDelegate \
--header 'Content-Type: application/json' \
--data '
{
"id": "test-account",
"jsonrpc": "2.0",
"method": "getCompressedTokenAccountsByDelegate",
"params": {
"delegate": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"cursor": "3J98t1WpEZ73CNm",
"limit": 1,
"mint": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj"
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'test-account',
jsonrpc: '2.0',
method: 'getCompressedTokenAccountsByDelegate',
params: {
delegate: '111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj',
cursor: '3J98t1WpEZ73CNm',
limit: 1,
mint: '111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj'
}
})
};
fetch('https://devnet.helius-rpc.com/getCompressedTokenAccountsByDelegate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://devnet.helius-rpc.com/getCompressedTokenAccountsByDelegate"
payload = {
"id": "test-account",
"jsonrpc": "2.0",
"method": "getCompressedTokenAccountsByDelegate",
"params": {
"delegate": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"cursor": "3J98t1WpEZ73CNm",
"limit": 1,
"mint": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "test-account",
"jsonrpc": "2.0",
"error": {
"code": 123,
"message": "<string>"
},
"result": {
"context": {
"slot": 100
},
"value": {
"items": [
{
"account": {
"hash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
"lamports": 100,
"leafIndex": 100,
"owner": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"slotCreated": 100,
"tree": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"address": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"data": {
"data": "SGVsbG8sIFdvcmxkIQ==",
"dataHash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
"discriminator": 100
},
"seq": 100
},
"tokenData": {
"amount": 100,
"mint": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"owner": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"delegate": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"tlv": "SGVsbG8sIFdvcmxkIQ=="
}
}
],
"cursor": "3J98t1WpEZ73CNm"
}
}
}{
"error": {
"code": 123,
"message": "<string>"
},
"id": "<string>",
"jsonrpc": "<string>"
}{
"error": {
"code": 123,
"message": "<string>"
},
"id": "<string>",
"jsonrpc": "<string>"
}Body
application/json
An ID to identify the request.
Available options:
test-account The version of the JSON-RPC protocol.
Available options:
2.0 The name of the method to invoke.
Available options:
getCompressedTokenAccountsByDelegate Show child attributes
Show child attributes
Was this page helpful?
Previous
GetcompressionsignaturesforaccountRetrieve the signatures of the transactions that closed or opened a compressed account with the given hash. Overview with RPC method guide.
Next
⌘I
cURL
curl --request POST \
--url https://devnet.helius-rpc.com/getCompressedTokenAccountsByDelegate \
--header 'Content-Type: application/json' \
--data '
{
"id": "test-account",
"jsonrpc": "2.0",
"method": "getCompressedTokenAccountsByDelegate",
"params": {
"delegate": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"cursor": "3J98t1WpEZ73CNm",
"limit": 1,
"mint": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj"
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'test-account',
jsonrpc: '2.0',
method: 'getCompressedTokenAccountsByDelegate',
params: {
delegate: '111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj',
cursor: '3J98t1WpEZ73CNm',
limit: 1,
mint: '111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj'
}
})
};
fetch('https://devnet.helius-rpc.com/getCompressedTokenAccountsByDelegate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://devnet.helius-rpc.com/getCompressedTokenAccountsByDelegate"
payload = {
"id": "test-account",
"jsonrpc": "2.0",
"method": "getCompressedTokenAccountsByDelegate",
"params": {
"delegate": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"cursor": "3J98t1WpEZ73CNm",
"limit": 1,
"mint": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "test-account",
"jsonrpc": "2.0",
"error": {
"code": 123,
"message": "<string>"
},
"result": {
"context": {
"slot": 100
},
"value": {
"items": [
{
"account": {
"hash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
"lamports": 100,
"leafIndex": 100,
"owner": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"slotCreated": 100,
"tree": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"address": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"data": {
"data": "SGVsbG8sIFdvcmxkIQ==",
"dataHash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
"discriminator": 100
},
"seq": 100
},
"tokenData": {
"amount": 100,
"mint": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"owner": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"delegate": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj",
"tlv": "SGVsbG8sIFdvcmxkIQ=="
}
}
],
"cursor": "3J98t1WpEZ73CNm"
}
}
}{
"error": {
"code": 123,
"message": "<string>"
},
"id": "<string>",
"jsonrpc": "<string>"
}{
"error": {
"code": 123,
"message": "<string>"
},
"id": "<string>",
"jsonrpc": "<string>"
}