Icon LinkClass: Wallet

@fuel-ts/account .Wallet

Wallet provides methods to create locked and unlocked wallet instances.

Icon LinkConstructors

Icon Linkconstructor

new Wallet(): Wallet

Icon LinkReturns

Wallet

Icon LinkProperties

Icon LinkfromEncryptedJson

Static fromEncryptedJson: (jsonWallet: string, password: string, provider?: Provider ) => Promise<WalletUnlocked > = WalletUnlocked.fromEncryptedJson

Icon LinkType declaration

▸ (jsonWallet, password, provider?): Promise<WalletUnlocked >

Create a Wallet Unlocked from an encrypted JSON.

Icon LinkParameters

NameTypeDescription
jsonWalletstringThe encrypted JSON keystore.
passwordstringThe password to decrypt the JSON.
provider?Provider A Provider instance (optional).

Icon LinkReturns

Promise<WalletUnlocked >

An unlocked wallet instance.

Icon LinkDefined in

packages/account/src/wallet/wallet.ts:79 Icon Link


Icon LinkfromExtendedKey

Static fromExtendedKey: (extendedKey: string, provider?: Provider ) => WalletUnlocked = WalletUnlocked.fromExtendedKey

Icon LinkType declaration

▸ (extendedKey, provider?): WalletUnlocked

Create a Wallet Unlocked from an extended key.

Icon LinkParameters

NameTypeDescription
extendedKeystringThe extended key.
provider?Provider A Provider instance (optional).

Icon LinkReturns

WalletUnlocked

An unlocked wallet instance.

Icon LinkDefined in

packages/account/src/wallet/wallet.ts:69 Icon Link


Icon LinkfromMnemonic

Static fromMnemonic: (mnemonic: string, path?: string, passphrase?: BytesLike , provider?: Provider ) => WalletUnlocked = WalletUnlocked.fromMnemonic

Icon LinkType declaration

▸ (mnemonic, path?, passphrase?, provider?): WalletUnlocked

Create a Wallet Unlocked from a mnemonic phrase.

Icon LinkParameters

NameTypeDescription
mnemonicstringThe mnemonic phrase.
path?stringThe derivation path (optional).
passphrase?BytesLike The passphrase for the mnemonic (optional).
provider?Provider A Provider instance (optional).

Icon LinkReturns

WalletUnlocked

An unlocked wallet instance.

Icon LinkDefined in

packages/account/src/wallet/wallet.ts:60 Icon Link


Icon LinkfromSeed

Static fromSeed: (seed: string, path?: string, provider?: Provider ) => WalletUnlocked = WalletUnlocked.fromSeed

Icon LinkType declaration

▸ (seed, path?, provider?): WalletUnlocked

Create a Wallet Unlocked from a seed.

Icon LinkParameters

NameTypeDescription
seedstringThe seed phrase.
path?stringThe derivation path (optional).
provider?Provider A Provider instance (optional).

Icon LinkReturns

WalletUnlocked

An unlocked wallet instance.

Icon LinkDefined in

packages/account/src/wallet/wallet.ts:49 Icon Link


Icon Linkgenerate

Static generate: (generateOptions?: GenerateOptions ) => WalletUnlocked = WalletUnlocked.generate

Icon LinkType declaration

▸ (generateOptions?): WalletUnlocked

Generate a new Wallet Unlocked with a random key pair.

Icon LinkParameters

NameTypeDescription
generateOptions?GenerateOptions Options to customize the generation process (optional).

Icon LinkReturns

WalletUnlocked

An unlocked wallet instance.

Icon LinkDefined in

packages/account/src/wallet/wallet.ts:39 Icon Link

Icon LinkMethods

Icon LinkfromAddress

fromAddress(address, provider?): WalletLocked

Creates a locked wallet instance from an address and a provider.

Icon LinkParameters

NameTypeDescription
addressstring | AbstractAddress The address of the wallet.
provider?Provider A Provider instance (optional).

Icon LinkReturns

WalletLocked

A locked wallet instance.

Icon LinkDefined in

packages/account/src/wallet/wallet.ts:18 Icon Link


Icon LinkfromPrivateKey

fromPrivateKey(privateKey, provider?): WalletUnlocked

Creates an unlocked wallet instance from a private key and a provider.

Icon LinkParameters

NameTypeDescription
privateKeyBytesLike The private key of the wallet.
provider?Provider A Provider instance (optional).

Icon LinkReturns

WalletUnlocked

An unlocked wallet instance.

Icon LinkDefined in

packages/account/src/wallet/wallet.ts:29 Icon Link