{any} wallet object
Generate a new address for the specified wallet
Create a watch wallet from a wallet address
{string}
Create a wallet from an extended private key. supported BIP32 Root Key | Account Extended Private Key | BIP32 Extended Private Key
{string} - BIP32 Extended Private Key
https://iancoleman.io/bip39/ m/44'/60'/0'/0 Derivation Path BIP44
Returns the wallet details for the JSON Keystore Wallet json using {password}.
{string} Wallet keystore JSON string
{string} decrypt keystoreJson using {password}
Create a wallet from a mnemonic phrase. If the parameter is not specified, a random wallet will be created.
//
// create a random wallet
//
const walletObj = new WalletFactory().createWalletFromMnemonic();
// should return a WalletEntityBaseItem object:
{
isHD: true,
mnemonic: 'million butter obtain fuel address truck grunt recall gain rotate debris flee',
password: '',
address: '0x03a06e86556C819199E602851e4453a89718cB36',
publicKey: '0x0384636daeaf2f410f7c4a6749a143096838a0482bcee94e412ca3a683bca3ac00',
privateKey: '0x44dd0864d00e37090622a17e66c0914bd71a1245a3a2e4f88611775854f4eafc',
index: 0,
path: "m/44'/60'/0'/0/0"
}
//
// Create a wallet from a mnemonic phrase
//
const mnemonic = 'olympic cradle tragic crucial exit annual silly cloth scale fine gesture ancient';
const walletObj = new WalletFactory().createWalletFromMnemonic( mnemonic );
// should return a WalletEntityBaseItem object:
{
isHD: true,
mnemonic: 'olympic cradle tragic crucial exit annual silly cloth scale fine gesture ancient',
password: '',
address: '0xC8F60EaF5988aC37a2963aC5Fabe97f709d6b357',
publicKey: '0x03ed2098910ab9068abd54e1562eb9dee3cb2d9fc1426dfe91541970a89b5aa622',
privateKey: '0xf8ba731e3d09ce93ee6256d7393e993be01cd84de044798372c0d1a8ad9b952a',
index: 0,
path: "m/44'/60'/0'/0/0"
}
Optional
mnemonic: string{string} mnemonic string
Create a wallet from a wallet private key
//
// Create a wallet from a private key
//
const privateKey = '0xc7f832621897e67d973f0f1c497198ed1b89a138f2fe3cc6ce6a59cd3fb7cd4c';
const walletObj = new WalletFactory().createWalletFromPrivateKey( privateKey );
// should return a WalletEntityBaseItem object:
{
isHD: false,
mnemonic: '',
password: '',
address: '0xcc361bdf821563d2a8ac5b57a9e34ec5ca48c5f3',
publicKey: '0x03f2a1155a81b2b5c5e61ec0c148d5465432e9f4b4904e3a25513b27055b0719bb',
privateKey: '0xc7f832621897e67d973f0f1c497198ed1b89a138f2fe3cc6ce6a59cd3fb7cd4c',
index: 0,
path: null
}
{any}
Create a watch wallet
{string} wallet address
derive the next wallet
{TWalletBaseItem} wallet object
Resolved to the JSON Keystore Wallet for {wallet} encrypted with {password}.
{WalletEntityBaseItem} wallet entity base item object
{string} encrypt {wallet} with {password}
Check the input value is a valid address
// should return true
isValidAddress( '0xcc361bdf821563d2a8ac5b57a9e34ec5ca48c5f3' );
// should return false
isValidAddress( '0x1111' );
isValidAddress( null );
isValidAddress( undefined );
{string} - wallet address
Static
is
create a new wallet, or import a wallet from a specified mnemonic, keystore, private key or wallet address.