refactor(abstract-utxo): remove utxolib runtime dependency from abstractUtxoCoin#8915
Merged
Merged
Conversation
c011adb to
f3ecc52
Compare
4b8b110 to
d5eb4fa
Compare
lcovar
previously approved these changes
Jun 2, 2026
7e020d6 to
52032dc
Compare
d5eb4fa to
88c632f
Compare
52032dc to
296661e
Compare
88c632f to
724080b
Compare
724080b to
1e3a4b1
Compare
Closed
3 tasks
…tUtxoCoin The only remaining caller was the deleted fetchInputs and the doge override that just delegated to super. Remove the method, drop the doge override, and remove the now-unused createTransactionFromHex stubs from verifyTransaction tests. Refs: T1-3279
BitGoPsbt.fromBytes accepts NetworkName = UtxolibName | CoinName, so the round-trip through utxolib.getNetworkName is unnecessary. Drop the utxolib import from decode.ts. Refs: T1-3279
…h wasm/coinName equivalents - supportsBlockTarget: compare coinName instead of utxolib network objects - isSupportedScriptType: use fixedScriptWallet.supportsScriptType from wasm-utxo - postProcessPrebuild: delete the psbt-lite detection block and the allowNonSegwitSigningWithoutPrevTx flag end-to-end (wasm-utxo signing is permissive by default and never read the flag) Refs: T1-3279
…rmat Replace utxolib.addressFormat.toOutputScriptAndFormat / fromOutputScriptWithFormat with wasm-utxo's address.toOutputScriptWithCoin / fromOutputScriptWithCoin. Detect address format by trying each candidate and checking which round-trips byte-equal. Refs: T1-3279
…branches - isChainCode / scriptTypeForChain -> ChainCode.is / ChainCode.scriptType (wasm-utxo) - hasKeyPathSpendInput: drop unreachable utxolib.bitgo.UtxoPsbt branch and isTransactionWithKeyPathSpendInput call (DecodedTransaction is now BitGoPsbt only) - validAddressTypes: inline the 2-of-3 list instead of utxolib.outputScripts.scriptTypes2Of3 - Drop unused RootWalletKeys / UtxoNetwork type re-exports and the now-empty utxolib bitgo import Three utxolib references remain in abstractUtxoCoin: the ScriptType2Of3 type re-export, the deprecated network getter (still used by tests), and the top-level utxolib import that backs both. Refs: T1-3279
…orkFromCoinName Drop the deprecated coin.network getter from AbstractUtxoCoin and the getNetworkFromCoinName helper from names.ts. Tests that previously called coin.network now call the test-local getNetworkForCoinName(coin.name) from util/utxoCoins. With this, names.ts no longer depends on utxolib. Refs: T1-3279
Replace the utxolib.bitgo.outputScripts.ScriptType2Of3 type re-export with
an inline literal union. The values are identical to the utxolib export
('p2sh' | 'p2shP2wsh' | 'p2wsh' | 'p2tr' | 'p2trMusig2').
This removes the last utxolib type reference and the top-level utxolib import
from abstractUtxoCoin.ts.
Refs: T1-3279
1e3a4b1 to
ea0b137
Compare
davidkaplanbitgo
approved these changes
Jun 10, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes all
@bitgo/utxo-libruntime call sites frommodules/abstract-utxo/src/abstractUtxoCoin.ts, replacing them with@bitgo/wasm-utxoor plaincoinName-based equivalents. By the end of this PR,abstractUtxoCoin.tscarries noutxolibimport at all.Changes land in stack order (lowest first):
createTransactionFromHexfromAbstractUtxoCoin— the only remaining caller was the already-deletedfetchInputs; the Doge override just delegated tosuper. Removes the method and the stale sinon stubs fromverifyTransactiontests.coinNamedirectly toBitGoPsbt.fromBytes—BitGoPsbt.fromBytesalready acceptsCoinName | UtxolibName, so theutxolib.getNetworkNameround-trip indecode.tsis unnecessary. Drops theutxolibimport fromdecode.ts.supportsBlockTargetnow comparescoinNamestrings;isSupportedScriptTypedelegates tofixedScriptWallet.supportsScriptType(wasm-utxo);postProcessPrebuilddrops the dead psbt-lite detection block and theallowNonSegwitSigningWithoutPrevTxflag (wasm-utxo signing never consulted it).isValidAddressoffutxolib.addressFormat— replacestoOutputScriptAndFormat/fromOutputScriptWithFormatwith wasm-utxo'saddress.toOutputScriptWithCoin/fromOutputScriptWithCoin, detecting format by round-trip equality.utxolib.bitgohelpers and drop dead branches —isChainCode/scriptTypeForChain→ChainCode.is/ChainCode.scriptType(wasm-utxo); removes the unreachableUtxoPsbtbranch inhasKeyPathSpendInput; inlines the 2-of-3 script type list instead ofutxolib.outputScripts.scriptTypes2Of3; drops unusedRootWalletKeys/UtxoNetworkre-exports.networkgetter andgetNetworkFromCoinName— drops the deprecatedcoin.networkgetter fromAbstractUtxoCoinand thegetNetworkFromCoinNamehelper fromnames.ts. Tests that calledcoin.networknow use a test-localgetNetworkForCoinName(coin.name). With this,names.tsno longer depends onutxolib.ScriptType2Of3type definition — replaces theutxolib.bitgo.outputScripts.ScriptType2Of3type re-export with a local literal union ('p2sh' | 'p2shP2wsh' | 'p2wsh' | 'p2tr' | 'p2trMusig2'), removing the lastutxolibtype reference and the top-levelutxolibimport fromabstractUtxoCoin.ts.The downstream PR (#8986) updates
keychains.ts; #8987 deleteswasmUtil.tsand demotes@bitgo/utxo-libtodevDependencies.Followed by #8986
Test plan
yarn tsc --noEmitclean inmodules/abstract-utxoyarn lintclean inmodules/abstract-utxoRefs: T1-3279
🤖 Generated with Claude Code