getBalance Query your balances on Akashic
Example
TypeScript PHP Java C#
Copy const balances = await akashicPay .getBalance ();
Copy $balances = akashicPay -> getBalance () ;
Copy APBalanceResult balances = akashicPay . getBalance (l2Address);
Copy var balance = await akashicPay . GetBalanceAsync ();
Return Example
Returns an array of objects, one for each native currency and one for each token with a non-zero balance. In the example below the caller has no USDT balance of ETH, hence there is no object for that instance.
Note: An object is always returned for native currencies . Tokens are only shown if you posses a non-zero amount.
TypeScript PHP Java C#
Copy [
{
"coinSymbol" : NetworkSymbol .Ethereum_Sepolia ,
"balance" : "5.000000000000000000"
} ,
{
"coinSymbol" : NetworkSymbol .Tron_Shasta ,
"balance" : "34.000000"
} ,
{
"coinSymbol" : NetworkSymbol .Tron_Shasta ,
"tokenSymbol" : TokenSymbol . USDT ,
"balance" : "100.500000"
} ,
]
Copy [
{
"coinSymbol" : NetworkSymbol :: ETHEREUM_SEPOLIA ,
"balance" : "5.000000000000000000"
} ,
{
"coinSymbol" : NetworkSymbol :: TRON_SHASTA ,
"balance" : "34.000000"
} ,
{
"coinSymbol" : NetworkSymbol :: TRON_SHASTA ,
"tokenSymbol" : TokenSymbol :: USDT ,
"balance" : "100.500000"
} ,
]
Copy [
{
"coinSymbol" : APNetworkSymbol . SEP ,
"balance" : "5.000000000000000000"
} ,
{
"coinSymbol" : APNetworkSymbol . TRX_SHASTA ,
"balance" : "34.000000"
} ,
{
"coinSymbol" : APNetworkSymbol . TRX_SHASTA ,
"tokenSymbol" : APTokenSymbol . USDT ,
"balance" : "100.500000"
} ,
]
Copy
"Balances" : [
{
" NetworkSymbol ": EthSepNetworkSymbol ,
" TokenSymbol ": ApTokenSymbol . Native ,
" Balance ": "0.00123123"
} ,
{
" NetworkSymbol ": EthSepNetworkSymbol ,
" TokenSymbol ": ApTokenSymbol . Usdt ,
" Balance ": "150.52"
} ,
{
" NetworkSymbol ": TronShastaNetworkSymbol ,
" TokenSymbol ": ApTokenSymbol . Native ,
" Balance ": "1200.4"
} ,
{
" NetworkSymbol ": TronShastaNetworkSymbol ,
" TokenSymbol ": ApTokenSymbol . Usdt ,
" Balance ": "353.56"
}
]
}
Last updated 2 months ago