Skip to content

Commit 97daeac

Browse files
feat: add xlayer chain config
TICKET: COIN-6593
1 parent d2b84fc commit 97daeac

File tree

6 files changed

+65
-0
lines changed

6 files changed

+65
-0
lines changed

modules/bitgo/test/v2/unit/keychains.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ describe('V2 Keychains', function () {
102102
n.asset !== UnderlyingAsset.FLUENTETH &&
103103
n.asset !== UnderlyingAsset.MANTLE &&
104104
n.asset !== UnderlyingAsset.JOVAYETH &&
105+
n.asset !== UnderlyingAsset.OKB &&
105106
coinFamilyValues.includes(n.name)
106107
);
107108

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
jovayeth: {
284284
baseUrl: 'https://api.zan.top/node/v1/jovay/mainnet/',
285285
},
286+
okb: {
287+
baseUrl: 'https://www.oklink.com/api/v5/explorer/block/block-list?chainShortName=xlayer',
288+
},
286289
},
287290
icpNodeUrl: 'https://ic0.app',
288291
worldExplorerBaseUrl: 'https://worldscan.org/',
@@ -433,6 +436,9 @@ const testnetBase: EnvironmentTemplate = {
433436
jovayeth: {
434437
baseUrl: 'https://api.zan.top/node/v1/jovay/testnet/',
435438
},
439+
okb: {
440+
baseUrl: 'https://www.oklink.com/api/v5/explorer/block/block-list?chainShortName=xlayer_testnet',
441+
},
436442
},
437443
stxNodeUrl: 'https://api.testnet.hiro.so',
438444
vetNodeUrl: 'https://sync-testnet.vechain.org',

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,40 @@ export const allCoinsAndTokens = [
22782278
'',
22792279
'TJovayETH'
22802280
),
2281+
account(
2282+
'2c59a9f2-9bb0-42ff-b925-6049476b93a0',
2283+
'okb',
2284+
'X Layer',
2285+
Networks.main.okb,
2286+
18,
2287+
UnderlyingAsset.OKB,
2288+
BaseUnit.ETH,
2289+
[
2290+
...EVM_FEATURES,
2291+
CoinFeature.SHARED_EVM_SIGNING,
2292+
CoinFeature.SHARED_EVM_SDK,
2293+
CoinFeature.EVM_COMPATIBLE_IMS,
2294+
CoinFeature.EVM_COMPATIBLE_UI,
2295+
CoinFeature.EVM_COMPATIBLE_WP,
2296+
]
2297+
),
2298+
account(
2299+
'6f29e239-1bcd-4d29-b638-e17b5efc3f6c',
2300+
'tokb',
2301+
'Testnet X Layer',
2302+
Networks.test.okb,
2303+
18,
2304+
UnderlyingAsset.OKB,
2305+
BaseUnit.ETH,
2306+
[
2307+
...EVM_FEATURES,
2308+
CoinFeature.SHARED_EVM_SIGNING,
2309+
CoinFeature.SHARED_EVM_SDK,
2310+
CoinFeature.EVM_COMPATIBLE_IMS,
2311+
CoinFeature.EVM_COMPATIBLE_UI,
2312+
CoinFeature.EVM_COMPATIBLE_WP,
2313+
]
2314+
),
22812315
canton(
22822316
'07385320-5a4f-48e9-97a5-86d4be9f24b0',
22832317
'canton',

modules/statics/src/base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export enum CoinFamily {
8787
OAS = 'oas',
8888
OFC = 'ofc',
8989
OG = 'og',
90+
OKB = 'okb',
9091
OPETH = 'opeth',
9192
OSMO = 'osmo',
9293
PLUME = 'plume',
@@ -583,6 +584,7 @@ export enum UnderlyingAsset {
583584
NEAR = 'near',
584585
OAS = 'oas',
585586
OG = 'og',
587+
OKB = 'okb',
586588
OPETH = 'opeth',
587589
OSMO = 'osmo',
588590
XPL = 'xpl', // Plasma Network

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,24 @@ class JovayETHTestnet extends Testnet implements EthereumNetwork {
15451545
nativeCoinOperationHashPrefix = '2019775';
15461546
}
15471547

1548+
class Xlayer extends Mainnet implements EthereumNetwork {
1549+
name = 'X Layer';
1550+
family = CoinFamily.OKB;
1551+
explorerUrl = 'https://www.oklink.com/x-layer/tx/';
1552+
accountExplorerUrl = 'https://www.oklink.com/x-layer/address/';
1553+
chainId = 196;
1554+
nativeCoinOperationHashPrefix = '196';
1555+
}
1556+
1557+
class XlayerTestnet extends Testnet implements EthereumNetwork {
1558+
name = 'Testnet X Layer';
1559+
family = CoinFamily.OKB;
1560+
explorerUrl = 'https://www.oklink.com/x-layer-testnet/tx/';
1561+
accountExplorerUrl = 'https://www.oklink.com/x-layer-testnet/address/';
1562+
chainId = 195;
1563+
nativeCoinOperationHashPrefix = '195';
1564+
}
1565+
15481566
class CreditcoinTestnet extends Testnet implements EthereumNetwork {
15491567
name = 'CreditcoinTestnet';
15501568
family = CoinFamily.CTC;
@@ -2160,6 +2178,7 @@ export const Networks = {
21602178
oas: Object.freeze(new Oas()),
21612179
og: Object.freeze(new Og()),
21622180
ofc: Object.freeze(new Ofc()),
2181+
okb: Object.freeze(new Xlayer()),
21632182
optimism: Object.freeze(new Optimism()),
21642183
osmo: Object.freeze(new Osmo()),
21652184
rbtc: Object.freeze(new Rbtc()),
@@ -2264,6 +2283,7 @@ export const Networks = {
22642283
oas: Object.freeze(new OasTestnet()),
22652284
og: Object.freeze(new OgTestnet()),
22662285
ofc: Object.freeze(new OfcTestnet()),
2286+
okb: Object.freeze(new XlayerTestnet()),
22672287
optimism: Object.freeze(new OptimismTestnet()),
22682288
osmo: Object.freeze(new OsmoTestnet()),
22692289
rbtc: Object.freeze(new RbtcTestnet()),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export const expectedColdFeatures = {
106106
'near',
107107
'oas',
108108
'og',
109+
'okb',
109110
'osmo',
110111
'plume',
111112
'polyx',
@@ -149,6 +150,7 @@ export const expectedColdFeatures = {
149150
'thbarevm',
150151
'tjovayeth',
151152
'tog',
153+
'tokb',
152154
'tmegaeth',
153155
'tmon',
154156
'tworld',

0 commit comments

Comments
 (0)