diff --git a/modules/statics/src/coins.ts b/modules/statics/src/coins.ts index b6d859c28b..447d84ce14 100644 --- a/modules/statics/src/coins.ts +++ b/modules/statics/src/coins.ts @@ -57,8 +57,31 @@ import { tofcStellarToken, tofcArbethErc20, } from './ofc'; -import { utxoCoins } from './utxo'; +import { utxo, UtxoCoin } from './utxo/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]; @@ -87,6 +110,13 @@ 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, @@ -146,6 +176,12 @@ 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, @@ -264,7 +300,148 @@ const ZKETH_FEATURES = [ CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA, ]; export const coins = CoinMap.fromCoins([ - ...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 + ), avaxp( '5436386e-9e4d-4d82-92df-59d9720d1738', 'avaxp', diff --git a/modules/statics/src/index.ts b/modules/statics/src/index.ts index 12f19ee0be..75354e3bb8 100644 --- a/modules/statics/src/index.ts +++ b/modules/statics/src/index.ts @@ -4,7 +4,7 @@ export * from './networks'; export * from './errors'; export * from './tokenConfig'; export { OfcCoin } from './ofc'; -export { UtxoCoin } from './utxo'; +export { UtxoCoin } from './utxo/utxo'; export { AccountCoin, CeloCoin, diff --git a/modules/statics/src/utxo/coins.ts b/modules/statics/src/utxo/coins.ts deleted file mode 100644 index f3edc51bb7..0000000000 --- a/modules/statics/src/utxo/coins.ts +++ /dev/null @@ -1,185 +0,0 @@ -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 - ), -]; diff --git a/modules/statics/src/utxo/index.ts b/modules/statics/src/utxo/index.ts deleted file mode 100644 index 265cfc089d..0000000000 --- a/modules/statics/src/utxo/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './utxo'; -export * from './coins'; diff --git a/modules/statics/test/unit/coins.ts b/modules/statics/test/unit/coins.ts index 0a3f6b5da7..ac2e4c7068 100644 --- a/modules/statics/test/unit/coins.ts +++ b/modules/statics/test/unit/coins.ts @@ -13,7 +13,7 @@ import { UnderlyingAsset, UtxoCoin, } from '../../src'; -import { utxo } from '../../src/utxo'; +import { utxo } from '../../src/utxo/utxo'; import { expectedColdFeatures } from './fixtures/expectedColdFeatures'; interface DuplicateCoinObject {