Skip to main content

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"}}'

Open in Playground

ArgumentTypeDescription
chainUidString!The unique ID for the chain that the CW20 is deployed on.
contractString!The contract address of the CW20 contract. Can be fetched using the Factory GetLPTokenAddress
addressString!The user address to query the balance for.

Return Fields

FieldTypeDescription
balanceStringThe number of LP tokens held by the user.