UNPKG

@xpla/xpla

Version:

<p align="center"> <img src="https://user-images.githubusercontent.com/545047/188804067-28e67e5e-0214-4449-ab04-2e0c564a6885.svg" width="80"> </p>

35 lines (34 loc) 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EthSecp256k1HDWallet = void 0; const amino_1 = require("../signers/amino"); const defaults_1 = require("../defaults"); const direct_1 = require("../signers/direct"); const secp256k1hd_1 = require("@interchainjs/cosmos/wallets/secp256k1hd"); /** * Cosmos HD Wallet for secp256k1 */ class EthSecp256k1HDWallet extends secp256k1hd_1.HDWallet { constructor(accounts, options) { const opts = { ...defaults_1.defaultSignerOptions.Cosmos, ...options }; super(accounts, opts); } getDirectDocSigner(auth, config) { return new direct_1.DirectDocSigner(auth, config); } getAminoDocSigner(auth, config) { return new amino_1.AminoDocSigner(auth, config); } /** * Create a new HD wallet from mnemonic * @param mnemonic * @param derivations infos for derivate addresses * @param options wallet options * @returns HD wallet */ static fromMnemonic(mnemonic, derivations = [{ hdPath: "m/44'/60'/0'/0/0", prefix: "xpla" }], options = { bip39Password: "", signerConfig: defaults_1.defaultSignerOptions.Cosmos }) { const opts = { ...defaults_1.defaultWalletOptions, ...options }; return super.fromMnemonic(mnemonic, derivations, opts); } } exports.EthSecp256k1HDWallet = EthSecp256k1HDWallet;