I have created a Solana account with Phantom App. How can I access my Phantom account details and balance via through Solana CLI? Please list down all the libraries also required for it.
1 Answer
First, you’ll need to install the Solana CLI.
Generate a File System Wallet. From the command line, run:
$ solana-keygen recover 'prompt:?key=0/0' --outfile ~/.config/solana/id.json
This will prompt for your Secret Recovery Phrase (which you can access through the Phantom Wallet’s settings). Enter it and when prompted to continue enter “y” to generate the local keypair file:
[recover] seed phrase:
[recover] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
Recovered pubkey `abc123`. Continue? (y/n): y
Wrote recovered keypair to /Users/matt/.config/solana/id.json
If all went well you should be able to run a command like solana balance to access the account balance:
$ solana balance
0.123456789 SOL
You can also verify that the public key is correctly associated with your local private key:
$ solana-keygen verify abc123
Verification for public key: abc123: Success
For more reference check https://mattmazur.com/2021/11/18/using-a-phantom-wallet-address-with-the-solana-cli/