Skip to content

Commit 4d8c862

Browse files
Merge pull request #8152 from BitGo/coin-onboard/etherlink
feat: add Etherlink EVM chain support
2 parents 61b25b3 + a3c9701 commit 4d8c862

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
},
@@ -473,6 +476,9 @@ const testnetBase: EnvironmentTemplate = {
473476
baseUrl: 'https://api.etherscan.io/v2',
474477
apiToken: process.env.ETHERSCAN_API_TOKEN,
475478
},
479+
xtzevm: {
480+
baseUrl: 'https://shadownet.explorer.etherlink.com/api',
481+
},
476482
flow: {
477483
baseUrl: 'https://evm-testnet.flowscan.io',
478484
},

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',
@@ -122,6 +122,7 @@ export enum CoinFamily {
122122
XLM = 'xlm',
123123
XRP = 'xrp',
124124
XTZ = 'xtz',
125+
XTZEVM = 'xtzevm', // Etherlink (XTZ EVM L2)
125126
ZEC = 'zec',
126127
ZETA = 'zeta',
127128
ZKETH = 'zketh',
@@ -578,12 +579,12 @@ export enum UnderlyingAsset {
578579
COREUM = 'coreum',
579580
CRONOS = 'cronos',
580581
CSPR = 'cspr',
582+
EOS = 'eos',
583+
ERD = 'erd',
584+
ETC = 'etc',
581585
ETH = 'eth',
582586
ETH2 = 'eth2',
583587
ETHW = 'ethw',
584-
ETC = 'etc',
585-
EOS = 'eos',
586-
ERD = 'erd',
587588
EURCVV0 = 'eurcvv0',
588589
EURCV = 'eurcv',
589590
EUROC = 'euroc',
@@ -650,10 +651,11 @@ export enum UnderlyingAsset {
650651
VET = 'vet',
651652
WEMIX = 'wemix',
652653
WORLD = 'world',
653-
XLM = 'xlm',
654654
XDC = 'xdc',
655+
XLM = 'xlm',
655656
XRP = 'xrp',
656657
XTZ = 'xtz',
658+
XTZEVM = 'xtzevm', // Etherlink (XTZ EVM L2)
657659
ZEC = 'zec',
658660
ZETA = 'zeta',
659661
ZKETH = 'zketh',

modules/statics/src/coins/ofcCoins.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,15 @@ export const ofcCoins = [
218218
UnderlyingAsset.HYPEEVM,
219219
CoinKind.CRYPTO
220220
),
221+
ofc('dc825481-0a15-44ab-84e6-6f182b13eb87', 'ofcxtzevm', 'XTZ EVM', 18, UnderlyingAsset.XTZEVM, CoinKind.CRYPTO),
222+
tofc(
223+
'0e42884b-c01e-461b-b108-1ed0d0fbbd7b',
224+
'ofctxtzevm',
225+
'XTZ EVM Testnet',
226+
18,
227+
UnderlyingAsset.XTZEVM,
228+
CoinKind.CRYPTO
229+
),
221230
tofc(
222231
'3eb80dc2-98bc-40ee-a27c-b4572e0d7270',
223232
'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;
@@ -2558,6 +2576,7 @@ export const Networks = {
25582576
xpl: Object.freeze(new Plasma()),
25592577
xrp: Object.freeze(new Xrp()),
25602578
xtz: Object.freeze(new Xtz()),
2579+
xtzevm: Object.freeze(new XtzEvm()),
25612580
zCash: Object.freeze(new ZCash()),
25622581
zeta: Object.freeze(new Zeta()),
25632582
zkSync: Object.freeze(new ZkSync()),
@@ -2678,6 +2697,7 @@ export const Networks = {
26782697
xpl: Object.freeze(new PlasmaTestnet()),
26792698
xrp: Object.freeze(new XrpTestnet()),
26802699
xtz: Object.freeze(new XtzTestnet()),
2700+
xtzevm: Object.freeze(new XtzEvmTestnet()),
26812701
zCash: Object.freeze(new ZCashTestnet()),
26822702
zeta: Object.freeze(new ZetaTestnet()),
26832703
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',
@@ -161,6 +162,7 @@ export const expectedColdFeatures = {
161162
'tdogeos',
162163
'tdot',
163164
'tdydxcosmos',
165+
'txtzevm',
164166
'tfetchai',
165167
'tflow',
166168
'tfluenteth',

0 commit comments

Comments
 (0)