From 31bf5b1a1fd262fdc84ad151e3a79ecc7c0b7a11 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 22 May 2026 14:43:35 +0200 Subject: [PATCH] chore(scripts): remove utxo boilerplate from sdk-coin-generator The utxo boilerplate template depended on @bitgo/utxo-lib and abstract-utxo's legacy code paths, and was producing TS compile errors after recent abstract-utxo refactors. New utxo coins are not being added via this generator; remove the template and the related dependency/menu entries. Refs: T1-3279 --- scripts/sdk-coin-generator/index.js | 10 ------- .../template/boilerplates/utxo/.mainnet.ts | 25 ---------------- .../template/boilerplates/utxo/.testnet.ts | 20 ------------- .../template/boilerplates/utxo/.tsconfig.json | 29 ------------------- .../template/boilerplates/utxo/index.ts | 4 --- .../template/boilerplates/utxo/transaction.ts | 19 ------------ .../boilerplates/utxo/transactionBuilder.ts | 14 --------- 7 files changed, 121 deletions(-) delete mode 100644 scripts/sdk-coin-generator/template/boilerplates/utxo/.mainnet.ts delete mode 100644 scripts/sdk-coin-generator/template/boilerplates/utxo/.testnet.ts delete mode 100644 scripts/sdk-coin-generator/template/boilerplates/utxo/.tsconfig.json delete mode 100644 scripts/sdk-coin-generator/template/boilerplates/utxo/index.ts delete mode 100644 scripts/sdk-coin-generator/template/boilerplates/utxo/transaction.ts delete mode 100644 scripts/sdk-coin-generator/template/boilerplates/utxo/transactionBuilder.ts diff --git a/scripts/sdk-coin-generator/index.js b/scripts/sdk-coin-generator/index.js index 3e118c927c..87d574cbb8 100644 --- a/scripts/sdk-coin-generator/index.js +++ b/scripts/sdk-coin-generator/index.js @@ -1,7 +1,6 @@ const Generator = require('yeoman-generator'); const fs = require('fs'); -const UTXO_DEPENDENCIES = ['abstract-utxo', 'sdk-core', 'utxo-lib']; const ACCOUNT_DEPENDENCIES = ['abstract-eth', 'sdk-core', 'statics']; const SIMPLE_DEPENDENCIES = ['sdk-core']; @@ -82,7 +81,6 @@ module.exports = class extends Generator { choices: [ { name: 'Simple (default)', value: 'simple' }, { name: 'Account', value: 'account' }, - { name: 'Utxo', value: 'utxo' }, ], }, ]); @@ -127,9 +125,6 @@ module.exports = class extends Generator { case 'account': templatePath = './boilerplates/account'; break; - case 'utxo': - templatePath = './boilerplates/utxo'; - break; default: templatePath = './boilerplates/simple'; break; @@ -160,11 +155,6 @@ module.exports = class extends Generator { addNewCoinToBitgoTsConfig(this.contextRoot, this.answers); switch (this.answers.boilerplate) { - case 'utxo': { - const dependencies = getDependencies(this.contextRoot, UTXO_DEPENDENCIES); - await this.addDependencies(dependencies); - break; - } case 'account': { const dependencies = getDependencies(this.contextRoot, ACCOUNT_DEPENDENCIES); await this.addDependencies(dependencies); diff --git a/scripts/sdk-coin-generator/template/boilerplates/utxo/.mainnet.ts b/scripts/sdk-coin-generator/template/boilerplates/utxo/.mainnet.ts deleted file mode 100644 index 86af064ab8..0000000000 --- a/scripts/sdk-coin-generator/template/boilerplates/utxo/.mainnet.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { AbstractUtxoCoin, UtxoNetwork } from '@bitgo/abstract-utxo'; -import { BitGoBase, BaseCoin } from '@bitgo/sdk-core'; -import * as utxolib from '@bitgo/utxo-lib'; - -export class <%= constructor %> extends AbstractUtxoCoin { - constructor(bitgo: BitGoBase, network?: UtxoNetwork) { - super(bitgo, network || utxolib.networks.<%= coinLowerCase %>); - } - - static createInstance(bitgo: BitGoBase): BaseCoin { - return new <%= constructor %>(bitgo); - } - - getChain(): string { - return '<%= symbol %>'; - } - - getFamily(): string { - return '<%= symbol %>'; - } - - getFullName(): string { - return '<%= coin %>'; - } -} diff --git a/scripts/sdk-coin-generator/template/boilerplates/utxo/.testnet.ts b/scripts/sdk-coin-generator/template/boilerplates/utxo/.testnet.ts deleted file mode 100644 index ff5fcaaeaf..0000000000 --- a/scripts/sdk-coin-generator/template/boilerplates/utxo/.testnet.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @prettier - */ -import { BitGoBase, BaseCoin } from '@bitgo/sdk-core'; -import { <%= constructor %> } from './<%= symbol %>'; -import * as utxolib from '@bitgo/utxo-lib'; - -export class <%= testnetConstructor %> extends <%= constructor %> { - constructor(bitgo: BitGoBase) { - super(bitgo, utxolib.networks.<%= coinLowerCase %>Test); - } - - getChain(): string { - return '<%= testnetSymbol %>'; - } - - getFullName(): string { - return 'Testnet <%= coin %>'; - } -} diff --git a/scripts/sdk-coin-generator/template/boilerplates/utxo/.tsconfig.json b/scripts/sdk-coin-generator/template/boilerplates/utxo/.tsconfig.json deleted file mode 100644 index 2e0a0616c5..0000000000 --- a/scripts/sdk-coin-generator/template/boilerplates/utxo/.tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "./", - "strictPropertyInitialization": false, - "esModuleInterop": true, - "typeRoots": ["../../types", "./node_modules/@types", "../../node_modules/@types"] - }, - "include": ["src/**/*", "test/**/*"], - "exclude": ["node_modules"], - "references": [ - { - "path": "../abstract-utxo" - }, - { - "path": "../sdk-api" - }, - { - "path": "../sdk-core" - }, - { - "path": "../sdk-test" - }, - { - "path": "../utxo-lib" - } - ] -} diff --git a/scripts/sdk-coin-generator/template/boilerplates/utxo/index.ts b/scripts/sdk-coin-generator/template/boilerplates/utxo/index.ts deleted file mode 100644 index f0ed7db53b..0000000000 --- a/scripts/sdk-coin-generator/template/boilerplates/utxo/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './<%= symbol %>'; -export * from './<%= testnetSymbol %>'; -export * from './transaction'; -export * from './transactionBuilder'; diff --git a/scripts/sdk-coin-generator/template/boilerplates/utxo/transaction.ts b/scripts/sdk-coin-generator/template/boilerplates/utxo/transaction.ts deleted file mode 100644 index 472f2feb37..0000000000 --- a/scripts/sdk-coin-generator/template/boilerplates/utxo/transaction.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Install and import coin specific packages -import bitgo from '@bitgo/utxo-lib'; - -const { networks, UtxoTransaction } = bitgo - -// Add networks.<%= symbol %> and networks.<%= symbol %>Test to @bitgo/utxo-lib -export type <%= constructor %>Network = typeof networks.<%= symbol %> | typeof networks.<%= symbol %>Test; - -export class UnsupportedTransactionError extends Error { - constructor(message: string) { - super(message); - } -} - -export class <%= constructor %>Transaction extends UtxoTransaction { - constructor(public network: <%= constructor %>Network, tx?: <%= constructor %>Transaction) { - super(network, tx); - } -} diff --git a/scripts/sdk-coin-generator/template/boilerplates/utxo/transactionBuilder.ts b/scripts/sdk-coin-generator/template/boilerplates/utxo/transactionBuilder.ts deleted file mode 100644 index 28df4b4453..0000000000 --- a/scripts/sdk-coin-generator/template/boilerplates/utxo/transactionBuilder.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Install and import coin specific packages -import bitgo, { Network } from '@bitgo/utxo-lib'; -import { <%= constructor %>Transaction } from './transaction'; - -const { UtxoTransactionBuilder } = bitgo - -export class <%= constructor %>TransactionBuilder extends UtxoTransactionBuilder< - TNumber, - <%= constructor %>Transaction -> { - constructor(network: Network, txb?: UtxoTransactionBuilder) { - super(network, txb); - } -}