@fuel-ts/account v0.94.2 • Docs
Wallet
provides methods to create locked and unlocked wallet instances.
new Wallet():
Wallet
static
fromEncryptedJson: (jsonWallet
,password
,provider
?) =>Promise
<WalletUnlocked
> =WalletUnlocked.fromEncryptedJson
Create a Wallet Unlocked from an encrypted JSON.
Create a Wallet Unlocked from an encrypted JSON.
• jsonWallet: string
The encrypted JSON keystore.
• password: string
The password to decrypt the JSON.
• provider?: Provider
A Provider instance (optional).
Promise
<WalletUnlocked
>
An unlocked wallet instance.
The encrypted JSON keystore.
The password to decrypt the JSON.
A Provider instance (optional).
packages/account/src/wallet/wallet.ts:79
static
fromExtendedKey: (extendedKey
,provider
?) =>WalletUnlocked
=WalletUnlocked.fromExtendedKey
Create a Wallet Unlocked from an extended key.
Create a Wallet Unlocked from an extended key.
• extendedKey: string
The extended key.
• provider?: Provider
A Provider instance (optional).
An instance of WalletUnlocked.
The extended key.
A Provider instance (optional).
packages/account/src/wallet/wallet.ts:69
static
fromMnemonic: (mnemonic
,path
?,passphrase
?,provider
?) =>WalletUnlocked
=WalletUnlocked.fromMnemonic
Create a Wallet Unlocked from a mnemonic phrase.
Create a Wallet Unlocked from a mnemonic phrase.
• mnemonic: string
The mnemonic phrase.
• path?: string
The derivation path (optional).
• passphrase?: BytesLike
The passphrase for the mnemonic (optional).
• provider?: Provider
A Provider instance (optional).
An instance of WalletUnlocked.
The mnemonic phrase.
A Provider instance (optional).
The derivation path (optional).
The passphrase for the mnemonic (optional).
packages/account/src/wallet/wallet.ts:60
static
fromSeed: (seed
,path
?,provider
?) =>WalletUnlocked
=WalletUnlocked.fromSeed
Create a Wallet Unlocked from a seed.
Create a Wallet Unlocked from a seed.
• seed: string
The seed phrase.
• path?: string
The derivation path (optional).
• provider?: Provider
A Provider instance (optional).
An instance of WalletUnlocked.
The seed phrase.
A Provider instance (optional).
The derivation path (optional).
packages/account/src/wallet/wallet.ts:49
static
generate: (generateOptions
?) =>WalletUnlocked
=WalletUnlocked.generate
Generate a new Wallet Unlocked with a random key pair.
Generate a new Wallet Unlocked with a random key pair.
• generateOptions?: GenerateOptions
Options to customize the generation process (optional).
An instance of WalletUnlocked.
Options to customize the generation process (optional).
packages/account/src/wallet/wallet.ts:39
static
fromAddress(address
,provider
?):WalletLocked
Creates a locked wallet instance from an address and a provider.
• address: string
| AbstractAddress
The address of the wallet.
• provider?: Provider
A Provider instance (optional).
A locked wallet instance.
packages/account/src/wallet/wallet.ts:18
static
fromPrivateKey(privateKey
,provider
?):WalletUnlocked
Creates an unlocked wallet instance from a private key and a provider.
• privateKey: BytesLike
The private key of the wallet.
• provider?: Provider
A Provider instance (optional).
An unlocked wallet instance.