Endless Wallet Standard
Endless Wallet Standard
Mnemonics phrases
Creating an Endless account
import { Account, isValidHardenedPath } from '@endlesslab/endless-ts-sdk'
/**
* Creates new account with bip44 path and mnemonics,
* @param path. (e.g. m/44'/637'/0'/0'/0')
* Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
* @param mnemonics.
* @returns Account
*/
static fromDerivationPath(path: string, mnemonics: string): Account {
if (!isValidHardenedPath(path)) {
throw new Error("Invalid derivation path");
}
const normalizeMnemonics = mnemonics
.trim()
.split(/\s+/)
.map((part) => part.toLowerCase())
.join(" ");
const endlessAccount = Account.fromDerivationPath({
path: `m/44'/637'/0'/0'/0'`,
mnemonic: normalizeMnemonics,
});
return endlessAccount;
}Supporting one mnemonic per multiple account wallets
dapp API
Connection APIs
State APIs
Signing APIs
Event listening
Last updated