From: Chris Duncan Date: Thu, 31 Jul 2025 21:44:44 +0000 (-0700) Subject: Fix imports. X-Git-Tag: v0.10.5~47^2~36 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=823db67fd24b3a385fd1dc12eb9c47458d8d21ef;p=libnemo.git Fix imports. --- diff --git a/src/lib/block.ts b/src/lib/block.ts index d0d880f..35d73a1 100644 --- a/src/lib/block.ts +++ b/src/lib/block.ts @@ -147,7 +147,7 @@ abstract class Block { async sign (input?: number | string, frontier?: ChangeBlock | ReceiveBlock | SendBlock): Promise { if (typeof input === 'number') { const index = input - const { LedgerWallet } = await import('./wallets') + const { LedgerWallet } = await import('./ledger') const ledger = await LedgerWallet.create() await ledger.connect() if (frontier) { diff --git a/src/lib/ledger.ts b/src/lib/ledger.ts index 276b1fd..bf671a6 100644 --- a/src/lib/ledger.ts +++ b/src/lib/ledger.ts @@ -5,12 +5,12 @@ import { ledgerUSBVendorId } from '@ledgerhq/devices' import { default as TransportBLE } from '@ledgerhq/hw-transport-web-ble' import { default as TransportUSB } from '@ledgerhq/hw-transport-webusb' import { default as TransportHID } from '@ledgerhq/hw-transport-webhid' -import { Wallet } from './wallets' -import { ChangeBlock, ReceiveBlock, SendBlock } from '#src/lib/block.js' -import { BIP44_COIN_NANO, BIP44_PURPOSE, HARDENED_OFFSET, LEDGER_ADPU_CODES, LEDGER_STATUS_CODES } from '#src/lib/constants.js' -import { bytes, dec, hex } from '#src/lib/convert.js' -import { Entropy } from '#src/lib/entropy.js' -import { Rpc } from '#src/lib/rpc.js' +import { ChangeBlock, ReceiveBlock, SendBlock } from './block' +import { BIP44_COIN_NANO, BIP44_PURPOSE, HARDENED_OFFSET, LEDGER_ADPU_CODES, LEDGER_STATUS_CODES } from './constants' +import { bytes, dec, hex } from './convert' +import { Entropy } from './entropy' +import { Rpc } from './rpc' +import { Wallet } from './wallet' import { DeviceStatus, KeyPair, LedgerAccountResponse, LedgerResponse, LedgerSignResponse, LedgerVersionResponse } from '#types' /** diff --git a/src/lib/safe.ts b/src/lib/safe.ts index 89bb4c7..bf53b38 100644 --- a/src/lib/safe.ts +++ b/src/lib/safe.ts @@ -7,10 +7,10 @@ import { parentPort } from 'node:worker_threads' import { Bip39Words } from './bip39-wordlist' import { Bip44Ckd } from './bip44-ckd' import { Blake2bCkd } from './blake2b-ckd' -import { NanoNaCl } from './safe/nano-nacl' -import { Bip39Mnemonic } from '#src/lib/bip39-mnemonic.js' -import { default as Convert, bytes, hex, utf8 } from '#src/lib/convert.js' -import { NamedData } from '#src/types.js' +import { NanoNaCl } from './nano-nacl' +import { Bip39Mnemonic } from './bip39-mnemonic.js' +import { default as Convert, bytes, hex, utf8 } from './convert.js' +import { NamedData } from '#types' /** * Cross-platform worker for managing wallet secrets. diff --git a/src/lib/safe/nano-nacl.ts b/src/lib/safe/nano-nacl.ts deleted file mode 100644 index 44afc7d..0000000 --- a/src/lib/safe/nano-nacl.ts +++ /dev/null @@ -1,598 +0,0 @@ -//! SPDX-FileCopyrightText: 2025 Chris Duncan -//! SPDX-License-Identifier: GPL-3.0-or-later - -'use strict' - -import { Blake2b } from '#src/lib/blake2b.js' -import { hex } from '#src/lib/convert.js' -import { Key, NamedData } from '#types' - -/** -* Ported in 2014 by Dmitry Chestnykh and Devi Mandiri. -* Public domain. -* -* Implementation derived from TweetNaCl version 20140427. -* See for details: http://tweetnacl.cr.yp.to/ -* -* Modified in 2024 by Chris Duncan to hash secret key to public key using -* BLAKE2b instead of SHA-512 as specified in the documentation for Nano -* cryptocurrency. -* See for details: https://docs.nano.org/integration-guides/the-basics/ -* Original source commit: https://github.com/dchest/tweetnacl-js/blob/71df1d6a1d78236ca3e9f6c788786e21f5a651a6/nacl-fast.js -*/ -export class NanoNaCl { - static async work (data: NamedData): Promise { - if (typeof data.method !== 'string' - || !(data.msg == null || data.msg instanceof ArrayBuffer) - || !(data.privateKey == null || data.privateKey instanceof ArrayBuffer) - || !(data.publicKey == null || data.publicKey instanceof ArrayBuffer) - || !(data.signature == null || data.signature instanceof ArrayBuffer) - ) { - throw new TypeError('Invalid NanoNaCl input') - } - const method = data.method - const msg = new Uint8Array(data.msg) - const privateKey = new Uint8Array(data.privateKey) - const publicKey = new Uint8Array(data.publicKey) - const signature = new Uint8Array(data.signature) - try { - switch (method) { - case 'convert': { - return { publicKey: (await this.convert(privateKey)).buffer } - } - case 'detached': { - return { signature: (await this.detached(msg, privateKey)).buffer } - } - case 'verify': { - return { isVerified: await this.verify(msg, signature, publicKey) } - } - default: { - throw new TypeError(`unknown NanoNaCl method ${method}`) - } - } - } catch (err) { - throw new Error(`NanoNaCl worker failed on ${method ?? 'unknown method'}`, { cause: err }) - } - } - - static gf = function (init?: number[]): Float64Array { - const r = new Float64Array(16) - if (init) for (let i = 0; i < init.length; i++) { - r[i] = init[i] - } - return r - } - - static gf0: Float64Array = this.gf() - static gf1: Float64Array = this.gf([1]) - static D: Float64Array = this.gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]) - static D2: Float64Array = this.gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]) - static X: Float64Array = this.gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]) - static Y: Float64Array = this.gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]) - static I: Float64Array = this.gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]) - - static vn (x: Uint8Array, xi: number, y: Uint8Array, yi: number, n: number): number { - let d = 0 - for (let i = 0; i < n; i++) { - d |= x[xi + i] ^ y[yi + i] - } - return (1 & ((d - 1) >>> 8)) - 1 - } - - static crypto_verify_32 (x: Uint8Array, xi: number, y: Uint8Array, yi: number): number { - return this.vn(x, xi, y, yi, 32) - } - - static set25519 (r: Float64Array, a: Float64Array): void { - for (let i = 0; i < 16; i++) { - r[i] = a[i] | 0 - } - } - - static car25519 (o: Float64Array): void { - let v, c = 1 - for (let i = 0; i < 16; i++) { - v = o[i] + c + 65535 - c = Math.floor(v / 65536) - o[i] = v - c * 65536 - } - o[0] += 38 * (c - 1) - } - - static sel25519 (p: Float64Array, q: Float64Array, b: number): void { - let t - const c = ~(b - 1) - for (let i = 0; i < 16; i++) { - t = c & (p[i] ^ q[i]) - p[i] ^= t - q[i] ^= t - } - } - - static pack25519 (o: Uint8Array, n: Float64Array): void { - let b: number - const m: Float64Array = this.gf() - const t: Float64Array = this.gf() - for (let i = 0; i < 16; i++) { - t[i] = n[i] - } - this.car25519(t) - this.car25519(t) - this.car25519(t) - for (let j = 0; j < 2; j++) { - m[0] = t[0] - 0xffed - for (let i = 1; i < 15; i++) { - m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1) - m[i - 1] &= 0xffff - } - m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1) - b = (m[15] >> 16) & 1 - m[14] &= 0xffff - this.sel25519(t, m, 1 - b) - } - for (let i = 0; i < 16; i++) { - o[2 * i] = t[i] & 0xff - o[2 * i + 1] = t[i] >> 8 - } - } - - static neq25519 (a: Float64Array, b: Float64Array): number { - const c = new Uint8Array(32) - const d = new Uint8Array(32) - this.pack25519(c, a) - this.pack25519(d, b) - return this.crypto_verify_32(c, 0, d, 0) - } - - static par25519 (a: Float64Array): number { - const d = new Uint8Array(32) - this.pack25519(d, a) - return d[0] & 1 - } - - static unpack25519 (o: Float64Array, n: Uint8Array): void { - for (let i = 0; i < 16; i++) { - o[i] = n[2 * i] + (n[2 * i + 1] << 8) - } - o[15] &= (1 << 15) - 1 - } - - static A (o: Float64Array, a: Float64Array, b: Float64Array): void { - for (let i = 0; i < 16; i++) { - o[i] = a[i] + b[i] - } - } - - static Z (o: Float64Array, a: Float64Array, b: Float64Array): void { - for (let i = 0; i < 16; i++) { - o[i] = a[i] - b[i] - } - } - - static M (o: Float64Array, a: Float64Array, b: Float64Array): void { - let v, c, s = 1 << 16, t = new Array(31) - t.fill(0) - - // init t values - for (let i = 0; i < 16; i++) { - for (let j = 0; j < 16; j++) { - t[i + j] += a[i] * b[j] - } - } - - for (let i = 0; i < 15; i++) { - t[i] += 38 * t[i + 16] - } - // t15 left as is - - // first carry - c = 1 - for (let i = 0; i < 16; i++) { - v = t[i] + c + s - 1 - c = Math.floor(v / s) - t[i] = v - c * s - } - t[0] += 38 * (c - 1) - - // second carry - c = 1 - for (let i = 0; i < 16; i++) { - v = t[i] + c + s - 1 - c = Math.floor(v / s) - t[i] = v - c * s - } - t[0] += 38 * (c - 1) - - // assign result to output - for (let i = 0; i < 16; i++) { - o[i] = t[i] - } - } - - static S (o: Float64Array, a: Float64Array): void { - this.M(o, a, a) - } - - static inv25519 (o: Float64Array, i: Float64Array): void { - const c: Float64Array = new Float64Array(16) - for (let a = 0; a < 16; a++) { - c[a] = i[a] - } - for (let a = 253; a >= 0; a--) { - this.S(c, c) - if (a !== 2 && a !== 4) this.M(c, c, i) - } - for (let a = 0; a < 16; a++) { - o[a] = c[a] - } - } - - static pow2523 (o: Float64Array, i: Float64Array): void { - const c: Float64Array = this.gf() - for (let a = 0; a < 16; a++) { - c[a] = i[a] - } - for (let a = 250; a >= 0; a--) { - this.S(c, c) - if (a !== 1) this.M(c, c, i) - } - for (let a = 0; a < 16; a++) { - o[a] = c[a] - } - } - - // Note: difference from TweetNaCl - BLAKE2b used to hash instead of SHA-512. - static crypto_hash (out: Uint8Array, m: Uint8Array, n: number): number { - const input = new Uint8Array(n) - for (let i = 0; i < n; ++i) { - input[i] = m[i] - } - const hash = new Blake2b(64).update(m).digest() - for (let i = 0; i < 64; ++i) { - out[i] = hash[i] - } - return 0 - } - - static add (p: Float64Array[], q: Float64Array[]): void { - const a: Float64Array = this.gf() - const b: Float64Array = this.gf() - const c: Float64Array = this.gf() - const d: Float64Array = this.gf() - const e: Float64Array = this.gf() - const f: Float64Array = this.gf() - const g: Float64Array = this.gf() - const h: Float64Array = this.gf() - const t: Float64Array = this.gf() - - this.Z(a, p[1], p[0]) - this.Z(t, q[1], q[0]) - this.M(a, a, t) - this.A(b, p[0], p[1]) - this.A(t, q[0], q[1]) - this.M(b, b, t) - this.M(c, p[3], q[3]) - this.M(c, c, this.D2) - this.M(d, p[2], q[2]) - this.A(d, d, d) - this.Z(e, b, a) - this.Z(f, d, c) - this.A(g, d, c) - this.A(h, b, a) - - this.M(p[0], e, f) - this.M(p[1], h, g) - this.M(p[2], g, f) - this.M(p[3], e, h) - } - - static cswap (p: Float64Array[], q: Float64Array[], b: number): void { - for (let i = 0; i < 4; i++) { - this.sel25519(p[i], q[i], b) - } - } - - static pack (r: Uint8Array, p: Float64Array[]): void { - const tx: Float64Array = this.gf() - const ty: Float64Array = this.gf() - const zi: Float64Array = this.gf() - this.inv25519(zi, p[2]) - this.M(tx, p[0], zi) - this.M(ty, p[1], zi) - this.pack25519(r, ty) - r[31] ^= this.par25519(tx) << 7 - } - - static scalarmult (p: Float64Array[], q: Float64Array[], s: Uint8Array): void { - this.set25519(p[0], this.gf0) - this.set25519(p[1], this.gf1) - this.set25519(p[2], this.gf1) - this.set25519(p[3], this.gf0) - for (let i = 255; i >= 0; --i) { - const b = (s[(i / 8) | 0] >> (i & 7)) & 1 - this.cswap(p, q, b) - this.add(q, p) - this.add(p, p) - this.cswap(p, q, b) - } - } - - static scalarbase (p: Float64Array[], s: Uint8Array): void { - const q: Float64Array[] = [this.gf(), this.gf(), this.gf(), this.gf()] - this.set25519(q[0], this.X) - this.set25519(q[1], this.Y) - this.set25519(q[2], this.gf1) - this.M(q[3], this.X, this.Y) - this.scalarmult(p, q, s) - } - - static L = new Float64Array([ - 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, - 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 - ]) - - static modL (r: Uint8Array, x: Float64Array): void { - let carry, i, j, k - for (i = 63; i >= 32; --i) { - carry = 0 - for (j = i - 32, k = i - 12; j < k; ++j) { - x[j] += carry - 16 * x[i] * this.L[j - (i - 32)] - carry = Math.floor((x[j] + 128) / 256) - x[j] -= carry * 256 - } - x[j] += carry - x[i] = 0 - } - carry = 0 - for (j = 0; j < 32; j++) { - x[j] += carry - (x[31] >> 4) * this.L[j] - carry = x[j] >> 8 - x[j] &= 255 - } - for (j = 0; j < 32; j++) { - x[j] -= carry * this.L[j] - } - for (i = 0; i < 32; i++) { - x[i + 1] += x[i] >> 8 - r[i] = x[i] & 255 - } - } - - static reduce (r: Uint8Array): void { - let x = new Float64Array(64) - for (let i = 0; i < 64; i++) { - x[i] = r[i] - } - for (let i = 0; i < 64; i++) { - r[i] = 0 - } - this.modL(r, x) - } - - // Note: difference from C - smlen returned, not passed as argument. - static crypto_sign (sm: Uint8Array, m: Uint8Array, n: number, sk: Uint8Array, pk: Uint8Array): number { - const d = new Uint8Array(64) - const h = new Uint8Array(64) - const r = new Uint8Array(64) - const x = new Float64Array(64) - const p: Float64Array[] = [this.gf(), this.gf(), this.gf(), this.gf()] - - this.crypto_hash(d, sk, 32) - d[0] &= 248 - d[31] &= 127 - d[31] |= 64 - - const smlen = n + 64 - for (let i = 0; i < n; i++) { - sm[64 + i] = m[i] - } - for (let i = 0; i < 32; i++) { - sm[32 + i] = d[32 + i] - } - - this.crypto_hash(r, sm.subarray(32), n + 32) - this.reduce(r) - this.scalarbase(p, r) - this.pack(sm, p) - - for (let i = 0; i < 32; i++) { - sm[i + 32] = pk[i] - } - this.crypto_hash(h, sm, n + 64) - this.reduce(h) - - for (let i = 0; i < 64; i++) { - x[i] = 0 - } - for (let i = 0; i < 32; i++) { - x[i] = r[i] - } - for (let i = 0; i < 32; i++) { - for (let j = 0; j < 32; j++) { - x[i + j] += h[i] * d[j] - } - } - - this.modL(sm.subarray(32), x) - return smlen - } - - static unpackneg (r: Float64Array[], p: Uint8Array): -1 | 0 { - const t: Float64Array = this.gf() - const chk: Float64Array = this.gf() - const num: Float64Array = this.gf() - const den: Float64Array = this.gf() - const den2: Float64Array = this.gf() - const den4: Float64Array = this.gf() - const den6: Float64Array = this.gf() - - this.set25519(r[2], this.gf1) - this.unpack25519(r[1], p) - this.S(num, r[1]) - this.M(den, num, this.D) - this.Z(num, num, r[2]) - this.A(den, r[2], den) - - this.S(den2, den) - this.S(den4, den2) - this.M(den6, den4, den2) - this.M(t, den6, num) - this.M(t, t, den) - - this.pow2523(t, t) - this.M(t, t, num) - this.M(t, t, den) - this.M(t, t, den) - this.M(r[0], t, den) - - this.S(chk, r[0]) - this.M(chk, chk, den) - if (this.neq25519(chk, num)) this.M(r[0], r[0], this.I) - - this.S(chk, r[0]) - this.M(chk, chk, den) - - if (this.neq25519(chk, num)) return -1 - - if (this.par25519(r[0]) === (p[31] >> 7)) this.Z(r[0], this.gf0, r[0]) - this.M(r[3], r[0], r[1]) - return 0 - } - - static crypto_sign_open (m: Uint8Array, sm: Uint8Array, n: number, pk: Uint8Array): number { - const t = new Uint8Array(32) - const h = new Uint8Array(64) - const p: Float64Array[] = [this.gf(), this.gf(), this.gf(), this.gf()] - const q: Float64Array[] = [this.gf(), this.gf(), this.gf(), this.gf()] - - if (n < 64) return -1 - - if (this.unpackneg(q, pk)) return -1 - - for (let i = 0; i < n; i++) { - m[i] = sm[i] - } - for (let i = 0; i < 32; i++) { - m[i + 32] = pk[i] - } - this.crypto_hash(h, m, n) - this.reduce(h) - this.scalarmult(p, q, h) - - this.scalarbase(q, sm.subarray(32)) - this.add(p, q) - this.pack(t, p) - - n -= 64 - if (this.crypto_verify_32(sm, 0, t, 0)) { - for (let i = 0; i < n; i++) { - m[i] = 0 - } - return -1 - } - - for (let i = 0; i < n; i++) { - m[i] = sm[i + 64] - } - return n - } - - static crypto_sign_BYTES: 64 = 64 - static crypto_sign_PUBLICKEYBYTES: 32 = 32 - static crypto_sign_PRIVATEKEYBYTES: 32 = 32 - static crypto_sign_SEEDBYTES: 32 = 32 - - /* High-level API */ - static checkArrayTypes (...args: Uint8Array[]): void { - for (let i = 0; i < args.length; i++) { - if (!(args[i] instanceof Uint8Array)) { - throw new TypeError(`expected Uint8Array; actual ${args[i].constructor?.name ?? typeof args[i]}`) - } - } - } - - static sign (msg: Uint8Array, privateKey: Uint8Array): Uint8Array { - this.checkArrayTypes(msg, privateKey) - if (privateKey.byteLength !== this.crypto_sign_PRIVATEKEYBYTES) { - throw new Error(`expected key size ${this.crypto_sign_PRIVATEKEYBYTES} bytes; actual key size ${privateKey.byteLength} bytes`) - } - const signedMsg = new Uint8Array(this.crypto_sign_BYTES + msg.length) - const publicKey = this.convert(privateKey) - this.crypto_sign(signedMsg, msg, msg.length, privateKey, publicKey) - return signedMsg - } - - static open (signedMsg: Uint8Array, publicKey: Uint8Array): Uint8Array { - this.checkArrayTypes(signedMsg, publicKey) - if (publicKey.length !== this.crypto_sign_PUBLICKEYBYTES) { - throw new Error('bad public key size') - } - const tmp = new Uint8Array(signedMsg.length) - const mlen = this.crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey) - - if (mlen < 0) return new Uint8Array(0) - - const m = new Uint8Array(mlen) - for (let i = 0; i < m.length; i++) { - m[i] = tmp[i] - } - return m - } - - static detached (msg: Uint8Array, privateKey: Uint8Array): Uint8Array { - const signedMsg = this.sign(msg, privateKey) - const sig = new Uint8Array(this.crypto_sign_BYTES) - for (let i = 0; i < sig.length; i++) { - sig[i] = signedMsg[i] - } - return sig - } - - static verify (msg: Uint8Array, sig: Uint8Array, publicKey: Uint8Array): boolean { - this.checkArrayTypes(msg, sig, publicKey) - if (sig.length !== this.crypto_sign_BYTES) { - throw new Error('bad signature size') - } - if (publicKey.length !== this.crypto_sign_PUBLICKEYBYTES) { - throw new Error('bad public key size') - } - const sm = new Uint8Array(this.crypto_sign_BYTES + msg.length) - const m = new Uint8Array(this.crypto_sign_BYTES + msg.length) - for (let i = 0; i < this.crypto_sign_BYTES; i++) { - sm[i] = sig[i] - } - for (let i = 0; i < msg.length; i++) { - sm[i + this.crypto_sign_BYTES] = msg[i] - } - return (this.crypto_sign_open(m, sm, sm.length, publicKey) >= 0) - } - - /** - * Derives a public key from a private key. - * - * @param {Key} seed - 32-byte private key - * @returns 32-byte public key byte array - */ - static convert (seed: Key): Uint8Array { - if (typeof seed === 'string') seed = hex.toBytes(seed) - this.checkArrayTypes(seed) - if (seed.length !== this.crypto_sign_SEEDBYTES) { - throw new Error('bad seed size') - } - const pk = new Uint8Array(this.crypto_sign_PUBLICKEYBYTES) - const p: Float64Array[] = [this.gf(), this.gf(), this.gf(), this.gf()] - - const hash = new Uint8Array(64) - this.crypto_hash(hash, seed, 64) - hash[0] &= 248 - hash[31] &= 127 - hash[31] |= 64 - - this.scalarbase(p, hash) - this.pack(pk, p) - - return pk - } -} diff --git a/src/lib/tools.ts b/src/lib/tools.ts index 8143107..8065aea 100644 --- a/src/lib/tools.ts +++ b/src/lib/tools.ts @@ -6,9 +6,10 @@ import { Blake2b } from './blake2b' import { SendBlock } from './block' import { UNITS } from './constants' import { bytes, hex } from './convert' +import { LedgerWallet } from './ledger' import { NanoNaCl } from './nano-nacl' import { Rpc } from './rpc' -import { Bip44Wallet, Blake2bWallet, LedgerWallet } from './wallets' +import { Wallet } from './wallet' import { Key } from '#types' type SweepResult = { @@ -114,7 +115,7 @@ export async function sign (key: Key, ...input: string[]): Promise { */ export async function sweep ( rpc: Rpc | string | URL, - wallet: Blake2bWallet | Bip44Wallet | LedgerWallet, + wallet: Wallet | LedgerWallet, recipient: string, from: number = 0, to: number = from diff --git a/src/main.ts b/src/main.ts index 426665a..7d6536b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,7 +7,7 @@ import { ChangeBlock, ReceiveBlock, SendBlock } from './lib/block' import { Rolodex } from './lib/rolodex' import { Rpc } from './lib/rpc' import { Tools } from './lib/tools' -import { Wallet, Bip44Wallet, Blake2bWallet, LedgerWallet } from './lib/wallets' +import { Wallet } from './lib/wallet' export { Account, @@ -16,5 +16,5 @@ export { Rolodex, Rpc, Tools, - Wallet, Bip44Wallet, Blake2bWallet, LedgerWallet + Wallet }