Importing Accounts
You can export your private key from wallet (Argent) and import it into the file holding the accounts info (~/.starknet_accounts/starknet_open_zeppelin_accounts.json
by default).
⚠️ Warning
Never share your private key! Anyone with access to your private key can access your account and funds. You are doing this at your own risk.
Exporting Your Private Key
This section shows how to export your private key from specific wallets.
Examples
Argent
-
Open the Argent app > Settings.
-
Click on the current account.
-
Click on "Export private key".
-
Enter your password.
-
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 \
--network sepolia \
--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 \
--network sepolia \
--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 \
--network sepolia \
--name account_argent \
--address 0x1 \
--private-key 0x2 \
--type argent
⚠️ Warning Importing braavos accounts is currently disabled.
OpenZeppelin
To import OpenZeppelin account, set the --type
flag to oz
or open_zeppelin
.
$ sncast \
account import \
--network sepolia \
--name account_oz \
--address 0x1 \
--private-key 0x2 \
--type oz