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