Balance
Queries the amount of CW20 tokens (LP tokens) held by the specified user for the specified address and chain.
query Cw($contract: String!, $chainUid: String!, $address: String!) {
cw(contract: $contract, chain_uid: $chainUid) {
balance(address: $address) {
balance
}
}
}
Example
curl --request POST \
--header 'content-type: application/json' \
--url 'https://testnet.api.euclidprotocol.com/graphql' \
--data '{"query":"query Cw($contract: String!, $chainUid: String!, $address: String!) {\n cw(contract: $contract, chain_uid: $chainUid) {\n balance(address: $address) {\n balance\n }\n }\n}","variables":{"chainUid":"injective","contract":"inj16kxz36d9r9l3lsh9c6lkl50ta8fcamkgasht9q","address":"inj1y2n2fysm3r9t09kw9gmgfnpu746g8yu0pl24en"}}'
| Argument | Type | Description |
|---|---|---|
chainUid | String! | The unique ID for the chain that the CW20 is deployed on. |
contract | String! | The contract address of the CW20 contract. Can be fetched using the Factory GetLPTokenAddress |
address | String! | The user address to query the balance for. |
Return Fields
| Field | Type | Description |
|---|---|---|
balance | String | The number of LP tokens held by the user. |