@cfxdevkit/core / deriveAccounts
Function: deriveAccounts()
deriveAccounts(
mnemonic,options):DerivedAccount[]
Defined in: packages/core/src/wallet/derivation.ts:132
Derive multiple accounts from a mnemonic phrase
Derives accounts for both Conflux Core Space and eSpace using BIP-44 standard derivation paths:
- Core Space: m/44’/503’/{accountType}‘/0/{index}
- eSpace: m/44’/60’/{accountType}‘/0/{index}
Parameters
mnemonic
string
BIP-39 mnemonic phrase
options
Derivation options
Returns
Array of derived accounts
Throws
Error if mnemonic is invalid
Example
const accounts = deriveAccounts(mnemonic, {
count: 10,
coreNetworkId: 2029, // Local network
});
console.log(accounts[0].coreAddress); // cfx:...
console.log(accounts[0].evmAddress); // 0x...