Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 7 additions & 23 deletions modules/statics/src/allCoinsAndTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import { jettonTokens } from './coins/jettonTokens';
import { polyxTokens } from './coins/polyxTokens';
import { cantonTokens } from './coins/cantonTokens';
import { flrp } from './flrp';
import { hypeEvm } from './hypeevm';
import {
ACCOUNT_COIN_DEFAULT_FEATURES_EXCLUDE_SINGAPORE_AND_MENA_FZE,
ADA_FEATURES,
Expand Down Expand Up @@ -1712,44 +1713,27 @@ export const allCoinsAndTokens = [
CoinFeature.STAKING,
]
),
account(
hypeEvm(
'e907fdbd-2c5d-45d6-b622-9da38937da73',
'hypeevm',
'Hyperliquid EVM',
Networks.main.hypeevm,
18,
UnderlyingAsset.HYPEEVM,
BaseUnit.ETH,
[
...EVM_FEATURES,
CoinFeature.SHARED_EVM_SIGNING,
CoinFeature.SHARED_EVM_SDK,
CoinFeature.EVM_COMPATIBLE_IMS,
CoinFeature.EVM_COMPATIBLE_UI,
CoinFeature.EVM_NON_BITGO_RECOVERY,
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
CoinFeature.SUPPORTS_ERC20,
CoinFeature.STAKING,
]
150,
'0x2222222222222222222222222222222222222222'
),
account(
hypeEvm(
'e0500947-1105-404c-af52-765b1cb2a7c1',
'thypeevm',
'Hyperliquid EVM Testnet',
Networks.test.hypeevm,
18,
UnderlyingAsset.HYPEEVM,
BaseUnit.ETH,
[
...EVM_FEATURES,
CoinFeature.SHARED_EVM_SIGNING,
CoinFeature.SHARED_EVM_SDK,
CoinFeature.EVM_COMPATIBLE_IMS,
CoinFeature.EVM_COMPATIBLE_UI,
CoinFeature.EVM_NON_BITGO_RECOVERY,
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
CoinFeature.STAKING,
]
1105,
'0x2222222222222222222222222222222222222222'
),
account(
'23e7eca6-e862-4bc5-bf4f-65eeb8174171',
Expand Down
83 changes: 83 additions & 0 deletions modules/statics/src/hypeevm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { AccountCoin, AccountConstructorOptions } from './account';
import { BaseUnit, CoinFeature, KeyCurve, UnderlyingAsset } from './base';
import { EVM_FEATURES } from './coinFeatures';
import { AccountNetwork } from './networks';

export interface HypeEvmConstructorOptions extends AccountConstructorOptions {
tokenId: number;
systemAddress: string;
}

export class HypeEvm extends AccountCoin {
public static readonly DEFAULT_FEATURES = [
...EVM_FEATURES,
CoinFeature.SHARED_EVM_SIGNING,
CoinFeature.SHARED_EVM_SDK,
CoinFeature.EVM_COMPATIBLE_IMS,
CoinFeature.EVM_COMPATIBLE_UI,
CoinFeature.EVM_NON_BITGO_RECOVERY,
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
CoinFeature.SUPPORTS_ERC20,
CoinFeature.STAKING,
];

public tokenId: number;
public systemAddress: string;

constructor(options: HypeEvmConstructorOptions) {
super({
...options,
});

this.tokenId = options.tokenId;
this.systemAddress = options.systemAddress;
}
}

/**
* Factory function for hypeEvm coin instances
*
* @param id uuid v4
* @param name unique identifier of the coin
* @param fullName Complete human-readable name of the coin
* @param network Network object for this coin
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined for EVM like coins
* @param prefix? Optional coin prefix. Defaults to empty string
* @param suffix? Optional coin suffix. Defaults to coin name.
* @param primaryKeyCurve The elliptic curve for this chain/token
*/
export function hypeEvm(
id: string,
name: string,
fullName: string,
network: AccountNetwork,
decimalPlaces: number,
asset: UnderlyingAsset,
baseUnit: BaseUnit,
tokenId: number,
systemAddress: string,
features: CoinFeature[] = HypeEvm.DEFAULT_FEATURES,
prefix = '',
suffix: string = name.toUpperCase(),
primaryKeyCurve: KeyCurve = KeyCurve.Secp256k1
) {
return Object.freeze(
new HypeEvm({
id,
name,
fullName,
network,
decimalPlaces,
asset,
baseUnit,
features,
prefix,
suffix,
primaryKeyCurve,
isToken: false,
tokenId,
systemAddress,
})
);
}