CW20

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

Response Interface

export interface CW20Response<T> {
  cw20: T;
}

queryCW20TokenInfo

Query the information of the CW20 ADO.

export async function queryCW20TokenInfo(
  contractAddress: string
): Promise<TokenInfo> {
  const resp = await query<QueryCW20TokenInfo, QueryCW20TokenInfoResponse>(
    QUERY_CW20_TOKEN_INFO,
    { contractAddress }
  );

  return resp.cw20.tokenInfo;
}
NameTypeDescription

contractAddress

string

The contract address of the cw20 to query.

QueryCW20TokenInfo

export interface QueryCW20TokenInfo extends ContractAddressQuery {}

QueryCW20TokenInfoResponse

export type QueryCW20TokenInfoResponse = CW20Response<{
  tokenInfo: TokenInfo;
}>;
NameTypeDescription

tokenInfo

Information on the cw20 token.

TokenInfo

export interface TokenInfo {
  decimals: number;
  name: string;
  symbol: string;
  total_supply: number;
}
NameTypeDescription

decimals

number

The number of decimals for the token.

name

string

The name of the token.

symbol

string

The symbol of the token.

total_supply

number

The total amount of tokens.

Last updated