Skip to content

behroozA428/forc-wallet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forc-wallet

A forc plugin for managing Fuel wallets.

Quickstart

Installation through fuelup (recommended)

forc-wallet is packaged alongside the default distributed toolchains when installed using fuelup. If you have the latest toolchain installed, you should already have forc-wallet available:

$ fuelup toolchain install latest
$ forc-wallet --version
forc-wallet 0.1.3

For usage in custom toolchains:

fuelup component add forc-wallet

Installation through cargo

Otherwise, you may use cargo:

cargo install forc-wallet

Initialize

Before creating accounts and signing transactions with them you need to initialize a new HD wallet. To do so:

forc-wallet init

This will require a password for encyrpting the wallet. After the initialization is done you will be given the mnemonic phrase of the wallet.

You can also initialize a wallet with your existing mnemonic phrase by using forc-wallet import.

Note: forc-wallet adheres to the Web3 Secret Storage Definition and accepts paths to wallet files that adhere to this standard.

Create an account

To create an account for the initialized wallet, you can run:

forc-wallet new

This will require your wallet password (the one that you choosed in the initialization step). This will always derive the next account.

Sign a transaction

To sign a transaction, you need to have the transaction ID. You can generate a transaction and get its ID using forc-client. Signing the transaction once you have the ID is simple:

forc-wallet sign --id <transaction_id> --account-index <account_index>

Other useful commands

List accounts

To list all accounts derived so far:

forc-wallet list

Get address of an account

To retrieve the address of a specific account, you can use:

forc-wallet account --index <account_index>

Get private key of an account

To retrieve the private key of a specific account, you can use:

forc-wallet export --account-index <account_index>

Initialize from existing mnemonic phrase

To initialize a new HD wallet from an existing mnemonic phrase:

forc-wallet import

About

A forc plugin for managing Fuel wallets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%