The bank module is responsible for handling multi-asset coin transfers between accounts.

Example

To use Bank methods, initialise a ChainGrpcBankApi object to with a gRPC endpoint. An endpoint can be retrieved by using networkEndpoints.

const endpoint =  getEndpointsForNetwork(Network.Devnet).grpcEndpoint;
const bankClient = new ChainGrpcBankApi(endpoint);
const response = await bankClient.fetchBalances("router12avkt8c0lk76atge8f3pe2t6fj4jsc8038d742");

Hierarchy

  • default
    • ChainGrpcBankApi

Methods

  • Get balance of a coin.

    Returns

    balance.

    Parameters

    • __namedParameters: {
          accountAddress: string;
          denom: string;
      }
      • accountAddress: string
      • denom: string

    Returns Promise<Coin>

  • Get balance of all coins

    Returns

    list of balances.

    Parameters

    • address: string

      account address.

    Returns Promise<{
        balances: Coin[];
        pagination: Pagination;
    }>

  • Get total supply of coins.

    Returns

    total supply.

    Parameters

    • Optional pagination: PaginationOption

      pagination options (optional param).

    Returns Promise<{
        pagination: Pagination;
        supply: TotalSupply;
    }>

Generated using TypeDoc