Skip to content

Commit a2cbeb8

Browse files
feat: added hypeEvm bridgable details to statics
Ticket: WIN-8770
1 parent 722a645 commit a2cbeb8

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
@@ -73,6 +73,7 @@ import { jettonTokens } from './coins/jettonTokens';
7373
import { polyxTokens } from './coins/polyxTokens';
7474
import { cantonTokens } from './coins/cantonTokens';
7575
import { flrp } from './flrp';
76+
import { hypeEvm } from './hypeevm';
7677
import {
7778
ACCOUNT_COIN_DEFAULT_FEATURES_EXCLUDE_SINGAPORE_AND_MENA_FZE,
7879
ADA_FEATURES,
@@ -1712,44 +1713,27 @@ export const allCoinsAndTokens = [
17121713
CoinFeature.STAKING,
17131714
]
17141715
),
1715-
account(
1716+
hypeEvm(
17161717
'e907fdbd-2c5d-45d6-b622-9da38937da73',
17171718
'hypeevm',
17181719
'Hyperliquid EVM',
17191720
Networks.main.hypeevm,
17201721
18,
17211722
UnderlyingAsset.HYPEEVM,
17221723
BaseUnit.ETH,
1723-
[
1724-
...EVM_FEATURES,
1725-
CoinFeature.SHARED_EVM_SIGNING,
1726-
CoinFeature.SHARED_EVM_SDK,
1727-
CoinFeature.EVM_COMPATIBLE_IMS,
1728-
CoinFeature.EVM_COMPATIBLE_UI,
1729-
CoinFeature.EVM_NON_BITGO_RECOVERY,
1730-
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
1731-
CoinFeature.SUPPORTS_ERC20,
1732-
CoinFeature.STAKING,
1733-
]
1724+
150,
1725+
'0x2222222222222222222222222222222222222222'
17341726
),
1735-
account(
1727+
hypeEvm(
17361728
'e0500947-1105-404c-af52-765b1cb2a7c1',
17371729
'thypeevm',
17381730
'Hyperliquid EVM Testnet',
17391731
Networks.test.hypeevm,
17401732
18,
17411733
UnderlyingAsset.HYPEEVM,
17421734
BaseUnit.ETH,
1743-
[
1744-
...EVM_FEATURES,
1745-
CoinFeature.SHARED_EVM_SIGNING,
1746-
CoinFeature.SHARED_EVM_SDK,
1747-
CoinFeature.EVM_COMPATIBLE_IMS,
1748-
CoinFeature.EVM_COMPATIBLE_UI,
1749-
CoinFeature.EVM_NON_BITGO_RECOVERY,
1750-
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
1751-
CoinFeature.STAKING,
1752-
]
1735+
1105,
1736+
'0x2222222222222222222222222222222222222222'
17531737
),
17541738
account(
17551739
'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)