Skip to content

Import Account to Cli Wallet

prc edited this page Apr 2, 2024 · 2 revisions

As developers we like to control our accounts through the command line. This small tutorial will help you import your light/web wallet created account into the wallet.

Everything is done with your private key, it is extremely important that you keep this key safe or as you will see anybody will be able to claim your funds.

Start the cli wallet pointing it to a live node:

# ./programs/wallet/wallet --server-rpc-endpoint ws://localhost:8090

Set a password for your wallet, please note this password does not need to be the same as the one you have for your light/web wallet, this is a local wallet and it will be secured by a new password, then we import the accounts into the new created wallet.

new >>> set_password mypass
set_password mypass
null
locked >>> unlock mypass
unlock mypass
null
unlocked >>> 

To import the private key use the following command:

import_key "myusr" privatekeygoeshere

And you are done, and the ballance is already there.

Use list_my_accounts to see your imported account.

And to check balance:

unlocked >>> list_account_balances myusr
list_account_balances myusr
0 IND
0 USD

unlocked >>> 

You now control your wallet account from your wallet.