When interacting with Ethereum, it is necessary to use a private key authenticate actions by signing a payload.
Wallets are the simplest way to expose the concept of an Externally Owner Account (EOA) as it wraps a private key and supports high-level methods to sign common types of interaction and send transactions.
The class most developers will want to use is Wallet, which can load a private key directly or from any common wallet format.
The HDNodeWallet can be used when it is necessary to access low-level details of how an HD wallets are derived, exported or imported.
The BaseWallet is a stream-lined implementation of a Signer that operates with a private key.
It is preferred to use the Wallet class, as it offers additional functionality and simplifies loading a variety of JSON formats, Mnemonic Phrases, etc.
This class may be of use for those attempting to implement a minimal Signer.
The SigningKey used for signing payloads.
A Mnemonic wraps all properties required to compute BIP-39 seeds and convert between phrases and entropy.
The mnemonic phrase of 12, 15, 18, 21 or 24 words.
Use the wordlist split method to get the individual words.
Create a new Mnemonic from the entropy.
The default password is the empty string and the default wordlist is the English wordlists.
Creates a new Mnemonic for the phrase.
The default password is the empty string and the default wordlist is the English wordlists.
Returns true if phrase is a valid BIP-39 phrase.
This checks all the provided words belong to the wordlist, that the length is valid and the checksum is correct.
A Wallet manages a single private key which is used to sign transactions, messages and other common payloads.
This class is generally the main entry point for developers that wish to use a private key directly, as it can create instances from a large variety of common sources, including raw private key, BIP-39 mnemonics and encrypte JSON wallets.
Resolves to a JSON Keystore Wallet encrypted with password.
If progressCallback is specified, it will receive periodic updates as the encryption process progreses.
Returns a JSON Keystore Wallet encryped with password.
It is preferred to use the async version instead, which allows a ProgressCallback to keep the user informed.
This method will block the event loop (freezing all UI) until it is complete, which may be a non-trivial duration.
Creates a new random HDNodeWallet using the available cryptographic random source.
Creates a Wallet by decrypting the json with password.
The fromEncryptedJson method is preferred, as this method will lock up and freeze the UI during decryption, which may take some time.
Creates a HDNodeWallet for phrase.
Returns the BIP-32 path for the account at index.
This is the pattern used by wallets like Ledger.
There is also an alternate pattern used by some software.
A HDNodeVoidWallet cannot sign, but provides access to the children nodes of a BIP-32 HD wallet addresses.
The can be created by using an extended xpub key to HDNodeWallet.fromExtendedKey or by nuetering a HDNodeWallet.
Resolves to a JSON Keystore Wallet encrypted with password.
If progressCallback is specified, it will receive periodic updates as the encryption process progreses.
Returns a JSON Keystore Wallet encryped with password.
It is preferred to use the async version instead, which allows a ProgressCallback to keep the user informed.
This method will block the event loop (freezing all UI) until it is complete, which may be a non-trivial duration.
Creates a new HD Node from extendedKey.
If the extendedKey will either have a prefix or xpub or xpriv, returning a neutered HD Node (HDNodeVoidWallet) or full HD Node ([[HDNodeWallet) respectively.
Before Ethereum launched, it was necessary to create a wallet format for backers to use, which would be used to receive ether as a reward for contributing to the project.
The Crowdsale Wallet format is now obsolete, but it is still useful to support and the additional code is fairly trivial as all the primitives required are used through core portions of the library.
Resolves to the decrypted JSON Keystore Wallet json using the password.
If provided, progress will be called periodically during the decrpytion to provide feedback, and if the function returns false will halt decryption.
The progressCallback will always receive 0 before decryption begins and 1 when complete.
Returns the account details for the JSON Keystore Wallet json using password.
It is preferred to use the async version instead, which allows a ProgressCallback to keep the user informed as to the decryption status.
This method will block the event loop (freezing all UI) until decryption is complete, which can take quite some time, depending on the wallet paramters and platform.
Resolved to the JSON Keystore Wallet for account encrypted with password.
The options can be used to tune the password-based key derivation function parameters, explicitly set the random values used and provide a ProgressCallback to receive periodic updates on the completion status..
Return the JSON Keystore Wallet for account encrypted with password.
The options can be used to tune the password-based key derivation function parameters, explicitly set the random values used. Any provided ProgressCallback is ignord.