diff --git a/modules/statics/src/allCoinsAndTokens.ts b/modules/statics/src/allCoinsAndTokens.ts index 79a6b41061..fe69918440 100644 --- a/modules/statics/src/allCoinsAndTokens.ts +++ b/modules/statics/src/allCoinsAndTokens.ts @@ -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, @@ -1712,7 +1713,7 @@ export const allCoinsAndTokens = [ CoinFeature.STAKING, ] ), - account( + hypeEvm( 'e907fdbd-2c5d-45d6-b622-9da38937da73', 'hypeevm', 'Hyperliquid EVM', @@ -1720,19 +1721,10 @@ export const allCoinsAndTokens = [ 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', @@ -1740,16 +1732,8 @@ export const allCoinsAndTokens = [ 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', diff --git a/modules/statics/src/hypeevm.ts b/modules/statics/src/hypeevm.ts new file mode 100644 index 0000000000..b0ecf19cfd --- /dev/null +++ b/modules/statics/src/hypeevm.ts @@ -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, + }) + ); +}