Skip to content

Commit ad52463

Browse files
authored
Merge pull request #7675 from BitGo/WIN-8081
feat(statics): add morph chain config
2 parents 7a6dab5 + 00dca1d commit ad52463

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
@@ -103,6 +103,7 @@ describe('V2 Keychains', function () {
103103
n.asset !== UnderlyingAsset.MANTLE &&
104104
n.asset !== UnderlyingAsset.JOVAYETH &&
105105
n.asset !== UnderlyingAsset.OKB &&
106+
n.asset !== UnderlyingAsset.MORPH &&
106107
coinFamilyValues.includes(n.name)
107108
);
108109

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ const mainnetBase: EnvironmentTemplate = {
286286
okb: {
287287
baseUrl: 'https://www.oklink.com/api/v5/explorer/block/block-list?chainShortName=xlayer',
288288
},
289+
morph: {
290+
baseUrl: 'https://explorer-api-hoodi.morphl2.io', // TODO: WIN-8134 add mainnet url when available
291+
},
289292
},
290293
icpNodeUrl: 'https://ic0.app',
291294
worldExplorerBaseUrl: 'https://worldscan.org/',
@@ -439,6 +442,9 @@ const testnetBase: EnvironmentTemplate = {
439442
okb: {
440443
baseUrl: 'https://www.oklink.com/api/v5/explorer/block/block-list?chainShortName=xlayer_testnet',
441444
},
445+
morph: {
446+
baseUrl: 'https://explorer-api-hoodi.morphl2.io',
447+
},
442448
},
443449
stxNodeUrl: 'https://api.testnet.hiro.so',
444450
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
@@ -2322,6 +2322,40 @@ export const allCoinsAndTokens = [
23222322
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
23232323
]
23242324
),
2325+
account(
2326+
'60203912-6332-4f44-8f83-a88a06ae170b',
2327+
'morph',
2328+
'Morph Mainnet',
2329+
Networks.main.morph,
2330+
18,
2331+
UnderlyingAsset.MORPH,
2332+
BaseUnit.ETH,
2333+
[
2334+
...EVM_FEATURES,
2335+
CoinFeature.SHARED_EVM_SIGNING,
2336+
CoinFeature.SHARED_EVM_SDK,
2337+
CoinFeature.EVM_COMPATIBLE_IMS,
2338+
CoinFeature.EVM_COMPATIBLE_UI,
2339+
CoinFeature.EVM_COMPATIBLE_WP,
2340+
]
2341+
),
2342+
account(
2343+
'9352fddb-3b01-40a3-b09a-a047bc1595bd',
2344+
'tmorph',
2345+
'Morph Testnet',
2346+
Networks.test.morph,
2347+
18,
2348+
UnderlyingAsset.MORPH,
2349+
BaseUnit.ETH,
2350+
[
2351+
...EVM_FEATURES,
2352+
CoinFeature.SHARED_EVM_SIGNING,
2353+
CoinFeature.SHARED_EVM_SDK,
2354+
CoinFeature.EVM_COMPATIBLE_IMS,
2355+
CoinFeature.EVM_COMPATIBLE_UI,
2356+
CoinFeature.EVM_COMPATIBLE_WP,
2357+
]
2358+
),
23252359
canton(
23262360
'07385320-5a4f-48e9-97a5-86d4be9f24b0',
23272361
'canton',

modules/statics/src/base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export enum CoinFamily {
121121
IP = 'ip', // Story Chain
122122
SOMI = 'somi', // Somnia Chain
123123
FLUENTETH = 'fluenteth',
124+
MORPH = 'morph',
124125
}
125126

126127
/**
@@ -590,6 +591,7 @@ export enum UnderlyingAsset {
590591
MANTRA = 'mantra',
591592
MEGAETH = 'megaeth',
592593
MON = 'mon',
594+
MORPH = 'morph',
593595
NEAR = 'near',
594596
OAS = 'oas',
595597
OG = 'og',

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,24 @@ class XlayerTestnet extends Testnet implements EthereumNetwork {
15981598
nativeCoinOperationHashPrefix = '195';
15991599
}
16001600

1601+
class Morph extends Mainnet implements EthereumNetwork {
1602+
name = 'Morph Mainnet';
1603+
family = CoinFamily.MORPH;
1604+
explorerUrl = 'https://explorer-api-hoodi.morphl2.io/tx/'; // TODO: WIN-8134 add mainnet url when available
1605+
accountExplorerUrl = 'https://explorer-api-hoodi.morphl2.io/address/'; // TODO: WIN-8134 add mainnet account explorer url when available
1606+
chainId = 2818;
1607+
nativeCoinOperationHashPrefix = '2818';
1608+
}
1609+
1610+
class MorphTestnet extends Testnet implements EthereumNetwork {
1611+
name = 'Morph Testnet';
1612+
family = CoinFamily.MORPH;
1613+
explorerUrl = 'https://explorer-api-hoodi.morphl2.io/tx/';
1614+
accountExplorerUrl = 'https://explorer-api-hoodi.morphl2.io/address/';
1615+
chainId = 2710;
1616+
nativeCoinOperationHashPrefix = '2710';
1617+
}
1618+
16011619
class CreditcoinTestnet extends Testnet implements EthereumNetwork {
16021620
name = 'CreditcoinTestnet';
16031621
family = CoinFamily.CTC;
@@ -2216,6 +2234,7 @@ export const Networks = {
22162234
og: Object.freeze(new Og()),
22172235
ofc: Object.freeze(new Ofc()),
22182236
okb: Object.freeze(new Xlayer()),
2237+
morph: Object.freeze(new Morph()),
22192238
optimism: Object.freeze(new Optimism()),
22202239
osmo: Object.freeze(new Osmo()),
22212240
rbtc: Object.freeze(new Rbtc()),
@@ -2321,6 +2340,7 @@ export const Networks = {
23212340
og: Object.freeze(new OgTestnet()),
23222341
ofc: Object.freeze(new OfcTestnet()),
23232342
okb: Object.freeze(new XlayerTestnet()),
2343+
morph: Object.freeze(new MorphTestnet()),
23242344
optimism: Object.freeze(new OptimismTestnet()),
23252345
osmo: Object.freeze(new OsmoTestnet()),
23262346
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
@@ -103,6 +103,7 @@ export const expectedColdFeatures = {
103103
'mantle',
104104
'mantra',
105105
'mon',
106+
'morph',
106107
'near',
107108
'oas',
108109
'og',
@@ -151,6 +152,7 @@ export const expectedColdFeatures = {
151152
'tjovayeth',
152153
'tog',
153154
'tokb',
155+
'tmorph',
154156
'tmegaeth',
155157
'tmon',
156158
'tworld',

0 commit comments

Comments
 (0)