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