Get user balances
curl --request GET \
--url https://api.mainnet.kuru.io/api/v1/users/{userId}/balancesconst options = {method: 'GET'};
fetch('https://api.mainnet.kuru.io/api/v1/users/{userId}/balances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mainnet.kuru.io/api/v1/users/{userId}/balances"
response = requests.get(url)
print(response.text){
"feedEpoch": 18,
"data": [
{
"tokenAddress": "0xb01dc575a7ef75e58a05d2bde73ab79f8e7dd0be",
"total": "9072874016",
"available": "9072874016",
"reserved": "0"
}
],
"state": "finalized",
"servedView": "finalized",
"globalUserSeq": null,
"truncated": false
}
Data Source REST methods
Get finalized user balances
Read all finalized balances or select one token.
GET
/
api
/
v1
/
users
/
{userId}
/
balances
Get user balances
curl --request GET \
--url https://api.mainnet.kuru.io/api/v1/users/{userId}/balancesconst options = {method: 'GET'};
fetch('https://api.mainnet.kuru.io/api/v1/users/{userId}/balances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mainnet.kuru.io/api/v1/users/{userId}/balances"
response = requests.get(url)
print(response.text){
"feedEpoch": 18,
"data": [
{
"tokenAddress": "0xb01dc575a7ef75e58a05d2bde73ab79f8e7dd0be",
"total": "9072874016",
"available": "9072874016",
"reserved": "0"
}
],
"state": "finalized",
"servedView": "finalized",
"globalUserSeq": null,
"truncated": false
}
Response JSON below is an illustrative testnet snapshot, not a live mainnet result. Use the selected server and its network-specific addresses for actual requests.
string
required
Unsigned decimal Kuru user ID.
string
Optional lowercase 20-byte token address. When present,
data contains zero
or one matching balance.integer | null
required
Feed epoch containing
globalUserSeq.array
required
Up to 2,000 balances ordered by token address, or zero to one entry when
tokenAddress is supplied.string | null
required
Finalized user sequence covered by the snapshot.
boolean
required
true when additional balances were omitted from an unfiltered request.total, available, and reserved use the token’s native decimal units, and
total = available + reserved. When both cursor fields are non-null, install
the snapshot and subscribe to userBalances@f with the same feedEpoch and
globalUserSeq.
{
"feedEpoch": 18,
"data": [
{
"tokenAddress": "0xb01dc575a7ef75e58a05d2bde73ab79f8e7dd0be",
"total": "9072874016",
"available": "9072874016",
"reserved": "0"
}
],
"state": "finalized",
"servedView": "finalized",
"globalUserSeq": null,
"truncated": false
}