Importing Accounts

You can export your private key from wallet (Argent, Braavos) and import it into the file holding the accounts info (~/.starknet_accounts/starknet_open_zeppelin_accounts.json by default).

Exporting Your Private Key

This section shows how to export your private key from specific wallets.

Examples

Argent

  1. Open the Argent app > Settings.

  2. Click on the current account.

  3. Click on "Export private key".

  4. Enter your password.

  5. Copy your private key.

Braavos

  1. Open the Braavos app > Wallet settings.

  2. Click on "Privacy & Security".

  3. Click on "Export private key".

  4. Enter your password.

  5. Copy your private key.

Importing an Account

Examples

General Example

To import an account into the file holding the accounts info (~/.starknet_accounts/starknet_open_zeppelin_accounts.json by default), use the account import command.

$ sncast \
    account import \
	--url http://127.0.0.1:5050 \
    --name account_123 \
    --address 0x1 \
    --private-key 0x2 \
    --type oz

📝 Note The --name can be omitted as this is optional. A default name will be generated for the account.

Passing Private Key in an Interactive

If you don't want to pass the private key in the command (because of safety aspect), you can skip --private-key flag. You will be prompted to enter the private key in interactive mode.

$ sncast \
    account import \
	--url http://127.0.0.1:5050 \
    --name account_123 \
    --address 0x1 \
    --type oz
Output:
Type in your private key and press enter: 

Argent

To import Argent account, set the --type flag to argent.

$ sncast \
    account import \
	--url http://127.0.0.1:5050 \
    --name account_argent \
    --address 0x1 \
    --private-key 0x2 \
    --type argent

Braavos

To import Braavos account, set the --type flag to braavos.

$ sncast \
    account import \
	--url http://127.0.0.1:5050 \
    --name account_braavos \
    --address 0x1 \
    --private-key 0x2 \
    --type braavos

OpenZeppelin

To import OpenZeppelin account, set the --type flag to oz or open_zeppelin.

$ sncast \
    account import \
	--url http://127.0.0.1:5050 \
    --name account_oz \
    --address 0x1 \
    --private-key 0x2 \
    --type oz