Skip to content

Commit 493424b

Browse files
committed
feat(statics): refactoring
Ticket: WIN-6072
1 parent df4ba6b commit 493424b

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

modules/statics/src/base.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,4 +3469,20 @@ export abstract class BaseCoin {
34693469
this.network = options.network;
34703470
this.primaryKeyCurve = options.primaryKeyCurve;
34713471
}
3472+
3473+
/**
3474+
* Returns features from a base feature set, excluding specified features
3475+
* @param excludedFeatures Array of features to exclude
3476+
* @param baseFeatures Base feature array to filter from (optional)
3477+
* @returns Filtered array of features
3478+
*/
3479+
public static getFeaturesByTypeExcluding(
3480+
excludedFeatures: CoinFeature[],
3481+
baseFeatures?: CoinFeature[]
3482+
): CoinFeature[] {
3483+
if (!baseFeatures) {
3484+
return [];
3485+
}
3486+
return baseFeatures.filter((feature) => !excludedFeatures.includes(feature));
3487+
}
34723488
}

modules/statics/src/utxo.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { BaseCoin, BaseUnit, CoinFeature, CoinKind, KeyCurve, UnderlyingAsset } from './base';
22
import { Networks, UtxoNetwork } from './networks';
3-
import { AccountCoin } from './account';
43

54
interface UtxoConstructorOptions {
65
id: string;
@@ -258,10 +257,7 @@ export const utxoCoins: Readonly<BaseCoin>[] = [
258257
Networks.test.bitcoinGold,
259258
UnderlyingAsset.BTG,
260259
BaseUnit.BTC,
261-
AccountCoin.getFeaturesByTypeExcluding(
262-
[CoinFeature.CUSTODY_BITGO_MENA_FZE, CoinFeature.MULTISIG_COLD],
263-
BTG_FEATURES
264-
)
260+
BaseCoin.getFeaturesByTypeExcluding([CoinFeature.CUSTODY_BITGO_MENA_FZE, CoinFeature.MULTISIG_COLD], BTG_FEATURES)
265261
),
266262
utxo(
267263
'9c8097f1-5d2c-4a62-a94c-96c271c0e5e0',

0 commit comments

Comments
 (0)