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