Wallet provides methods to create locked and unlocked wallet instances.

Constructors

Properties

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>
    • Create a Wallet Unlocked from an encrypted JSON.

      Parameters

      • jsonWallet: string

        The encrypted JSON keystore.

      • password: string

        The password to decrypt the JSON.

      • Optionalprovider: Provider

        A Provider instance (optional).

      Returns Promise<WalletUnlocked>

      An unlocked wallet instance.

The encrypted JSON keystore.

The password to decrypt the JSON.

A Provider instance (optional).

An unlocked wallet instance.

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

Create a Wallet Unlocked from an extended key.

Type declaration

    • (extendedKey, provider?): WalletUnlocked
    • Create a Wallet Unlocked from an extended key.

      Parameters

      • extendedKey: string

        The extended key.

      • Optionalprovider: Provider

        A Provider instance (optional).

      Returns WalletUnlocked

      An instance of WalletUnlocked.

The extended key.

A Provider instance (optional).

An unlocked wallet instance.

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
    • Create a Wallet Unlocked from a mnemonic phrase.

      Parameters

      • mnemonic: string

        The mnemonic phrase.

      • Optionalpath: string

        The derivation path (optional).

      • Optionalpassphrase: BytesLike

        The passphrase for the mnemonic (optional).

      • Optionalprovider: Provider

        A Provider instance (optional).

      Returns WalletUnlocked

      An instance of WalletUnlocked.

The mnemonic phrase.

A Provider instance (optional).

The derivation path (optional).

The passphrase for the mnemonic (optional).

An unlocked wallet instance.

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

Create a Wallet Unlocked from a seed.

Type declaration

    • (seed, path?, provider?): WalletUnlocked
    • Create a Wallet Unlocked from a seed.

      Parameters

      • seed: string

        The seed phrase.

      • Optionalpath: string

        The derivation path (optional).

      • Optionalprovider: Provider

        A Provider instance (optional).

      Returns WalletUnlocked

      An instance of WalletUnlocked.

The seed phrase.

A Provider instance (optional).

The derivation path (optional).

An unlocked wallet instance.

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

Generate a new Wallet Unlocked with a random key pair.

Type declaration

    • (generateOptions?): WalletUnlocked
    • Generate a new Wallet Unlocked with a random key pair.

      Parameters

      • OptionalgenerateOptions: GenerateOptions

        Options to customize the generation process (optional).

      Returns WalletUnlocked

      An instance of WalletUnlocked.

Options to customize the generation process (optional).

An unlocked wallet instance.

Methods

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

    Parameters

    • address: string | Address

      The address of the wallet.

    • Optionalprovider: Provider

      A Provider instance (optional).

    Returns WalletLocked

    A locked wallet instance.

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

    Parameters

    • privateKey: BytesLike

      The private key of the wallet.

    • Optionalprovider: Provider

      A Provider instance (optional).

    Returns WalletUnlocked

    An unlocked wallet instance.