UNPKG

@samyan/hd-wallet

Version:

72 lines (71 loc) 1.75 kB
declare enum BLOCKCHAIN_NETWORK { BITCOIN = "bitcoin", BITCOIN_REGTEST = "bitcoinRegTest", LITECOIN = "litecoin", ETHEREUM = "ethereum", RIPPLE = "ripple", TRON = "tron" } declare class HDWallet { private segwitParameters; private rootKey; private accountExtendedKey; private protocol; private mnemonicWord; private includePrivateKey; private seed; private log; /** * Constructor * * @param {BLOCKCHAIN_NETWORK} protocol * @param {string} mnemonicWord * @param {boolean} [includePrivateKey=false] * @param {boolean} [log=false] * @memberof HDWallet */ constructor(protocol: BLOCKCHAIN_NETWORK, mnemonicWord: string, includePrivateKey?: boolean, log?: boolean); /** * Generate * * @param {string} path * @param {number} index * @return {*} {string} * @memberof HDWallet */ generate(path: string, index: number): { address: string; publicKey: string; privateKey?: string; }; /** * Calculate bip32 extended key by root key * * @private * @param {BIP32Interface} bip32RootKey * @param {string} path * @return {*} {BIP32Interface} * @memberof HDWallet */ private calcBip32ExtendedKey; /** * Convert address to Ripple address * * @private * @param {string} address * @return {*} {string} * @memberof HDWallet */ private convertRippleAdrr; /** * Print wallet * * @private * @param {string} address * @param {string} prvKey * @param {string} pubKey * @memberof HDWallet */ private printWallet; } export { BLOCKCHAIN_NETWORK, HDWallet };