Step by step examples
In these step by step examples, we present how to create a wallet and do some of the most common use cases.
It is advised to do them all at least once in the given order to understand the workflow.
Setup
Initialize the wallet with a given node and a randomly generated mnemonic.
./wallet init --node <NODE_API_URL>
> INFO Mnemonic stored successfully
Create a main account.
./wallet new main
> INFO Created account "main"
Exit from the "main" account.
> Account "main": exit
Note: exiting from an account is omitted from now on for the rest of this guide.
Create a savings account.
./wallet new savings
> INFO Created account "savings"
Tokens
Enter the "main" account and get some funds from the faucet.
./wallet main
> Account "main": faucet <FAUCET_ENQUEUE_API_URL>
> Account "main": sync
> INFO Synced: Balance ...
Send an amount
Enter the "savings" account and get an address.
./wallet savings
> Account "savings": addresses
> INFO Address 0: <rms123abc...>
Enter the "main" account and send some amount to the "savings" address.
./wallet main
> Account "main": send <rms123abc...> 1000000
> INFO Transaction sent:
> transaction id: 0x...
> Some(BlockId(0x...))
Enter the "savings" account and check the balance.
./wallet savings
> Account "savings": balance
> INFO Balance ...
Native tokens
Mint
Enter the "main" account and mint native tokens with foundry metadata.
./wallet main
> Account "main": mint-native-token 1000 1000 --foundry-metadata-hex <0xabcdef...>
> INFO Native token minting transaction sent:
> transaction id: 0x...
> Some(BlockId(0x...))
Send
Enter the "savings" account and generate a new address.
./wallet savings
> Account "savings": new-address
> INFO Address 2: <rms456def...>
Enter the "main" account and synchronize the account balances.
./wallet main
> Account "main": sync
> INFO Synced: Balance ...TokenId([TOKEN_ID])...
Send native tokens from the "main" account to the new "savings" address.
> Account "main": send-native-token <rms456def...> <TOKEN_ID> 100
> INFO Native token transaction sent:
> transaction id: 0x...
> Some(BlockId(0x...))
NFTs
Mint
Enter the "main" account and mint an NFT.
./wallet main
> Account "main": mint-nft
> INFO NFT minting transaction sent:
> transaction id: 0x...
> Some(BlockId(0x...))
Send
Enter the "savings" account and generate a new address.
./wallet savings
> Account "savings": new-address
> INFO Address 3: <rms789ghi...>
Enter the "main" account and synchronize the account balances.
./wallet main
> Account "main": sync
> INFO Synced: Balance ...NftId([NFT_ID])...
Send the NFT to the new "savings" address.
> Account "main": send-nft <rms789ghi...> <NFT_ID>
> INFO Nft transaction sent:
> transaction id: 0x...
> Some(BlockId(0x...))
Transactions
Enter the "main" account and list all transactions.
./wallet main
> Account "main": transactions
> INFO Transaction...