Skip to content

Commit 3e5fe7b

Browse files
committed
feat(statics): add Hemi EVM chain support
Add Hemi L2 EVM chain to BitGoJS statics: - Add HEMI to CoinFamily and UnderlyingAsset enums - Create Hemi/HemiTestnet network classes (chain IDs: 43111/743111) - Add hemi/themi coin entries with EVM features - Add explorer API URLs to environments - Update test fixtures Ticket: WIN-8747 CECHO-115
1 parent 936048e commit 3e5fe7b

File tree

7 files changed

+79
-0
lines changed

7 files changed

+79
-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.FLUENTETH &&
104104
n.asset !== UnderlyingAsset.MANTLE &&
105105
n.asset !== UnderlyingAsset.JOVAYETH &&
106+
n.asset !== UnderlyingAsset.HEMI &&
106107
n.asset !== UnderlyingAsset.OKBXLAYER &&
107108
n.asset !== UnderlyingAsset.MORPH &&
108109
n.asset !== UnderlyingAsset.MORPHETH &&

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ const mainnetBase: EnvironmentTemplate = {
290290
baseUrl: 'https://mainnet.mirrornode.hedera.com/api/v1',
291291
rpcUrl: 'https://mainnet.hashio.io/api',
292292
},
293+
hemi: {
294+
baseUrl: 'https://explorer.hemi.xyz/api',
295+
},
293296
fluenteth: {
294297
baseUrl: 'https://testnet.fluentscan.xyz/api/', //TODO: COIN-6478: add mainnet url when available
295298
},
@@ -471,6 +474,9 @@ const testnetBase: EnvironmentTemplate = {
471474
baseUrl: 'https://testnet.mirrornode.hedera.com/api/v1',
472475
rpcUrl: 'https://testnet.hashio.io/api',
473476
},
477+
hemi: {
478+
baseUrl: 'https://testnet.explorer.hemi.xyz/api',
479+
},
474480
fluenteth: {
475481
baseUrl: 'https://testnet.fluentscan.xyz/api/',
476482
},

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,6 +2253,52 @@ export const allCoinsAndTokens = [
22532253
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
22542254
]
22552255
),
2256+
account(
2257+
'68d22683-a8f2-47b3-8446-92e02a1963ae',
2258+
'hemi',
2259+
'Hemi',
2260+
Networks.main.hemi,
2261+
18,
2262+
UnderlyingAsset.HEMI,
2263+
BaseUnit.ETH,
2264+
[
2265+
...EVM_FEATURES,
2266+
CoinFeature.SHARED_EVM_SIGNING,
2267+
CoinFeature.SHARED_EVM_SDK,
2268+
CoinFeature.EVM_COMPATIBLE_IMS,
2269+
CoinFeature.EVM_COMPATIBLE_UI,
2270+
CoinFeature.EVM_COMPATIBLE_WP,
2271+
CoinFeature.EVM_NON_BITGO_RECOVERY,
2272+
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
2273+
CoinFeature.SUPPORTS_ERC20,
2274+
],
2275+
KeyCurve.Secp256k1,
2276+
'',
2277+
'Hemi'
2278+
),
2279+
account(
2280+
'df0007d9-974b-4099-bf37-9dc59399c058',
2281+
'themi',
2282+
'Testnet Hemi',
2283+
Networks.test.hemi,
2284+
18,
2285+
UnderlyingAsset.HEMI,
2286+
BaseUnit.ETH,
2287+
[
2288+
...EVM_FEATURES,
2289+
CoinFeature.SHARED_EVM_SIGNING,
2290+
CoinFeature.SHARED_EVM_SDK,
2291+
CoinFeature.EVM_COMPATIBLE_IMS,
2292+
CoinFeature.EVM_COMPATIBLE_UI,
2293+
CoinFeature.EVM_COMPATIBLE_WP,
2294+
CoinFeature.EVM_NON_BITGO_RECOVERY,
2295+
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
2296+
CoinFeature.SUPPORTS_ERC20,
2297+
],
2298+
KeyCurve.Secp256k1,
2299+
'',
2300+
'THemi'
2301+
),
22562302

22572303
erc721Token(
22582304
'a7604e03-7f40-41f0-8efa-2e7673ac2a9f',

modules/statics/src/base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export enum CoinFamily {
6565
HASH = 'hash', // Provenance
6666
HBAR = 'hbar',
6767
HBAREVM = 'hbarevm', // Hedera EVM coin
68+
HEMI = 'hemi',
6869
ICP = 'icp',
6970
INITIA = 'initia',
7071
INJECTIVE = 'injective',
@@ -594,6 +595,7 @@ export enum UnderlyingAsset {
594595
HASH = 'hash', // Provenance
595596
HBAR = 'hbar', // Hedera main coin
596597
HBAREVM = 'hbarevm', // Hedera EVM coin
598+
HEMI = 'hemi',
597599
ICP = 'icp',
598600
IP = 'ip', // Story Chain
599601
INITIA = 'initia',

modules/statics/src/coins/ofcCoins.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ export const ofcCoins = [
275275
UnderlyingAsset.LINEAETH,
276276
CoinKind.CRYPTO
277277
),
278+
ofc('bdab1ab0-215d-4d59-b698-7cc624e5027a', 'ofchemi', 'Hemi', 18, UnderlyingAsset.HEMI, CoinKind.CRYPTO),
279+
tofc('bc005b8a-dfb5-42db-92ad-92db5cb5b7d2', 'ofcthemi', 'Hemi Testnet', 18, UnderlyingAsset.HEMI, CoinKind.CRYPTO),
278280
ofc(
279281
'f43afacc-0db3-4a8a-a987-ff9d93e08cb4',
280282
'ofcjovayeth',

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,6 +2316,24 @@ class HederaEVM extends Mainnet implements EthereumNetwork {
23162316
nativeCoinOperationHashPrefix = '295';
23172317
}
23182318

2319+
class Hemi extends Mainnet implements EthereumNetwork {
2320+
name = 'Hemi';
2321+
family = CoinFamily.HEMI;
2322+
explorerUrl = 'https://explorer.hemi.xyz/tx/';
2323+
accountExplorerUrl = 'https://explorer.hemi.xyz/address/';
2324+
chainId = 43111;
2325+
nativeCoinOperationHashPrefix = '43111';
2326+
}
2327+
2328+
class HemiTestnet extends Testnet implements EthereumNetwork {
2329+
name = 'Testnet Hemi';
2330+
family = CoinFamily.HEMI;
2331+
explorerUrl = 'https://testnet.explorer.hemi.xyz/tx/';
2332+
accountExplorerUrl = 'https://testnet.explorer.hemi.xyz/address/';
2333+
chainId = 743111;
2334+
nativeCoinOperationHashPrefix = '743111';
2335+
}
2336+
23192337
class PlumeTestnet extends Testnet implements EthereumNetwork {
23202338
name = 'PlumeTestnet';
23212339
family = CoinFamily.PLUME;
@@ -2441,6 +2459,7 @@ export const Networks = {
24412459
hash: Object.freeze(new Hash()),
24422460
hedera: Object.freeze(new Hedera()),
24432461
hederaEVM: Object.freeze(new HederaEVM()),
2462+
hemi: Object.freeze(new Hemi()),
24442463
icp: Object.freeze(new Icp()),
24452464
ip: Object.freeze(new IP()),
24462465
initia: Object.freeze(new Initia()),
@@ -2556,6 +2575,7 @@ export const Networks = {
25562575
hash: Object.freeze(new HashTestnet()),
25572576
hedera: Object.freeze(new HederaTestnet()),
25582577
hederaEVM: Object.freeze(new HederaEVMTestnet()),
2578+
hemi: Object.freeze(new HemiTestnet()),
25592579
icp: Object.freeze(new IcpTestnet()),
25602580
ip: Object.freeze(new IPTestnet()),
25612581
initia: Object.freeze(new InitiaTestnet()),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const expectedColdFeatures = {
9595
'fluenteth',
9696
'hash',
9797
'hbarevm',
98+
'hemi',
9899
'icp',
99100
'ip', // Story chain
100101
'initia',
@@ -161,6 +162,7 @@ export const expectedColdFeatures = {
161162
'tflow',
162163
'tfluenteth',
163164
'thbarevm',
165+
'themi',
164166
'tjovayeth',
165167
'tog',
166168
'tokbxlayer',

0 commit comments

Comments
 (0)