Skip to content

Commit

Permalink
refactor: move utxo coins to utxo/coins
Browse files Browse the repository at this point in the history
Ticket: BTC-1092

TICKET: BTC-1092
  • Loading branch information
lcovar committed Apr 16, 2024
1 parent 1f65d48 commit 22e15e0
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 179 deletions.
181 changes: 2 additions & 179 deletions modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,8 @@ import {
tofcStellarToken,
tofcArbethErc20,
} from './ofc';
import { utxo, UtxoCoin } from './utxo';
import { utxoCoins } from './utxo';

const BCH_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_NEW_YORK,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
];
const BTC_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_NEW_YORK,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SISTER_TRUST_ONE,
CoinFeature.BULK_TRANSACTION,
CoinFeature.DISTRIBUTED_CUSTODY,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
CoinFeature.CUSTODY_BITGO_SWITZERLAND,
];
const BTG_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
];
const ETH_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.SUPPORTS_TOKENS, CoinFeature.ENTERPRISE_PAYS_FEES];
const ETH_FEATURES_WITH_MMI = [...ETH_FEATURES, CoinFeature.METAMASK_INSTITUTIONAL];
const ETH_FEATURES_WITH_STAKING = [...ETH_FEATURES, CoinFeature.STAKING];
Expand Down Expand Up @@ -110,13 +87,6 @@ const CELO_FEATURES = [
CoinFeature.MULTISIG_COLD,
];
const ETH2_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.SUPPORTS_TOKENS];
const LTC_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_NEW_YORK,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
];
const RBTC_FEATURES = [
...ETH_FEATURES,
CoinFeature.MULTISIG_COLD,
Expand Down Expand Up @@ -176,12 +146,6 @@ const DOT_FEATURES = [
CoinFeature.EXPIRING_TRANSACTIONS,
CoinFeature.REBUILD_ON_CUSTODY_SIGNING,
];
const DOGE_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
];
const EOS_FEATURES = [
...AccountCoin.DEFAULT_FEATURES,
CoinFeature.SUPPORTS_TOKENS,
Expand Down Expand Up @@ -300,148 +264,7 @@ const ZKETH_FEATURES = [
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
];
export const coins = CoinMap.fromCoins([
utxo(
'8d6e08d5-399f-414f-8430-6ceca1798cbf',
'bch',
'Bitcoin Cash',
Networks.main.bitcoinCash,
UnderlyingAsset.BCH,
BaseUnit.BTC,
BCH_FEATURES
),
utxo(
'aae6fafc-5091-4b10-9a11-aa6cefea2805',
'tbch',
'Testnet Bitcoin Cash',
Networks.test.bitcoinCash,
UnderlyingAsset.BCH,
BaseUnit.BTC,
BCH_FEATURES
),
utxo(
'941587ce-1c7a-4305-b908-15455d15e961',
'bcha',
'ECash',
Networks.main.eCash,
UnderlyingAsset.BCHA,
BaseUnit.BTC
),
utxo(
'af8de1e0-3e33-47bf-94d3-fb3c2bebead2',
'tbcha',
'Testnet ECash',
Networks.test.eCash,
UnderlyingAsset.BCHA,
BaseUnit.BTC
),
utxo(
'f728cfc7-d0cf-4f99-bca0-d25273e65fcf',
'bsv',
'Bitcoin SV',
Networks.main.bitcoinSV,
UnderlyingAsset.BSV,
BaseUnit.BTC,
[CoinFeature.DEPRECATED, ...UtxoCoin.DEFAULT_FEATURES]
),
utxo(
'7cb81518-85d7-400f-960e-7bc00b3bfa62',
'tbsv',
'Testnet Bitcoin SV',
Networks.test.bitcoinSV,
UnderlyingAsset.BSV,
BaseUnit.BTC,
[CoinFeature.DEPRECATED, ...UtxoCoin.DEFAULT_FEATURES]
),
utxo(
'5c1691c5-c9cc-49ed-abe0-c433dab2edaa',
'btc',
'Bitcoin',
Networks.main.bitcoin,
UnderlyingAsset.BTC,
BaseUnit.BTC,
BTC_FEATURES
),
utxo(
'cde7559d-a536-4d12-8de4-90baa09f90bd',
'tbtc',
'Testnet Bitcoin',
Networks.test.bitcoin,
UnderlyingAsset.BTC,
BaseUnit.BTC,
BTC_FEATURES
),
utxo(
'8feb110d-0d68-44ce-ae97-b8c30ec870a9',
'btg',
'Bitcoin Gold',
Networks.main.bitcoinGold,
UnderlyingAsset.BTG,
BaseUnit.BTC,
BTG_FEATURES
),
utxo(
'633246f2-af21-41b8-8b9e-ba9ae25d386f',
'tbtg',
'Testnet Bitcoin Gold',
Networks.test.bitcoinGold,
UnderlyingAsset.BTG,
BaseUnit.BTC,
BTG_FEATURES.filter((f) => f !== CoinFeature.MULTISIG_COLD)
),
utxo(
'9c8097f1-5d2c-4a62-a94c-96c271c0e5e0',
'ltc',
'Litecoin',
Networks.main.litecoin,
UnderlyingAsset.LTC,
BaseUnit.LTC,
LTC_FEATURES
),
utxo(
'1aca32c8-a3e5-42eb-82df-4c263d8bfc68',
'tltc',
'Testnet Litecoin',
Networks.test.litecoin,
UnderlyingAsset.LTC,
BaseUnit.LTC,
LTC_FEATURES
),
utxo('0739be6a-c72e-468d-9464-ca5601965708', 'dash', 'Dash', Networks.main.dash, UnderlyingAsset.DASH, BaseUnit.DASH),
utxo(
'5950d78f-e8dd-457a-ab5d-310e6b476bb1',
'tdash',
'Testnet Dash',
Networks.test.dash,
UnderlyingAsset.DASH,
BaseUnit.DASH
),
utxo('508f6b53-1e6e-41fd-b541-b2498b7c4b61', 'zec', 'ZCash', Networks.main.zCash, UnderlyingAsset.ZEC, BaseUnit.ZEC),
utxo(
'549a4499-387c-42d3-9048-c01d6724d98a',
'tzec',
'Testnet ZCash',
Networks.test.zCash,
UnderlyingAsset.ZEC,
BaseUnit.ZEC
),
utxo(
'c93a9160-458f-4a31-bea0-4a93ae8b1d2d',
'doge',
'Dogecoin',
Networks.main.dogecoin,
UnderlyingAsset.DOGE,
BaseUnit.BTC,
DOGE_FEATURES
),
utxo(
'7a1597e8-fd8e-4b68-8086-f9159e37e0ce',
'tdoge',
'Testnet Dogecoin',
Networks.test.dogecoin,
UnderlyingAsset.DOGE,
BaseUnit.BTC,
DOGE_FEATURES
),
...utxoCoins,
avaxp(
'5436386e-9e4d-4d82-92df-59d9720d1738',
'avaxp',
Expand Down
185 changes: 185 additions & 0 deletions modules/statics/src/utxo/coins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
import { utxo, UtxoCoin } from './utxo';
import { BaseUnit, CoinFeature, UnderlyingAsset } from '../base';
import { Networks } from '../networks';

const BCH_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_NEW_YORK,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
];
const BTC_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_NEW_YORK,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SISTER_TRUST_ONE,
CoinFeature.BULK_TRANSACTION,
CoinFeature.DISTRIBUTED_CUSTODY,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
CoinFeature.CUSTODY_BITGO_SWITZERLAND,
];
const BTG_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
];
const LTC_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_NEW_YORK,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
];
const DOGE_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
];

export const utxoCoins = [
utxo(
'8d6e08d5-399f-414f-8430-6ceca1798cbf',
'bch',
'Bitcoin Cash',
Networks.main.bitcoinCash,
UnderlyingAsset.BCH,
BaseUnit.BTC,
BCH_FEATURES
),
utxo(
'aae6fafc-5091-4b10-9a11-aa6cefea2805',
'tbch',
'Testnet Bitcoin Cash',
Networks.test.bitcoinCash,
UnderlyingAsset.BCH,
BaseUnit.BTC,
BCH_FEATURES
),
utxo(
'941587ce-1c7a-4305-b908-15455d15e961',
'bcha',
'ECash',
Networks.main.eCash,
UnderlyingAsset.BCHA,
BaseUnit.BTC
),
utxo(
'af8de1e0-3e33-47bf-94d3-fb3c2bebead2',
'tbcha',
'Testnet ECash',
Networks.test.eCash,
UnderlyingAsset.BCHA,
BaseUnit.BTC
),
utxo(
'f728cfc7-d0cf-4f99-bca0-d25273e65fcf',
'bsv',
'Bitcoin SV',
Networks.main.bitcoinSV,
UnderlyingAsset.BSV,
BaseUnit.BTC,
[CoinFeature.DEPRECATED, ...UtxoCoin.DEFAULT_FEATURES]
),
utxo(
'7cb81518-85d7-400f-960e-7bc00b3bfa62',
'tbsv',
'Testnet Bitcoin SV',
Networks.test.bitcoinSV,
UnderlyingAsset.BSV,
BaseUnit.BTC,
[CoinFeature.DEPRECATED, ...UtxoCoin.DEFAULT_FEATURES]
),
utxo(
'5c1691c5-c9cc-49ed-abe0-c433dab2edaa',
'btc',
'Bitcoin',
Networks.main.bitcoin,
UnderlyingAsset.BTC,
BaseUnit.BTC,
BTC_FEATURES
),
utxo(
'cde7559d-a536-4d12-8de4-90baa09f90bd',
'tbtc',
'Testnet Bitcoin',
Networks.test.bitcoin,
UnderlyingAsset.BTC,
BaseUnit.BTC,
BTC_FEATURES
),
utxo(
'8feb110d-0d68-44ce-ae97-b8c30ec870a9',
'btg',
'Bitcoin Gold',
Networks.main.bitcoinGold,
UnderlyingAsset.BTG,
BaseUnit.BTC,
BTG_FEATURES
),
utxo(
'633246f2-af21-41b8-8b9e-ba9ae25d386f',
'tbtg',
'Testnet Bitcoin Gold',
Networks.test.bitcoinGold,
UnderlyingAsset.BTG,
BaseUnit.BTC,
BTG_FEATURES.filter((f) => f !== CoinFeature.MULTISIG_COLD)
),
utxo(
'9c8097f1-5d2c-4a62-a94c-96c271c0e5e0',
'ltc',
'Litecoin',
Networks.main.litecoin,
UnderlyingAsset.LTC,
BaseUnit.LTC,
LTC_FEATURES
),
utxo(
'1aca32c8-a3e5-42eb-82df-4c263d8bfc68',
'tltc',
'Testnet Litecoin',
Networks.test.litecoin,
UnderlyingAsset.LTC,
BaseUnit.LTC,
LTC_FEATURES
),
utxo('0739be6a-c72e-468d-9464-ca5601965708', 'dash', 'Dash', Networks.main.dash, UnderlyingAsset.DASH, BaseUnit.DASH),
utxo(
'5950d78f-e8dd-457a-ab5d-310e6b476bb1',
'tdash',
'Testnet Dash',
Networks.test.dash,
UnderlyingAsset.DASH,
BaseUnit.DASH
),
utxo('508f6b53-1e6e-41fd-b541-b2498b7c4b61', 'zec', 'ZCash', Networks.main.zCash, UnderlyingAsset.ZEC, BaseUnit.ZEC),
utxo(
'549a4499-387c-42d3-9048-c01d6724d98a',
'tzec',
'Testnet ZCash',
Networks.test.zCash,
UnderlyingAsset.ZEC,
BaseUnit.ZEC
),
utxo(
'c93a9160-458f-4a31-bea0-4a93ae8b1d2d',
'doge',
'Dogecoin',
Networks.main.dogecoin,
UnderlyingAsset.DOGE,
BaseUnit.BTC,
DOGE_FEATURES
),
utxo(
'7a1597e8-fd8e-4b68-8086-f9159e37e0ce',
'tdoge',
'Testnet Dogecoin',
Networks.test.dogecoin,
UnderlyingAsset.DOGE,
BaseUnit.BTC,
DOGE_FEATURES
),
];
1 change: 1 addition & 0 deletions modules/statics/src/utxo/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './utxo';
export * from './coins';

0 comments on commit 22e15e0

Please sign in to comment.