import { Pool } from './pool.js'\r
import { Rpc } from './rpc.js'\r
import { Safe } from './safe.js'\r
-import { ckdBip44, NanoNaCl } from './workers.js'\r
+import { Bip44Ckd, NanoNaCl } from './workers.js'\r
import type { Ledger } from './ledger.js'\r
\r
type KeyPair = {\r
throw new Error(`Bip44Wallet cannot be instantiated directly. Use 'await Bip44Wallet.create()' instead.`)\r
}\r
super(seed, mnemonic, id)\r
- this.#pool = new Pool(ckdBip44)\r
+ this.#pool = new Pool(Bip44Ckd)\r
Bip44Wallet.#isInternal = false\r
}\r
\r
-import ckdBip44 from './workers/ckdBip44.js'
+import { worker as Bip44Ckd } from './workers/ckdBip44.js'
import { worker as NanoNaCl } from './nano-nacl.js'
// import './workers/passkey.js'
import pow from './workers/pow.js'
-export { ckdBip44, NanoNaCl }
+export { Bip44Ckd, NanoNaCl }
chainCode: DataView
}
-const Bip44Ckd = () => {
+const b = () => {
const BIP44_COIN_NANO = 165
const BIP44_PURPOSE = 44
const HARDENED_OFFSET = 0x80000000
const signature = await subtle.sign('HMAC', pk, data)
return new Uint8Array(signature)
}
+
+ return { nanoCKD }
}
-export default Bip44Ckd.toString().substring(Bip44Ckd.toString().indexOf('{') + 1, Bip44Ckd.toString().lastIndexOf('}'))
+export const Bip44Ckd = b()
+
+const start = b.toString().indexOf('{') + 1
+const end = b.toString().lastIndexOf('return')
+export const worker = b.toString().substring(start, end)