Unified User Balance
Queries the unified virtual token balances for a user across multiple chains.
query Unified_user_balance($address: String!, $limit: Int, $offset: Int, $chainUids: [String]) {
vcoin {
unified_user_balance(address: $address, limit: $limit, offset: $offset, chain_uids: $chainUids) {
balances {
amount
token_id
}
chain_uid
}
}
}
Example
curl --request POST \
--header 'content-type: application/json' \
--url 'https://testnet.api.euclidprotocol.com/graphql' \
--data '{"query":"query Unified_user_balance($address: String!, $limit: Int, $offset: Int, $chainUids: [String]) {\n vcoin {\n unified_user_balance(address: $address, limit: $limit, offset: $offset, chain_uids: $chainUids) {\n balances {\n amount\n token_id\n }\n chain_uid\n }\n }\n}","variables":{"address":"0x887e4aac216674d2c432798f851c1ea5d505b2e1","limit":2,"offset":1,"chainUids":null}}'
Arguments
| Argument | Type | Description |
|---|---|---|
address | String! | The user address to query balances for. |
limit | Int | Optional limit for pagination. |
offset | Int | Optional offset for pagination. |
chainUids | [String] | Optional list of chain UIDs to filter results. |
Return Fields
| Field | Type | Description |
|---|---|---|
chain_uid | String | The chain UID for the returned balances. |
balances | [Object] | List of token balances for the chain. |
amount | String | The amount of the token in the user's balance. |
token_id | String | The identifier of the token. |