From 50b7f4e07195df9d8e420c2c6b6fcb1255a9333f Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 22 May 2026 15:15:05 +0200 Subject: [PATCH] refactor(abstract-utxo): drop utxolib RootWalletKeys from keychains.ts Switch the instanceof check and Triple conversion path to use fixedScriptWallet.RootWalletKeys from wasm-utxo. The other input shapes (UtxoNamedKeychains, Triple<{pub}>, string[]) continue to work via the existing toKeychainTriple/string-array branches. Refs: T1-3279 --- modules/abstract-utxo/src/keychains.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/abstract-utxo/src/keychains.ts b/modules/abstract-utxo/src/keychains.ts index 073b40a848..2903a556bf 100644 --- a/modules/abstract-utxo/src/keychains.ts +++ b/modules/abstract-utxo/src/keychains.ts @@ -1,7 +1,6 @@ import assert from 'assert'; import * as t from 'io-ts'; -import { bitgo } from '@bitgo/utxo-lib'; import { IRequestTracer, IWallet, KeyIndices, promiseProps, Triple } from '@bitgo/sdk-core'; import { BIP32, bip32, fixedScriptWallet } from '@bitgo/wasm-utxo'; @@ -48,10 +47,10 @@ export function toKeychainTriple(keychains: UtxoNamedKeychains): Triple | string[] + keychains: fixedScriptWallet.RootWalletKeys | UtxoNamedKeychains | Triple<{ pub: string }> | string[] ): Triple { - if (keychains instanceof bitgo.RootWalletKeys) { - return keychains.triple.map((k) => BIP32.fromBase58(k.toBase58())) as Triple; + if (keychains instanceof fixedScriptWallet.RootWalletKeys) { + return [keychains.userKey(), keychains.backupKey(), keychains.bitgoKey()]; } if (Array.isArray(keychains)) { if (keychains.length !== 3) {