cosmpy.bank package — cosmpy documentation

# cosmpy.bank package

## Submodules

## cosmpy.bank.interface module

Interface for the Bank functionality of CosmosSDK.

class cosmpy.bank.interface.Bank

  Bases: `abc.ABC`

  Bank abstract class.

  abstract AllBalances(request: cosmos.bank.v1beta1.query_pb2.QueryAllBalancesRequest) → cosmos.bank.v1beta1.query_pb2.QueryAllBalancesResponse

    Queries balance of all denominations from specific account

    Parameters

      request – QueryAllBalancesRequest with account address

    Returns

      QueryAllBalancesResponse

  abstract Balance(request: cosmos.bank.v1beta1.query_pb2.QueryBalanceRequest) → cosmos.bank.v1beta1.query_pb2.QueryBalanceResponse

    Queries balance of selected denomination from specific account

    Parameters

      request – QueryBalanceRequest with address and denomination

    Returns

      QueryBalanceResponse

  abstract DenomMetadata(request: cosmos.bank.v1beta1.query_pb2.QueryDenomMetadataRequest) → cosmos.bank.v1beta1.query_pb2.QueryDenomMetadataResponse

    Queries the client metadata for all registered coin denominations

    Parameters

      request – QueryDenomMetadataRequest with denomination

    Returns

      QueryDenomMetadataResponse

  abstract DenomsMetadata(request: cosmos.bank.v1beta1.query_pb2.QueryDenomsMetadataRequest) → cosmos.bank.v1beta1.query_pb2.QueryDenomsMetadataResponse

    Queries the client metadata of a given coin denomination

    Parameters

      request – QueryDenomsMetadataRequest

    Returns

      QueryDenomsMetadataResponse

  abstract Params(request: cosmos.bank.v1beta1.query_pb2.QueryParamsRequest) → cosmos.bank.v1beta1.query_pb2.QueryParamsResponse

    Queries the parameters of bank module

    Parameters

      request – QueryParamsRequest

    Returns

      QueryParamsResponse

  abstract SupplyOf(request: cosmos.bank.v1beta1.query_pb2.QuerySupplyOfRequest) → cosmos.bank.v1beta1.query_pb2.QuerySupplyOfResponse

    Queries total supply of specific denomination

    Parameters

      request – QuerySupplyOfRequest with denomination

    Returns

      QuerySupplyOfResponse

  abstract TotalSupply(request: cosmos.bank.v1beta1.query_pb2.QueryTotalSupplyRequest) → cosmos.bank.v1beta1.query_pb2.QueryTotalSupplyResponse

    Queries total supply of all denominations

    Parameters

      request – QueryTotalSupplyRequest

    Returns

      QueryTotalSupplyResponse

## cosmpy.bank.rest_client module

Implementation of Bank interface using REST.

class cosmpy.bank.rest_client.BankRestClient(rest_api: cosmpy.common.rest_client.RestClient)

  Bases: `cosmpy.bank.interface.Bank`

  Bank REST client.

  API_URL = '/cosmos/bank/v1beta1'
  AllBalances(request: cosmos.bank.v1beta1.query_pb2.QueryAllBalancesRequest) → cosmos.bank.v1beta1.query_pb2.QueryAllBalancesResponse

    Queries balance of all denominations from specific account

    Parameters

      request – QueryAllBalancesRequest with account address

    Returns

      QueryAllBalancesResponse

  Balance(request: cosmos.bank.v1beta1.query_pb2.QueryBalanceRequest) → cosmos.bank.v1beta1.query_pb2.QueryBalanceResponse

    Queries balance of selected denomination from specific account

    Parameters

      request – QueryBalanceRequest with address and denomination

    Returns

      QueryBalanceResponse

  DenomMetadata(request: cosmos.bank.v1beta1.query_pb2.QueryDenomMetadataRequest) → cosmos.bank.v1beta1.query_pb2.QueryDenomMetadataResponse

    Queries the client metadata for all registered coin denominations

    Parameters

      request – QueryDenomMetadataRequest with denomination

    Returns

      QueryDenomMetadataResponse

  DenomsMetadata(request: cosmos.bank.v1beta1.query_pb2.QueryDenomsMetadataRequest) → cosmos.bank.v1beta1.query_pb2.QueryDenomsMetadataResponse

    Queries the client metadata of a given coin denomination

    Parameters

      request – QueryDenomsMetadataRequest

    Returns

      QueryDenomsMetadataResponse

  Params(request: cosmos.bank.v1beta1.query_pb2.QueryParamsRequest) → cosmos.bank.v1beta1.query_pb2.QueryParamsResponse

    Queries the parameters of bank module

    Parameters

      request – QueryParamsRequest

    Returns

      QueryParamsResponse

  SupplyOf(request: cosmos.bank.v1beta1.query_pb2.QuerySupplyOfRequest) → cosmos.bank.v1beta1.query_pb2.QuerySupplyOfResponse

    Queries total supply of specific denomination

    Parameters

      request – QuerySupplyOfRequest with denomination

    Returns

      QuerySupplyOfResponse

  TotalSupply(request: cosmos.bank.v1beta1.query_pb2.QueryTotalSupplyRequest) → cosmos.bank.v1beta1.query_pb2.QueryTotalSupplyResponse

    Queries total supply of all denominations

    Parameters

      request – QueryTotalSupplyRequest

    Returns

      QueryTotalSupplyResponse

## Module contents

This package contains the Bank modules.