Skip to content

refactor(abstract-utxo): remove @bitgo/utxo-lib as a runtime dependency#8987

Merged
OttoAllmendinger merged 3 commits into
masterfrom
otto/abstract-utxo-terminal
Jun 10, 2026
Merged

refactor(abstract-utxo): remove @bitgo/utxo-lib as a runtime dependency#8987
OttoAllmendinger merged 3 commits into
masterfrom
otto/abstract-utxo-terminal

Conversation

@OttoAllmendinger

@OttoAllmendinger OttoAllmendinger commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes the removal of `@bitgo/utxo-lib` as a runtime dependency from `modules/abstract-utxo`. The previous PR (#8915) migrated all call sites in `abstractUtxoCoin.ts` — this PR finishes the job in the adjacent files and drops `utxo-lib` from `dependencies` entirely.

Changes, in order:

  1. drop utxolib RootWalletKeys from keychains.ts — switches the `instanceof` check and `Triple` conversion path to use `fixedScriptWallet.RootWalletKeys` from `wasm-utxo`. Other input shapes (`UtxoNamedKeychains`, `Triple<{pub}>`, `string[]`) continue to work via the existing branches.
  2. drop unused exports from wasmUtil — removes the unused `toWasmECPair` / `ECPairKey` helper (no src callers) and inlines the `isUtxoLibPsbt` type guard into `toWasmPsbt`'s narrowing branch. `wasmUtil.ts` remains as a bridge for remaining callers, but is now free of dead code.
  3. delete wasmUtil.ts and drop utxolib from runtime deps — all callers have been migrated off the `wasmUtil` bridge; the file is deleted and `@bitgo/utxo-lib` is moved from `dependencies` to `devDependencies` in `package.json`. The package is still required for tests (`utxolib.testutil.AcidTest`, network constants, BIP32 helpers).

Follows #8915 which removed the runtime dependency from `abstractUtxoCoin.ts`.

Test plan

  • `yarn tsc --noEmit` clean in `modules/abstract-utxo`
  • `yarn lint` clean in `modules/abstract-utxo`
  • All abstract-utxo unit tests pass
  • Verify `@bitgo/utxo-lib` not in `dependencies` (only `devDependencies`) in `modules/abstract-utxo/package.json`

Refs: T1-3279

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

T1-3279

@OttoAllmendinger OttoAllmendinger force-pushed the otto/abstract-utxo-terminal branch from f28a293 to b70b574 Compare June 10, 2026 14:45
@OttoAllmendinger OttoAllmendinger force-pushed the otto/keychains-drop-utxolib branch from 6f4898f to 50b7f4e Compare June 10, 2026 14:45
@OttoAllmendinger OttoAllmendinger changed the title [STACK umxksqmu] refactor(abstract-utxo): delete wasmUtil.ts and drop utxolib from runtime deps refactor(abstract-utxo): remove @bitgo/utxo-lib as a runtime dependency Jun 10, 2026
@OttoAllmendinger OttoAllmendinger changed the base branch from otto/keychains-drop-utxolib to master June 10, 2026 15:33
Switch the instanceof check and Triple<BIP32> 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
Remove the unused toWasmECPair / ECPairKey helper (no src callers) and
inline the isUtxoLibPsbt type guard into toWasmPsbt's narrowing branch.

The file remains a bridge between utxolib and wasm-utxo types — its
remaining callers (offlineVault/OfflineVaultHalfSigned.ts,
impl/btc/inscriptionBuilder.ts, transaction/descriptor/parse.ts,
transaction/fixedScript/signPsbtWasm.ts) still pass utxolib instances.

Refs: T1-3279
…time deps

All callers have been migrated off the wasmUtil bridge. Delete the file
and move @bitgo/utxo-lib from dependencies to devDependencies in
package.json. The dep is still required for tests (utxolib.testutil.AcidTest,
network constants, BIP32 helpers).

Refs: T1-3279
@OttoAllmendinger OttoAllmendinger force-pushed the otto/abstract-utxo-terminal branch from b70b574 to 45f0338 Compare June 10, 2026 15:33
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review June 10, 2026 16:07
@OttoAllmendinger OttoAllmendinger requested review from a team as code owners June 10, 2026 16:07
@OttoAllmendinger OttoAllmendinger merged commit 29bfefe into master Jun 10, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants