From b8a23decfc180507207362f05deb5591773e1e38 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 7 Dec 2024 13:35:16 -0800 Subject: [PATCH] Extend bip44ckd to listen for coin input. --- src/lib/bip44-ckd.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) }) -- 2.34.1