From 0a7768bddf4c28650977da43ac115443e8e9269d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:26:06 +0000 Subject: [PATCH 1/5] Initial plan From 60e20a4141ad6b8cac14c2505cb7531adeedbd8b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:29:08 +0000 Subject: [PATCH 2/5] Fix critical bugs: utf16 decoder and wif async functions Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com> --- utf16.js | 2 +- wif.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/utf16.js b/utf16.js index 43f952d1..346a275b 100644 --- a/utf16.js +++ b/utf16.js @@ -8,7 +8,7 @@ const decoderLooseLE = canDecoders ? new TextDecoder('utf-16le', { ignoreBOM }) const decoderFatalBE = canDecoders ? new TextDecoder('utf-16be', { ignoreBOM, fatal: true }) : null const decoderLooseBE = canDecoders ? new TextDecoder('utf-16be', { ignoreBOM }) : null const decoderFatal16 = isLE ? decoderFatalLE : decoderFatalBE -const decoderLoose16 = isLE ? decoderLooseLE : decoderFatalBE +const decoderLoose16 = isLE ? decoderLooseLE : decoderLooseBE const { isWellFormed, toWellFormed } = String.prototype const { E_STRICT, E_STRICT_UNICODE } = js diff --git a/wif.js b/wif.js index cc6737f0..ecc5ba02 100644 --- a/wif.js +++ b/wif.js @@ -34,9 +34,7 @@ function to({ version: v, privateKey, compressed }) { // ./base58check is sync internally anyway for now, so doesn't matter until that is changed export const fromWifStringSync = (string, version) => from(fromBase58checkSync(string), version) -// export const fromWifString = async (string, version) => from(await fromBase58check(string), version) -export const fromWifString = async (string, version) => from(fromBase58checkSync(string), version) +export const fromWifString = async (string, version) => from(await fromBase58check(string), version) export const toWifStringSync = (wif) => toBase58checkSync(to(wif)) -// export const toWifString = async (wif) => toBase58check(to(wif)) -export const toWifString = async (wif) => toBase58checkSync(to(wif)) +export const toWifString = async (wif) => toBase58check(to(wif)) From 8123a960fd88e0debcedde9746aa5f9973c27527 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:30:13 +0000 Subject: [PATCH 3/5] Add missing async imports in wif.js Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com> --- wif.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wif.js b/wif.js index ecc5ba02..533580cc 100644 --- a/wif.js +++ b/wif.js @@ -1,4 +1,9 @@ -import { toBase58checkSync, fromBase58checkSync } from '@exodus/bytes/base58check.js' +import { + toBase58checkSync, + fromBase58checkSync, + toBase58check, + fromBase58check, +} from '@exodus/bytes/base58check.js' import { assertUint8 } from './assert.js' // Mostly matches npmjs.com/wif, but with extra checks + using our base58check From c184e038991fc4a711df011d86bbc2d5672be433 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:31:14 +0000 Subject: [PATCH 4/5] Add missing await in toWifString Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com> --- wif.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wif.js b/wif.js index 533580cc..634564b3 100644 --- a/wif.js +++ b/wif.js @@ -42,4 +42,4 @@ export const fromWifStringSync = (string, version) => from(fromBase58checkSync(s export const fromWifString = async (string, version) => from(await fromBase58check(string), version) export const toWifStringSync = (wif) => toBase58checkSync(to(wif)) -export const toWifString = async (wif) => toBase58check(to(wif)) +export const toWifString = async (wif) => await toBase58check(to(wif)) From f052f20fdce832b7e75eb5febb108a9e790dffc6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:48:10 +0000 Subject: [PATCH 5/5] Revert wif.js changes - intentionally uses sync for performance Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com> --- wif.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/wif.js b/wif.js index 634564b3..cc6737f0 100644 --- a/wif.js +++ b/wif.js @@ -1,9 +1,4 @@ -import { - toBase58checkSync, - fromBase58checkSync, - toBase58check, - fromBase58check, -} from '@exodus/bytes/base58check.js' +import { toBase58checkSync, fromBase58checkSync } from '@exodus/bytes/base58check.js' import { assertUint8 } from './assert.js' // Mostly matches npmjs.com/wif, but with extra checks + using our base58check @@ -39,7 +34,9 @@ function to({ version: v, privateKey, compressed }) { // ./base58check is sync internally anyway for now, so doesn't matter until that is changed export const fromWifStringSync = (string, version) => from(fromBase58checkSync(string), version) -export const fromWifString = async (string, version) => from(await fromBase58check(string), version) +// export const fromWifString = async (string, version) => from(await fromBase58check(string), version) +export const fromWifString = async (string, version) => from(fromBase58checkSync(string), version) export const toWifStringSync = (wif) => toBase58checkSync(to(wif)) -export const toWifString = async (wif) => await toBase58check(to(wif)) +// export const toWifString = async (wif) => toBase58check(to(wif)) +export const toWifString = async (wif) => toBase58checkSync(to(wif))