Skip to content

Commit 22e15e0

Browse files
committed
refactor: move utxo coins to utxo/coins
Ticket: BTC-1092 TICKET: BTC-1092
1 parent 1f65d48 commit 22e15e0

File tree

3 files changed

+188
-179
lines changed

3 files changed

+188
-179
lines changed

modules/statics/src/coins.ts

Lines changed: 2 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,8 @@ import {
5757
tofcStellarToken,
5858
tofcArbethErc20,
5959
} from './ofc';
60-
import { utxo, UtxoCoin } from './utxo';
60+
import { utxoCoins } from './utxo';
6161

62-
const BCH_FEATURES = [
63-
...UtxoCoin.DEFAULT_FEATURES,
64-
CoinFeature.CUSTODY_BITGO_GERMANY,
65-
CoinFeature.CUSTODY_BITGO_NEW_YORK,
66-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
67-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
68-
];
69-
const BTC_FEATURES = [
70-
...UtxoCoin.DEFAULT_FEATURES,
71-
CoinFeature.CUSTODY_BITGO_GERMANY,
72-
CoinFeature.CUSTODY_BITGO_NEW_YORK,
73-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
74-
CoinFeature.CUSTODY_BITGO_SISTER_TRUST_ONE,
75-
CoinFeature.BULK_TRANSACTION,
76-
CoinFeature.DISTRIBUTED_CUSTODY,
77-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
78-
CoinFeature.CUSTODY_BITGO_SWITZERLAND,
79-
];
80-
const BTG_FEATURES = [
81-
...UtxoCoin.DEFAULT_FEATURES,
82-
CoinFeature.CUSTODY_BITGO_GERMANY,
83-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
84-
];
8562
const ETH_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.SUPPORTS_TOKENS, CoinFeature.ENTERPRISE_PAYS_FEES];
8663
const ETH_FEATURES_WITH_MMI = [...ETH_FEATURES, CoinFeature.METAMASK_INSTITUTIONAL];
8764
const ETH_FEATURES_WITH_STAKING = [...ETH_FEATURES, CoinFeature.STAKING];
@@ -110,13 +87,6 @@ const CELO_FEATURES = [
11087
CoinFeature.MULTISIG_COLD,
11188
];
11289
const ETH2_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.SUPPORTS_TOKENS];
113-
const LTC_FEATURES = [
114-
...UtxoCoin.DEFAULT_FEATURES,
115-
CoinFeature.CUSTODY_BITGO_GERMANY,
116-
CoinFeature.CUSTODY_BITGO_NEW_YORK,
117-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
118-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
119-
];
12090
const RBTC_FEATURES = [
12191
...ETH_FEATURES,
12292
CoinFeature.MULTISIG_COLD,
@@ -176,12 +146,6 @@ const DOT_FEATURES = [
176146
CoinFeature.EXPIRING_TRANSACTIONS,
177147
CoinFeature.REBUILD_ON_CUSTODY_SIGNING,
178148
];
179-
const DOGE_FEATURES = [
180-
...UtxoCoin.DEFAULT_FEATURES,
181-
CoinFeature.CUSTODY_BITGO_GERMANY,
182-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
183-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
184-
];
185149
const EOS_FEATURES = [
186150
...AccountCoin.DEFAULT_FEATURES,
187151
CoinFeature.SUPPORTS_TOKENS,
@@ -300,148 +264,7 @@ const ZKETH_FEATURES = [
300264
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
301265
];
302266
export const coins = CoinMap.fromCoins([
303-
utxo(
304-
'8d6e08d5-399f-414f-8430-6ceca1798cbf',
305-
'bch',
306-
'Bitcoin Cash',
307-
Networks.main.bitcoinCash,
308-
UnderlyingAsset.BCH,
309-
BaseUnit.BTC,
310-
BCH_FEATURES
311-
),
312-
utxo(
313-
'aae6fafc-5091-4b10-9a11-aa6cefea2805',
314-
'tbch',
315-
'Testnet Bitcoin Cash',
316-
Networks.test.bitcoinCash,
317-
UnderlyingAsset.BCH,
318-
BaseUnit.BTC,
319-
BCH_FEATURES
320-
),
321-
utxo(
322-
'941587ce-1c7a-4305-b908-15455d15e961',
323-
'bcha',
324-
'ECash',
325-
Networks.main.eCash,
326-
UnderlyingAsset.BCHA,
327-
BaseUnit.BTC
328-
),
329-
utxo(
330-
'af8de1e0-3e33-47bf-94d3-fb3c2bebead2',
331-
'tbcha',
332-
'Testnet ECash',
333-
Networks.test.eCash,
334-
UnderlyingAsset.BCHA,
335-
BaseUnit.BTC
336-
),
337-
utxo(
338-
'f728cfc7-d0cf-4f99-bca0-d25273e65fcf',
339-
'bsv',
340-
'Bitcoin SV',
341-
Networks.main.bitcoinSV,
342-
UnderlyingAsset.BSV,
343-
BaseUnit.BTC,
344-
[CoinFeature.DEPRECATED, ...UtxoCoin.DEFAULT_FEATURES]
345-
),
346-
utxo(
347-
'7cb81518-85d7-400f-960e-7bc00b3bfa62',
348-
'tbsv',
349-
'Testnet Bitcoin SV',
350-
Networks.test.bitcoinSV,
351-
UnderlyingAsset.BSV,
352-
BaseUnit.BTC,
353-
[CoinFeature.DEPRECATED, ...UtxoCoin.DEFAULT_FEATURES]
354-
),
355-
utxo(
356-
'5c1691c5-c9cc-49ed-abe0-c433dab2edaa',
357-
'btc',
358-
'Bitcoin',
359-
Networks.main.bitcoin,
360-
UnderlyingAsset.BTC,
361-
BaseUnit.BTC,
362-
BTC_FEATURES
363-
),
364-
utxo(
365-
'cde7559d-a536-4d12-8de4-90baa09f90bd',
366-
'tbtc',
367-
'Testnet Bitcoin',
368-
Networks.test.bitcoin,
369-
UnderlyingAsset.BTC,
370-
BaseUnit.BTC,
371-
BTC_FEATURES
372-
),
373-
utxo(
374-
'8feb110d-0d68-44ce-ae97-b8c30ec870a9',
375-
'btg',
376-
'Bitcoin Gold',
377-
Networks.main.bitcoinGold,
378-
UnderlyingAsset.BTG,
379-
BaseUnit.BTC,
380-
BTG_FEATURES
381-
),
382-
utxo(
383-
'633246f2-af21-41b8-8b9e-ba9ae25d386f',
384-
'tbtg',
385-
'Testnet Bitcoin Gold',
386-
Networks.test.bitcoinGold,
387-
UnderlyingAsset.BTG,
388-
BaseUnit.BTC,
389-
BTG_FEATURES.filter((f) => f !== CoinFeature.MULTISIG_COLD)
390-
),
391-
utxo(
392-
'9c8097f1-5d2c-4a62-a94c-96c271c0e5e0',
393-
'ltc',
394-
'Litecoin',
395-
Networks.main.litecoin,
396-
UnderlyingAsset.LTC,
397-
BaseUnit.LTC,
398-
LTC_FEATURES
399-
),
400-
utxo(
401-
'1aca32c8-a3e5-42eb-82df-4c263d8bfc68',
402-
'tltc',
403-
'Testnet Litecoin',
404-
Networks.test.litecoin,
405-
UnderlyingAsset.LTC,
406-
BaseUnit.LTC,
407-
LTC_FEATURES
408-
),
409-
utxo('0739be6a-c72e-468d-9464-ca5601965708', 'dash', 'Dash', Networks.main.dash, UnderlyingAsset.DASH, BaseUnit.DASH),
410-
utxo(
411-
'5950d78f-e8dd-457a-ab5d-310e6b476bb1',
412-
'tdash',
413-
'Testnet Dash',
414-
Networks.test.dash,
415-
UnderlyingAsset.DASH,
416-
BaseUnit.DASH
417-
),
418-
utxo('508f6b53-1e6e-41fd-b541-b2498b7c4b61', 'zec', 'ZCash', Networks.main.zCash, UnderlyingAsset.ZEC, BaseUnit.ZEC),
419-
utxo(
420-
'549a4499-387c-42d3-9048-c01d6724d98a',
421-
'tzec',
422-
'Testnet ZCash',
423-
Networks.test.zCash,
424-
UnderlyingAsset.ZEC,
425-
BaseUnit.ZEC
426-
),
427-
utxo(
428-
'c93a9160-458f-4a31-bea0-4a93ae8b1d2d',
429-
'doge',
430-
'Dogecoin',
431-
Networks.main.dogecoin,
432-
UnderlyingAsset.DOGE,
433-
BaseUnit.BTC,
434-
DOGE_FEATURES
435-
),
436-
utxo(
437-
'7a1597e8-fd8e-4b68-8086-f9159e37e0ce',
438-
'tdoge',
439-
'Testnet Dogecoin',
440-
Networks.test.dogecoin,
441-
UnderlyingAsset.DOGE,
442-
BaseUnit.BTC,
443-
DOGE_FEATURES
444-
),
267+
...utxoCoins,
445268
avaxp(
446269
'5436386e-9e4d-4d82-92df-59d9720d1738',
447270
'avaxp',

modules/statics/src/utxo/coins.ts

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
import { utxo, UtxoCoin } from './utxo';
2+
import { BaseUnit, CoinFeature, UnderlyingAsset } from '../base';
3+
import { Networks } from '../networks';
4+
5+
const BCH_FEATURES = [
6+
...UtxoCoin.DEFAULT_FEATURES,
7+
CoinFeature.CUSTODY_BITGO_GERMANY,
8+
CoinFeature.CUSTODY_BITGO_NEW_YORK,
9+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
10+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
11+
];
12+
const BTC_FEATURES = [
13+
...UtxoCoin.DEFAULT_FEATURES,
14+
CoinFeature.CUSTODY_BITGO_GERMANY,
15+
CoinFeature.CUSTODY_BITGO_NEW_YORK,
16+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
17+
CoinFeature.CUSTODY_BITGO_SISTER_TRUST_ONE,
18+
CoinFeature.BULK_TRANSACTION,
19+
CoinFeature.DISTRIBUTED_CUSTODY,
20+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
21+
CoinFeature.CUSTODY_BITGO_SWITZERLAND,
22+
];
23+
const BTG_FEATURES = [
24+
...UtxoCoin.DEFAULT_FEATURES,
25+
CoinFeature.CUSTODY_BITGO_GERMANY,
26+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
27+
];
28+
const LTC_FEATURES = [
29+
...UtxoCoin.DEFAULT_FEATURES,
30+
CoinFeature.CUSTODY_BITGO_GERMANY,
31+
CoinFeature.CUSTODY_BITGO_NEW_YORK,
32+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
33+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
34+
];
35+
const DOGE_FEATURES = [
36+
...UtxoCoin.DEFAULT_FEATURES,
37+
CoinFeature.CUSTODY_BITGO_GERMANY,
38+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
39+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
40+
];
41+
42+
export const utxoCoins = [
43+
utxo(
44+
'8d6e08d5-399f-414f-8430-6ceca1798cbf',
45+
'bch',
46+
'Bitcoin Cash',
47+
Networks.main.bitcoinCash,
48+
UnderlyingAsset.BCH,
49+
BaseUnit.BTC,
50+
BCH_FEATURES
51+
),
52+
utxo(
53+
'aae6fafc-5091-4b10-9a11-aa6cefea2805',
54+
'tbch',
55+
'Testnet Bitcoin Cash',
56+
Networks.test.bitcoinCash,
57+
UnderlyingAsset.BCH,
58+
BaseUnit.BTC,
59+
BCH_FEATURES
60+
),
61+
utxo(
62+
'941587ce-1c7a-4305-b908-15455d15e961',
63+
'bcha',
64+
'ECash',
65+
Networks.main.eCash,
66+
UnderlyingAsset.BCHA,
67+
BaseUnit.BTC
68+
),
69+
utxo(
70+
'af8de1e0-3e33-47bf-94d3-fb3c2bebead2',
71+
'tbcha',
72+
'Testnet ECash',
73+
Networks.test.eCash,
74+
UnderlyingAsset.BCHA,
75+
BaseUnit.BTC
76+
),
77+
utxo(
78+
'f728cfc7-d0cf-4f99-bca0-d25273e65fcf',
79+
'bsv',
80+
'Bitcoin SV',
81+
Networks.main.bitcoinSV,
82+
UnderlyingAsset.BSV,
83+
BaseUnit.BTC,
84+
[CoinFeature.DEPRECATED, ...UtxoCoin.DEFAULT_FEATURES]
85+
),
86+
utxo(
87+
'7cb81518-85d7-400f-960e-7bc00b3bfa62',
88+
'tbsv',
89+
'Testnet Bitcoin SV',
90+
Networks.test.bitcoinSV,
91+
UnderlyingAsset.BSV,
92+
BaseUnit.BTC,
93+
[CoinFeature.DEPRECATED, ...UtxoCoin.DEFAULT_FEATURES]
94+
),
95+
utxo(
96+
'5c1691c5-c9cc-49ed-abe0-c433dab2edaa',
97+
'btc',
98+
'Bitcoin',
99+
Networks.main.bitcoin,
100+
UnderlyingAsset.BTC,
101+
BaseUnit.BTC,
102+
BTC_FEATURES
103+
),
104+
utxo(
105+
'cde7559d-a536-4d12-8de4-90baa09f90bd',
106+
'tbtc',
107+
'Testnet Bitcoin',
108+
Networks.test.bitcoin,
109+
UnderlyingAsset.BTC,
110+
BaseUnit.BTC,
111+
BTC_FEATURES
112+
),
113+
utxo(
114+
'8feb110d-0d68-44ce-ae97-b8c30ec870a9',
115+
'btg',
116+
'Bitcoin Gold',
117+
Networks.main.bitcoinGold,
118+
UnderlyingAsset.BTG,
119+
BaseUnit.BTC,
120+
BTG_FEATURES
121+
),
122+
utxo(
123+
'633246f2-af21-41b8-8b9e-ba9ae25d386f',
124+
'tbtg',
125+
'Testnet Bitcoin Gold',
126+
Networks.test.bitcoinGold,
127+
UnderlyingAsset.BTG,
128+
BaseUnit.BTC,
129+
BTG_FEATURES.filter((f) => f !== CoinFeature.MULTISIG_COLD)
130+
),
131+
utxo(
132+
'9c8097f1-5d2c-4a62-a94c-96c271c0e5e0',
133+
'ltc',
134+
'Litecoin',
135+
Networks.main.litecoin,
136+
UnderlyingAsset.LTC,
137+
BaseUnit.LTC,
138+
LTC_FEATURES
139+
),
140+
utxo(
141+
'1aca32c8-a3e5-42eb-82df-4c263d8bfc68',
142+
'tltc',
143+
'Testnet Litecoin',
144+
Networks.test.litecoin,
145+
UnderlyingAsset.LTC,
146+
BaseUnit.LTC,
147+
LTC_FEATURES
148+
),
149+
utxo('0739be6a-c72e-468d-9464-ca5601965708', 'dash', 'Dash', Networks.main.dash, UnderlyingAsset.DASH, BaseUnit.DASH),
150+
utxo(
151+
'5950d78f-e8dd-457a-ab5d-310e6b476bb1',
152+
'tdash',
153+
'Testnet Dash',
154+
Networks.test.dash,
155+
UnderlyingAsset.DASH,
156+
BaseUnit.DASH
157+
),
158+
utxo('508f6b53-1e6e-41fd-b541-b2498b7c4b61', 'zec', 'ZCash', Networks.main.zCash, UnderlyingAsset.ZEC, BaseUnit.ZEC),
159+
utxo(
160+
'549a4499-387c-42d3-9048-c01d6724d98a',
161+
'tzec',
162+
'Testnet ZCash',
163+
Networks.test.zCash,
164+
UnderlyingAsset.ZEC,
165+
BaseUnit.ZEC
166+
),
167+
utxo(
168+
'c93a9160-458f-4a31-bea0-4a93ae8b1d2d',
169+
'doge',
170+
'Dogecoin',
171+
Networks.main.dogecoin,
172+
UnderlyingAsset.DOGE,
173+
BaseUnit.BTC,
174+
DOGE_FEATURES
175+
),
176+
utxo(
177+
'7a1597e8-fd8e-4b68-8086-f9159e37e0ce',
178+
'tdoge',
179+
'Testnet Dogecoin',
180+
Networks.test.dogecoin,
181+
UnderlyingAsset.DOGE,
182+
BaseUnit.BTC,
183+
DOGE_FEATURES
184+
),
185+
];

modules/statics/src/utxo/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './utxo';
2+
export * from './coins';

0 commit comments

Comments
 (0)