Skip to content

Commit a3c9701

Browse files
committed
feat(statics): add XTZ EVM (Etherlink) chain support
CECHO-117
1 parent d55d5cb commit a3c9701

6 files changed

Lines changed: 81 additions & 6 deletions

File tree

modules/sdk-core/src/bitgo/environments.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ const mainnetBase: EnvironmentTemplate = {
283283
baseUrl: 'https://explorer.fantom.network',
284284
rpcUrl: 'https://rpcapi.fantom.network/',
285285
},
286+
xtzevm: {
287+
baseUrl: 'https://explorer.etherlink.com/api',
288+
},
286289
flow: {
287290
baseUrl: 'https://evm.flowscan.io',
288291
},
@@ -470,6 +473,9 @@ const testnetBase: EnvironmentTemplate = {
470473
baseUrl: 'https://api.etherscan.io/v2',
471474
apiToken: process.env.ETHERSCAN_API_TOKEN,
472475
},
476+
xtzevm: {
477+
baseUrl: 'https://shadownet.explorer.etherlink.com/api',
478+
},
473479
flow: {
474480
baseUrl: 'https://evm-testnet.flowscan.io',
475481
},

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,42 @@ export const allCoinsAndTokens = [
393393
BaseUnit.ETH,
394394
[...AccountCoin.DEFAULT_FEATURES]
395395
),
396+
account(
397+
'260a8571-1f89-40ad-af8d-c58a391581b5',
398+
'xtzevm',
399+
'XTZ EVM',
400+
Networks.main.xtzevm,
401+
18,
402+
UnderlyingAsset.XTZEVM,
403+
BaseUnit.ETH,
404+
[
405+
...EVM_FEATURES,
406+
CoinFeature.SHARED_EVM_SIGNING,
407+
CoinFeature.SHARED_EVM_SDK,
408+
CoinFeature.EVM_COMPATIBLE_IMS,
409+
CoinFeature.EVM_COMPATIBLE_UI,
410+
CoinFeature.EVM_COMPATIBLE_WP,
411+
CoinFeature.SUPPORTS_ERC20,
412+
]
413+
),
414+
account(
415+
'e7fdbd6f-93ff-4dda-8a57-81580827188e',
416+
'txtzevm',
417+
'Testnet XTZ EVM',
418+
Networks.test.xtzevm,
419+
18,
420+
UnderlyingAsset.XTZEVM,
421+
BaseUnit.ETH,
422+
[
423+
...EVM_FEATURES,
424+
CoinFeature.SHARED_EVM_SIGNING,
425+
CoinFeature.SHARED_EVM_SDK,
426+
CoinFeature.EVM_COMPATIBLE_IMS,
427+
CoinFeature.EVM_COMPATIBLE_UI,
428+
CoinFeature.EVM_COMPATIBLE_WP,
429+
CoinFeature.SUPPORTS_ERC20,
430+
]
431+
),
396432
account(
397433
'2660f6f6-1980-4584-a0b3-487d4a832b9f',
398434
'tbaseeth',

modules/statics/src/base.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ export enum CoinFamily {
5252
DOGEOS = 'dogeos',
5353
DOT = 'dot',
5454
DYDX = 'dydx',
55+
EOS = 'eos',
56+
ETC = 'etc',
5557
ETH = 'eth',
5658
ETH2 = 'eth2',
5759
ETHW = 'ethw',
58-
ETC = 'etc',
59-
EOS = 'eos',
6060
FETCHAI = 'fetchai',
6161
FIAT = 'fiat',
6262
FLOW = 'flow',
@@ -121,6 +121,7 @@ export enum CoinFamily {
121121
XLM = 'xlm',
122122
XRP = 'xrp',
123123
XTZ = 'xtz',
124+
XTZEVM = 'xtzevm', // Etherlink (XTZ EVM L2)
124125
ZEC = 'zec',
125126
ZETA = 'zeta',
126127
ZKETH = 'zketh',
@@ -577,12 +578,12 @@ export enum UnderlyingAsset {
577578
COREUM = 'coreum',
578579
CRONOS = 'cronos',
579580
CSPR = 'cspr',
581+
EOS = 'eos',
582+
ERD = 'erd',
583+
ETC = 'etc',
580584
ETH = 'eth',
581585
ETH2 = 'eth2',
582586
ETHW = 'ethw',
583-
ETC = 'etc',
584-
EOS = 'eos',
585-
ERD = 'erd',
586587
EURCVV0 = 'eurcvv0',
587588
EURCV = 'eurcv',
588589
EUROC = 'euroc',
@@ -648,10 +649,11 @@ export enum UnderlyingAsset {
648649
VET = 'vet',
649650
WEMIX = 'wemix',
650651
WORLD = 'world',
651-
XLM = 'xlm',
652652
XDC = 'xdc',
653+
XLM = 'xlm',
653654
XRP = 'xrp',
654655
XTZ = 'xtz',
656+
XTZEVM = 'xtzevm', // Etherlink (XTZ EVM L2)
655657
ZEC = 'zec',
656658
ZETA = 'zeta',
657659
ZKETH = 'zketh',

modules/statics/src/coins/ofcCoins.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,15 @@ export const ofcCoins = [
211211
UnderlyingAsset.HYPEEVM,
212212
CoinKind.CRYPTO
213213
),
214+
ofc('dc825481-0a15-44ab-84e6-6f182b13eb87', 'ofcxtzevm', 'XTZ EVM', 18, UnderlyingAsset.XTZEVM, CoinKind.CRYPTO),
215+
tofc(
216+
'0e42884b-c01e-461b-b108-1ed0d0fbbd7b',
217+
'ofctxtzevm',
218+
'XTZ EVM Testnet',
219+
18,
220+
UnderlyingAsset.XTZEVM,
221+
CoinKind.CRYPTO
222+
),
214223
tofc(
215224
'3eb80dc2-98bc-40ee-a27c-b4572e0d7270',
216225
'ofcthypeevm',

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,24 @@ class EthereumW extends Mainnet implements EthereumNetwork {
713713
tokenOperationHashPrefix = 'ERC20';
714714
}
715715

716+
class XtzEvm extends Mainnet implements EthereumNetwork {
717+
name = 'XTZ EVM';
718+
family = CoinFamily.XTZEVM;
719+
explorerUrl = 'https://explorer.etherlink.com/tx/';
720+
accountExplorerUrl = 'https://explorer.etherlink.com/address/';
721+
chainId = 42793;
722+
nativeCoinOperationHashPrefix = '42793';
723+
}
724+
725+
class XtzEvmTestnet extends Testnet implements EthereumNetwork {
726+
name = 'Testnet XTZ EVM';
727+
family = CoinFamily.XTZEVM;
728+
explorerUrl = 'https://shadownet.explorer.etherlink.com/tx/';
729+
accountExplorerUrl = 'https://shadownet.explorer.etherlink.com/address/';
730+
chainId = 128123;
731+
nativeCoinOperationHashPrefix = '128123';
732+
}
733+
716734
class Pyrmont extends Testnet implements AccountNetwork {
717735
name = 'Pyrmont';
718736
family = CoinFamily.ETH2;
@@ -2539,6 +2557,7 @@ export const Networks = {
25392557
xpl: Object.freeze(new Plasma()),
25402558
xrp: Object.freeze(new Xrp()),
25412559
xtz: Object.freeze(new Xtz()),
2560+
xtzevm: Object.freeze(new XtzEvm()),
25422561
zCash: Object.freeze(new ZCash()),
25432562
zeta: Object.freeze(new Zeta()),
25442563
zkSync: Object.freeze(new ZkSync()),
@@ -2658,6 +2677,7 @@ export const Networks = {
26582677
xpl: Object.freeze(new PlasmaTestnet()),
26592678
xrp: Object.freeze(new XrpTestnet()),
26602679
xtz: Object.freeze(new XtzTestnet()),
2680+
xtzevm: Object.freeze(new XtzEvmTestnet()),
26612681
zCash: Object.freeze(new ZCashTestnet()),
26622682
zeta: Object.freeze(new ZetaTestnet()),
26632683
zkSync: Object.freeze(new ZkSyncTestnet()),

modules/statics/test/unit/fixtures/expectedColdFeatures.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const expectedColdFeatures = {
9191
'dogeos',
9292
'dot',
9393
'dydxcosmos',
94+
'xtzevm',
9495
'fetchai',
9596
'flow',
9697
'fluenteth',
@@ -160,6 +161,7 @@ export const expectedColdFeatures = {
160161
'tdogeos',
161162
'tdot',
162163
'tdydxcosmos',
164+
'txtzevm',
163165
'tfetchai',
164166
'tflow',
165167
'tfluenteth',

0 commit comments

Comments
 (0)