From: Chris Duncan Date: Sat, 7 Dec 2024 21:35:16 +0000 (-0800) Subject: Extend bip44ckd to listen for coin input. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=b8a23decfc180507207362f05deb5591773e1e38;p=libnemo.git Extend bip44ckd to listen for coin input. --- diff --git a/src/lib/bip44-ckd.ts b/src/lib/bip44-ckd.ts index ab1fdca..e430752 100644 --- a/src/lib/bip44-ckd.ts +++ b/src/lib/bip44-ckd.ts @@ -28,7 +28,11 @@ const b = () => { async function calculate (data: any[]): Promise { return new Promise(async (resolve) => { for (const d of data) { - d.privateKey = await nanoCKD(d.seed, d.index) + if (d.coin != null && d.coin !== BIP44_PURPOSE) { + d.privateKey = await ckd(d.seed, d.coin, d.index) + } else { + d.privateKey = await nanoCKD(d.seed, d.index) + } } resolve(data) })