Skip to content

Get Account

The Get Account function retrieves an account using its unique wallet address, returning detailed account information encapsulated in the BaseAccount structure.

This is essential for obtaining ownership details and balances associated with the account address provided.

Method Declaration

Python
async def get_account(self, address: str) -> BaseAccount
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the subaccount.

Response

StatusMeaningSchema
200OKBaseAccount

Examples: Python | TypeScript | Rust

Get Account Balance

The Get Account Balance query retrieves the balance of a specified account address for a particular denomination.

This function is crucial for obtaining the current funds available in a wallet within blockchain network.

Method Declaration

Python
async def get_account_balance(
    self,
    address: str,
    denom: str,
) -> bank_query.QueryBalanceResponse

Parameters

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the subaccount.
denomqueryDenomtrueThe denomination of the balance.

Response

StatusMeaningSchema
200OKCoin

Examples: Python | Rust

Get Account Balances

The Get Account Balances method retrieves the balance for a specific wallet address across all currency denominations within the account.

It provides the balance details encapsulated in a response structure, typically including the coin type and respective amounts.

Method Declaration

Python
async def get_account_balances(
        self,
        address: str,
) -> bank_query.QueryAllBalancesResponse

Parameters

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the subaccount.

Response

StatusMeaningSchemaDescription
200OKCoinThe response containing all account balances.

Examples: Python | TypeScript | Rust

Get Subaccount

The Get Subaccount method fetches details of a specific subaccount based on its owner's address and the subaccount's unique number.

It returns information about the subaccount, including its configuration and current status.

Method Declaration

Python
async def get_subaccount(
    self,
    address: str,
    account_number: int,
) -> Optional[subaccount_type.Subaccount]
Unification Plan
  • Rust uses Subaccount - a wrapper that combines Address with SubaccountNumber, it's safer to create the same type for Python and TypeScript

Parameters

ParameterLocationTypeRequiredDescription
ownerqueryAddresstrueThe wallet address that owns the subaccount.
numberquerySubaccountNumbertrueThe identifier for the specific subaccount withing the wallet address.

Response

StatusMeaningSchema
200OKSubaccountInfo

Examples: Python | TypeScript | Rust

Get Subaccounts

The Get Subaccounts function retrieves a comprehensive list of all subaccounts associated with an account, returning structured information encapsulated in a response object.

This aids in managing and viewing details of subaccounts under a main account efficiently.

Method Declaration

Python
async def get_subaccounts(self) -> QuerySubaccountAllResponse

Parameters

Response

StatusMeaningSchema
200OKSubaccountInfo

Examples: Python | TypeScript | Rust