cURL
curl --request POST \
--url https://devnet.helius-rpc.com/getCompressedTokenBalancesByOwner \
--header 'Content-Type: application/json' \
--data '
{
"id": "test-account",
"jsonrpc": "2.0",
"method": "getCompressedTokenBalancesByOwner",
"params": {
"owner": "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: 'getCompressedTokenBalancesByOwner',
params: {
owner: '111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj',
cursor: '3J98t1WpEZ73CNm',
limit: 1,
mint: '111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj'
}
})
};
fetch('https://devnet.helius-rpc.com/getCompressedTokenBalancesByOwner', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://devnet.helius-rpc.com/getCompressedTokenBalancesByOwner"
payload = {
"id": "test-account",
"jsonrpc": "2.0",
"method": "getCompressedTokenBalancesByOwner",
"params": {
"owner": "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": {
"token_balances": [
{
"balance": 100,
"mint": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj"
}
],
"cursor": "3J98t1WpEZ73CNm"
}
}
}{
"error": {
"code": 123,
"message": "<string>"
},
"id": "<string>",
"jsonrpc": "<string>"
}{
"error": {
"code": 123,
"message": "<string>"
},
"id": "<string>",
"jsonrpc": "<string>"
}Methods
Getcompressedtokenbalancesbyowner
Retrieves all token balances for compressed accounts owned by an address. Overview with RPC method guide.
POST
/
getCompressedTokenBalancesByOwner
cURL
curl --request POST \
--url https://devnet.helius-rpc.com/getCompressedTokenBalancesByOwner \
--header 'Content-Type: application/json' \
--data '
{
"id": "test-account",
"jsonrpc": "2.0",
"method": "getCompressedTokenBalancesByOwner",
"params": {
"owner": "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: 'getCompressedTokenBalancesByOwner',
params: {
owner: '111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj',
cursor: '3J98t1WpEZ73CNm',
limit: 1,
mint: '111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj'
}
})
};
fetch('https://devnet.helius-rpc.com/getCompressedTokenBalancesByOwner', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://devnet.helius-rpc.com/getCompressedTokenBalancesByOwner"
payload = {
"id": "test-account",
"jsonrpc": "2.0",
"method": "getCompressedTokenBalancesByOwner",
"params": {
"owner": "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": {
"token_balances": [
{
"balance": 100,
"mint": "111111131h1vYVSYuKP6AhS86fbRdMw9XHiZAvAaj"
}
],
"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:
getCompressedTokenBalancesByOwner Show child attributes
Show child attributes
Was this page helpful?
⌘I