Skip to main content

getBalance

PlatformAPI

POST /v1/getBalance

GetBalance returns the details of a asset balance.
Body
networkType NetworkType
network_type is the type of the network.
chainIdint64
walletAddressstring
wallet_address this is the wallet address.
tokenAddressstring
token_address this is the token address,if not set, it will return the balance of the native token.
Example:
{
networkType: 1
chainId:
walletAddress: 8HrKVJeFNGSJ2T2wSU6MxfMvua2MYgwH1FbRsdfrgthj
tokenAddress: 0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F
}
Response
balancestring
The balance is in the smallest denomination.
errorError
The error is null when success.
Example:
{
balance: 0.12128
error:
}

enum_types

enum mpcvault.platform.v1.NetworkType

0
NETWORK_TYPE_UNKNOWN
1
NETWORK_TYPE_EVM
2
NETWORK_TYPE_BITCOIN
3
NETWORK_TYPE_TRON
4
NETWORK_TYPE_APTOS
5
NETWORK_TYPE_SUI
6
NETWORK_TYPE_SOLANA
7
NETWORK_TYPE_TON