Skip to main content
Mock implementation of an Ethereum wallet for testing purposes. Simulates wallet behavior in a controlled environment, allowing for consistent and reproducible tests without relying on actual blockchain interactions.

Extends

  • EthereumWalletMockAbstract

Constructors

new EthereumWalletMock()

Creates an instance of EthereumWalletMock.

Parameters

Returns

EthereumWalletMock

Overrides

EthereumWalletMockAbstract.constructor

Properties

Methods

addNetwork()

Adds a new network.

Parameters

Returns

Promise<void> A promise that resolves when the network is added.

Overrides

EthereumWalletMockAbstract.addNetwork

addNewAccount()

Adds a new account based on the initially imported seed phrase.

Returns

Promise<void> A promise that resolves when the new account is added.

Overrides

EthereumWalletMockAbstract.addNewAccount

connectToDapp()

Connects wallet to the dapp.

Parameters

Returns

Promise<void> A promise that resolves when the wallet is connected to the dapp.

Overrides

EthereumWalletMockAbstract.connectToDapp

getAccountAddress()

Retrieves the current account address.

Returns

Promise<undefined | `0x${string}`> A promise that resolves to the current account address.

Overrides

EthereumWalletMockAbstract.getAccountAddress

getAllAccounts()

Retrieves all account addresses.

Returns

Promise<undefined | `0x${string}`[]> A promise that resolves to an array of account addresses.

Overrides

EthereumWalletMockAbstract.getAllAccounts

importWallet()

Imports a wallet using the given seed phrase.

Parameters

Returns

Promise<void> A promise that resolves when the wallet is imported.

Overrides

EthereumWalletMockAbstract.importWallet

importWalletFromPrivateKey()

Imports a wallet using the given private key.

Parameters

Returns

Promise<void> A promise that resolves when the wallet is imported.

Overrides

EthereumWalletMockAbstract.importWalletFromPrivateKey

switchAccount()

Switches to the account with the given address.

Parameters

Returns

Promise<void> A promise that resolves when the account switch is complete.

Overrides

EthereumWalletMockAbstract.switchAccount

switchNetwork()

Switches to the network with the given name.

Parameters

Returns

Promise<void> A promise that resolves when the network switch is complete.

Overrides

EthereumWalletMockAbstract.switchNetwork