search
Homeweb3.0How to find sub-account balance in solana

How to find sub-account balance in solana

Apr 30, 2024 pm 02:56 PM
solana

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 sub-account balance in solana

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:

  • Request directly from the sub-account owner
  • Generate using a wallet that supports derived accounts (such as Phantom or Slope wallet)
  • Usingspl-token The library is derived from the parent account address

Step 2: Query the account balance

Using the child Account public key, you can check its balance through the following method:

  • Use Solana Explorer:

    • Go to Solana Explorer (https: //explorer.solana.com/)
    • Enter the subaccount public key in the search bar
    • View the "Tokens" tab to find the token balance
  • Using Solana CLI:

    • Open a terminal or command prompt
    • Enter the following command:
    solana --url https://api.devnet.solana.com/ get-token-accounts publicKeyOfSubaccount

    Where"publicKeyOfSubaccount" is the public key of the sub-account.

  • Use development tools:

    • Use tools such as web3.js or anchor Development tools like this connect to the Solana network
    • Get the sub-account account object and use the getBalance() method to query the balance

Note:

  • Subaccount balances are stored in a different account than the parent account.
  • You can only query the balance of sub-accounts holding SPL tokens (such as SOL, SRM, RAY).
  • A small transaction fee is required to retrieve the sub-account balance.

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Tokenized Treasuries Near $6B Milestone, Led by BlackRockTokenized Treasuries Near $6B Milestone, Led by BlackRockApr 19, 2025 am 11:44 AM

The value of blockchain-based U.S. Treasuries is closing in on a new milestone, with total holdings approaching $6 billion.

title: Canary Capital Is Launching a TRX-Tracking ETFtitle: Canary Capital Is Launching a TRX-Tracking ETFApr 19, 2025 am 11:42 AM

Canary Capital is looking to launch an exchange-traded fund (ETF) tracking the price of Tron's native token, TRX, according to a filing.

Solana Stablecoin Market Cap Hits Record $12.73 Billion as Sui Supply Reaches $800M with $60M InflowsSolana Stablecoin Market Cap Hits Record $12.73 Billion as Sui Supply Reaches $800M with $60M InflowsApr 19, 2025 am 11:40 AM

The stablecoin market has surpassed a total capitalization of $233 billion. Within this sector, Solana's stablecoins have reached a new all-time high market capitalization of $12.73 billion

Canary Capital Files for Staking TRX ETF, Targeting Launch Before Spot Bitcoin ETFsCanary Capital Files for Staking TRX ETF, Targeting Launch Before Spot Bitcoin ETFsApr 19, 2025 am 11:38 AM

Canary Capital is looking to get the U.S. Securities and Exchange Commission's sign-off for an exchange-traded fund that would track the Tron token TRX and has a staking component.

MoonPay CEO Ivan Soto-Wright calls on US lawmakers to leave a path open to state-level regulators when passing legislation on stablecoinsMoonPay CEO Ivan Soto-Wright calls on US lawmakers to leave a path open to state-level regulators when passing legislation on stablecoinsApr 19, 2025 am 11:36 AM

In an April 18 X post, Soto-Wright said he wanted Congress to “keep state-regulated issuers in the game” when it comes to stablecoin regulation, referencing efforts in the House of Representatives and Senate to create a federal regulatory framework.

Michael Saylor Dissects the Philosophy and Technological Potential of Bitcoin in '21 Truths of Bitcoin'Michael Saylor Dissects the Philosophy and Technological Potential of Bitcoin in '21 Truths of Bitcoin'Apr 19, 2025 am 11:34 AM

Saylor's ideas centre on the fixed 21 million coin supply of Bitcoin. He presents this shortage as a revolutionary economic idea rather than only a technical one.

Official Trump (TRUMP) memecoin unlocked 40 million tokens, worth around $300 millionOfficial Trump (TRUMP) memecoin unlocked 40 million tokens, worth around $300 millionApr 19, 2025 am 11:32 AM

The TRUMP memecoin has gained significant popularity on the Solana network primarily due to its direct affiliation with the U.S. President Donald Trump.

TRUMP (TRUMP) memecoin unlocks 40 million tokens, worth around $300 millionTRUMP (TRUMP) memecoin unlocks 40 million tokens, worth around $300 millionApr 19, 2025 am 11:30 AM

The TRUMP memecoin has gained significant popularity on the Solana network primarily due to its direct affiliation with the U.S. President Donald Trump.

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)