@hdwallet/core
Version:
A complete Hierarchical Deterministic (HD) Wallet generator for 200+ cryptocurrencies, built with TypeScript.
17 lines • 601 B
JavaScript
// SPDX-License-Identifier: MIT
import { MoneroMnemonic } from '../mnemonics';
import { MnemonicError } from '../exceptions';
import { Seed } from './seed';
export class MoneroSeed extends Seed {
static getName() {
return 'Monero';
}
static fromMnemonic(mnemonic) {
const phrase = typeof mnemonic === 'string' ? mnemonic : mnemonic.getMnemonic();
if (!MoneroMnemonic.isValid(phrase)) {
throw new MnemonicError(`Invalid ${this.getName()} mnemonic words`);
}
return MoneroMnemonic.decode(phrase);
}
}
//# sourceMappingURL=monero.js.map