UNPKG

@hdwallet/core

Version:

A complete Hierarchical Deterministic (HD) Wallet generator for 200+ cryptocurrencies, built with TypeScript.

60 lines 1.53 kB
// SPDX-License-Identifier: MIT import { normalizeDerivation } from '../utils'; export class Derivation { path; indexes; derivations; purpose = [0, true]; constructor(options = {}) { const [path, indexes, derivations] = normalizeDerivation(options?.path, options?.indexes); this.derivations = derivations; this.indexes = indexes; this.path = path; } static getName() { throw new Error('Must override getName()'); } getName() { return this.constructor.getName(); } clean() { throw new Error('Must override clean()'); } getPath() { return this.path; } getIndexes() { return this.indexes; } getDerivations() { return this.derivations; } getDepth() { return this.derivations.length; } getPurpose() { throw new Error('Must override getPurpose()'); } getCoinType() { throw new Error('Must override getCoinType()'); } getAccount() { throw new Error('Must override getAccount()'); } getChange(...args) { throw new Error('Must override getChange()'); } getRole(...args) { throw new Error('Must override getRole()'); } getAddress() { throw new Error('Must override getAddress()'); } getMinor() { throw new Error('Must override getMinor()'); } getMajor() { throw new Error('Must override getMajor()'); } } //# sourceMappingURL=derivation.js.map