Skip to content

Commit 8a2810a

Browse files
Merge pull request #8042 from BitGo/WIN-8770-hype-statics-update
feat: added hypeEvm bridgable details to statics
2 parents acfe084 + a2cbeb8 commit 8a2810a

2 files changed

Lines changed: 90 additions & 23 deletions

File tree

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ import { jettonTokens } from './coins/jettonTokens';
7777
import { polyxTokens } from './coins/polyxTokens';
7878
import { cantonTokens } from './coins/cantonTokens';
7979
import { flrp } from './flrp';
80+
import { hypeEvm } from './hypeevm';
8081
import {
8182
ACCOUNT_COIN_DEFAULT_FEATURES_EXCLUDE_SINGAPORE_AND_MENA_FZE,
8283
ADA_FEATURES,
@@ -1718,44 +1719,27 @@ export const allCoinsAndTokens = [
17181719
CoinFeature.STAKING,
17191720
]
17201721
),
1721-
account(
1722+
hypeEvm(
17221723
'e907fdbd-2c5d-45d6-b622-9da38937da73',
17231724
'hypeevm',
17241725
'Hyperliquid EVM',
17251726
Networks.main.hypeevm,
17261727
18,
17271728
UnderlyingAsset.HYPEEVM,
17281729
BaseUnit.ETH,
1729-
[
1730-
...EVM_FEATURES,
1731-
CoinFeature.SHARED_EVM_SIGNING,
1732-
CoinFeature.SHARED_EVM_SDK,
1733-
CoinFeature.EVM_COMPATIBLE_IMS,
1734-
CoinFeature.EVM_COMPATIBLE_UI,
1735-
CoinFeature.EVM_NON_BITGO_RECOVERY,
1736-
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
1737-
CoinFeature.SUPPORTS_ERC20,
1738-
CoinFeature.STAKING,
1739-
]
1730+
150,
1731+
'0x2222222222222222222222222222222222222222'
17401732
),
1741-
account(
1733+
hypeEvm(
17421734
'e0500947-1105-404c-af52-765b1cb2a7c1',
17431735
'thypeevm',
17441736
'Hyperliquid EVM Testnet',
17451737
Networks.test.hypeevm,
17461738
18,
17471739
UnderlyingAsset.HYPEEVM,
17481740
BaseUnit.ETH,
1749-
[
1750-
...EVM_FEATURES,
1751-
CoinFeature.SHARED_EVM_SIGNING,
1752-
CoinFeature.SHARED_EVM_SDK,
1753-
CoinFeature.EVM_COMPATIBLE_IMS,
1754-
CoinFeature.EVM_COMPATIBLE_UI,
1755-
CoinFeature.EVM_NON_BITGO_RECOVERY,
1756-
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
1757-
CoinFeature.STAKING,
1758-
]
1741+
1105,
1742+
'0x2222222222222222222222222222222222222222'
17591743
),
17601744
account(
17611745
'23e7eca6-e862-4bc5-bf4f-65eeb8174171',

modules/statics/src/hypeevm.ts

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { AccountCoin, AccountConstructorOptions } from './account';
2+
import { BaseUnit, CoinFeature, KeyCurve, UnderlyingAsset } from './base';
3+
import { EVM_FEATURES } from './coinFeatures';
4+
import { AccountNetwork } from './networks';
5+
6+
export interface HypeEvmConstructorOptions extends AccountConstructorOptions {
7+
tokenId: number;
8+
systemAddress: string;
9+
}
10+
11+
export class HypeEvm extends AccountCoin {
12+
public static readonly DEFAULT_FEATURES = [
13+
...EVM_FEATURES,
14+
CoinFeature.SHARED_EVM_SIGNING,
15+
CoinFeature.SHARED_EVM_SDK,
16+
CoinFeature.EVM_COMPATIBLE_IMS,
17+
CoinFeature.EVM_COMPATIBLE_UI,
18+
CoinFeature.EVM_NON_BITGO_RECOVERY,
19+
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
20+
CoinFeature.SUPPORTS_ERC20,
21+
CoinFeature.STAKING,
22+
];
23+
24+
public tokenId: number;
25+
public systemAddress: string;
26+
27+
constructor(options: HypeEvmConstructorOptions) {
28+
super({
29+
...options,
30+
});
31+
32+
this.tokenId = options.tokenId;
33+
this.systemAddress = options.systemAddress;
34+
}
35+
}
36+
37+
/**
38+
* Factory function for hypeEvm coin instances
39+
*
40+
* @param id uuid v4
41+
* @param name unique identifier of the coin
42+
* @param fullName Complete human-readable name of the coin
43+
* @param network Network object for this coin
44+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
45+
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined for EVM like coins
46+
* @param prefix? Optional coin prefix. Defaults to empty string
47+
* @param suffix? Optional coin suffix. Defaults to coin name.
48+
* @param primaryKeyCurve The elliptic curve for this chain/token
49+
*/
50+
export function hypeEvm(
51+
id: string,
52+
name: string,
53+
fullName: string,
54+
network: AccountNetwork,
55+
decimalPlaces: number,
56+
asset: UnderlyingAsset,
57+
baseUnit: BaseUnit,
58+
tokenId: number,
59+
systemAddress: string,
60+
features: CoinFeature[] = HypeEvm.DEFAULT_FEATURES,
61+
prefix = '',
62+
suffix: string = name.toUpperCase(),
63+
primaryKeyCurve: KeyCurve = KeyCurve.Secp256k1
64+
) {
65+
return Object.freeze(
66+
new HypeEvm({
67+
id,
68+
name,
69+
fullName,
70+
network,
71+
decimalPlaces,
72+
asset,
73+
baseUnit,
74+
features,
75+
prefix,
76+
suffix,
77+
primaryKeyCurve,
78+
isToken: false,
79+
tokenId,
80+
systemAddress,
81+
})
82+
);
83+
}

0 commit comments

Comments
 (0)