Skip to main content

Wallet Interface

The Wallet Interface is evaluated through the Command Line Interface of the wallet binary, once per execution.

It is responsible for the creation and management of the wallet and its accounts.

You can run ./wallet --help to print all available CLI commands, arguments, and options. The available options are listed in the table below:

NameDescriptionDefaultEnvironment VariableExample
--wallet-db-pathSets the path to the wallet database./stardust-cli-wallet-dbWALLET_DATABASE_PATH/path/to/wallet-db
--stronghold-snapshot-pathSets the path to the Stronghold snapshot file./stardust-cli-wallet.strongholdSTRONGHOLD_SNAPSHOT_PATH/path/to/stronghold-snapshot
--log-level (-l)Sets the log verbosity level (error, warn, info, debug, trace)debugtrace
--help (-h)Shows all available commands, arguments and options
--version (-V)Shows the current version

Usage Examples

./wallet

Starts the wallet without a specified account:

  • If the wallet has only one account, it will be used;
  • If the wallet has more than one account, a selector will be shown to decide which account to use.

The wallet needs to be initialised (init command) and with at least one account (new command).

Example

./wallet

./wallet [account]

Starts the wallet with a specified account;

The wallet needs to be initialised (init command).

Example

./wallet main

./wallet backup

Creates a stronghold backup file.

Parameters

NameOptionalExample
pathbackup.stronghold

Example

Create a stronghold backup file.

./wallet backup backup.stronghold

./wallet change-password

Changes the stronghold password.

Example

Change the stronghold password.

./wallet change-password

./wallet init

Initialises the wallet by creating a stronghold file from a provided or generated mnemonic.

The wallet can only be initialised once.

When just initialised, the wallet has no account yet, use the new command to create one.

Options

NameDescriptionDefaultEnvironment VariableExample
--mnemonic (-m)Initialises a wallet from an existing mnemonic"aunt middle impose ..."
--node-url (-n)Sets the node to connect tohttps://api.testnet.shimmer.networkNODE_URLhttp://localhost:14265
--coin-type (-c)Sets the coin type associated with the wallet4219 (=Shimmer)4218(=IOTA)

Examples

Initialize the wallet with a randomly generated mnemonic and the default node.

./wallet init

Initialize the wallet with a given mnemonic and the default node. DO NOT USE THIS MNEMONIC.

./wallet init --mnemonic "aunt middle impose faith ramp kid olive good practice motor grab ready group episode oven matrix silver rhythm avocado assume humble tiger shiver hurt"

Initialize the wallet with a randomly generated mnemonic and a given node.

./wallet init --node http://localhost:14265

Initialize the wallet with a given coin type. See SLIP-0044 for all registered coin types.

./wallet init --coin-type 4219

./wallet migrate-stronghold-snapshot-v2-to-v3

Migrates a stronghold snapshot from v2 to v3.

Parameters

NameOptionalDefaultExample
path"./stardust-cli-wallet.stronghold"backup.stronghold

Example

Migrate a stronghold snapshot from v2 to v3 with the default path: "./stardust-cli-wallet.stronghold".

./wallet migrate-stronghold-snapshot-v2-to-v3

Migrate a stronghold snapshot from v2 to v3 with a custom path.

./wallet migrate-stronghold-snapshot-v2-to-v3 some-other-path.stronghold

./wallet mnemonic

Generates a new random mnemonic.

Example

Generate a new random mnemonic.

./wallet mnemonic

./wallet new

Creates a new account.

The wallet needs to be initialised (init command).

Parameters

NameOptionalDefaultExample
aliasAccount indexmain

Examples

Create a new account with the account index as alias.

./wallet new

Create a new account with a provided alias.

./wallet new main

./wallet restore

Restores accounts from a stronghold backup file.

Parameters

NameOptionalExample
pathbackup.stronghold

Example

Restore accounts from a stronghold backup file.

./wallet restore backup.stronghold

./wallet set-node-url

Sets the node to be used for all requests.

The new node URL is persisted to the storage and all future requests will use it.

Parameters

NameOptionalExample
urlhttp://localhost:14265

Example

./wallet set-node-url http://localhost:14265

./wallet sync

Synchronises all accounts.

Example

./wallet sync