Skip to main content

Account

getAccount Query

Retrieve on-chain account information for a given address.

paramsdescription
addressThe given address for retrieving
example
await client.getAccount('0x0000000000000000000000000000000000000001');

getAccountBalance Query

Get the bank balance for the given address.

paramsdescription
addressthe address to query balances for
denomthe coin denom to query balances for
example
await client.getAccountBalance({
address: '0x0000000000000000000000000000000000000001',
denom: 'BNB',
});

getModuleAccounts Query

Get all module accounts.

example
await client.getModuleAccounts();

getModuleAccountByName Query

Get module account by module name.

paramsdescription
namethe address to query balances for
example
await client.getModuleAccountByName('module_name');

getPaymentAccountsByOwner Query

Get all payment accounts owned by the given owner address.

paramsdescription
addressThe given owner account address for retrieving
example
await client.getPaymentAccountsByOwner('0x0000000000000000000000000000000000000001');

createPaymentAccount Tx

tip

This is only construct tx, next need simulate and broadcast

Create a new payment account for the given address.

The payment account is used to pay for the storage and read quota fee of objects. When you need to pay for different buckets separately, you can create different payment accounts to do so. Note that the payment account does not have a private key, and only the owner of the payment account can withdraw funds from it. Once the owner revokes permission for withdrawal, the funds in the payment account can only be utilized to cover storage and read quota fees.

paramsdescription
creatorThe owner address of the new payment account
example
const tx = await client.account.createPaymentAccount({
creator: address,
});

transfer Tx

tip

This is only construct tx, next need simulate and broadcast

Transfer BNB from sender to receiver.

paramsdescription
fromAddressThe address who will send the BNB
toAddressThe address who will receive the BNB
amounttransfer coin
example
const tx = await client.account.transfer({
fromAddress: '0x0000000000000000000000000000000000000000',
toAddress: '0x0000000000000000000000000000000000000001',
amount: [
{
denom: 'BNB',
amount: '1000000000',
},
],
});