To find the balance of a Solana subaccount: obtain its public key; use SolanaExplorer, SolanaCLI, or development tools to query the balance.
How to find the Solana sub-account balance
Step 1: Obtain the sub-account public key
To find the balance of a subaccount, you need to know its public key. You can obtain the sub-account public key through the following methods:
spl-token
The library is derived from the parent account addressStep 2: Query the account balance
Using the child Account public key, you can check its balance through the following method:
Use Solana Explorer:
Using Solana CLI:
solana --url https://api.devnet.solana.com/ get-token-accounts publicKeyOfSubaccount
Where"publicKeyOfSubaccount"
is the public key of the sub-account.
Use development tools:
web3.js
or anchor
Development tools like this connect to the Solana networkgetBalance()
method to query the balanceNote:
The above is the detailed content of How to find sub-account balance in solana. For more information, please follow other related articles on the PHP Chinese website!