Vault

The GraphQL queries that can be performed on the Vault ADO.

queryBalance

Queries a vault contract for the balance of the specified address.

export async function queryBalance(
  contractAddress: string,
  address: string
): Promise<Coin[]> {
  const resp = await query<QueryVaultBalance, QueryVaultBalanceResponse>(
    QUERY_VAULT_BALANCE,
    { contractAddress, address }
  );

  return resp.balance;
}
NameTypeDescription

contactAddress

string

The contract address of the vault contract to query.

address

string

The address to check the balance for.

QueryVaultBalance

export interface QueryVaultBalance extends ContractAddressQuery {
  address: string;
}

QueryVaultBalanceResponse

export interface QueryVaultBalanceResponse {
  balance: Coin[];
}
NameTypeDescription

balance

The balance of the address that has been specified.

Last updated