Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
|
Public Member Functions | |
__construct (#[SensitiveParameter] string|array $words, #[SensitiveParameter] string $passPhrase="", string $path="m/44'/60'/0'/0/0", MnemonicLanguage|string $language=MnemonicLanguage::ENGLISH) | |
key () | |
getKeyRaw (bool $bin=false) | |
getAddress () | |
Static Public Member Functions | |
static | genNew (int $wordCount=24, MnemonicLanguage|string $language=MnemonicLanguage::ENGLISH) |
Protected Attributes | |
Key | $key |
MnemonicWallet extends the AbstractWallet to create a wallet from a mnemonic phrase. It handles the derivation and management of keys using BIP39 and HD Wallet standards.
M8B\EtherBinder\Wallet\MnemonicWallet::__construct | ( | # string|array | $words[SensitiveParameter], |
# string | $passPhrase[SensitiveParameter] = "", | ||
string | $path = "m/44'/60'/0'/0/0", | ||
MnemonicLanguage|string | $language = MnemonicLanguage::ENGLISH ) |
Constructor to create a MnemonicWallet from words. While constructing, the words are processed into private key.
string | array | $words | Mnemonic phrase words. |
string | $passPhrase | Optional passphrase for seed generation. For any passphrase it will generate another key, and there is no way of knowing if passphrase matched other than checking returning address is what was expected |
string | $path | HD Wallet derivation path. |
MnemonicLanguage | string | $language | Language for the mnemonic words. |
WrongMnemonicPathException | |
MnemonicWalletInternalException | |
InvalidHexException |
|
static |
Generates a new mnemonic phrase. If you don't have reason, use defaults.
int | $wordCount | Number of words in the mnemonic phrase. |
MnemonicLanguage | string | $language | Language for the mnemonic words. Defaults to english |
MnemonicWalletInternalException |
|
inherited |
Returns the wallet's associated Ethereum address.
EthBinderLogicException | Logic exception |
|
inherited |
Returns the raw private key in binary or hexadecimal format.
bool | $bin | If true, returns in binary. Otherwise, returns in hexadecimal. |
|
inherited |
Returns the underlying private key object stored in the wallet.