@@ -123,6 +123,64 @@ describe('EthLike Token Config Functions', function () {
123123 config . coin . should . equal ( 'ip' ) ;
124124 config . type . should . equal ( 'ip:usdc' ) ;
125125 } ) ;
126+
127+ it ( 'should convert an EthLikeERC20Token to EthLikeTokenConfig for hypeevm mainnet' , function ( ) {
128+ // Create a mock mainnet EthLikeERC20Token for hypeevm
129+ const mockMainnetToken = new EthLikeERC20Token ( {
130+ id : 'a1234567-1234-4234-8234-123456789012' ,
131+ name : 'hypeevm:testtoken' ,
132+ fullName : 'HypeEVM Test Token' ,
133+ network : Networks . main . hypeevm ,
134+ contractAddress : '0x9876543210987654321098765432109876543210' ,
135+ decimalPlaces : 18 ,
136+ asset : UnderlyingAsset . HYPEEVM ,
137+ features : [ ...AccountCoin . DEFAULT_FEATURES , CoinFeature . EIP1559 ] ,
138+ prefix : '' ,
139+ suffix : 'TESTTOKEN' ,
140+ primaryKeyCurve : KeyCurve . Secp256k1 ,
141+ isToken : true ,
142+ baseUnit : BaseUnit . ETH ,
143+ } ) ;
144+
145+ const config = getFormattedEthLikeTokenConfig ( CoinMap . fromCoins ( [ mockMainnetToken ] ) ) [ 0 ] ;
146+
147+ config . should . not . be . undefined ( ) ;
148+ config . type . should . equal ( 'hypeevm:testtoken' ) ;
149+ config . coin . should . equal ( 'hypeevm' ) ;
150+ config . network . should . equal ( 'Mainnet' ) ;
151+ config . name . should . equal ( 'HypeEVM Test Token' ) ;
152+ config . tokenContractAddress . should . equal ( '0x9876543210987654321098765432109876543210' ) ;
153+ config . decimalPlaces . should . equal ( 18 ) ;
154+ } ) ;
155+
156+ it ( 'should convert an EthLikeERC20Token to EthLikeTokenConfig for thypeevm testnet' , function ( ) {
157+ // Create a mock testnet EthLikeERC20Token for thypeevm
158+ const mockTestnetToken = new EthLikeERC20Token ( {
159+ id : 'b2234567-2234-4234-9234-223456789012' ,
160+ name : 'thypeevm:testtoken' ,
161+ fullName : 'HypeEVM Test Token Testnet' ,
162+ network : Networks . test . hypeevm ,
163+ contractAddress : '0xfedcba0987654321fedcba0987654321fedcba09' ,
164+ decimalPlaces : 18 ,
165+ asset : UnderlyingAsset . HYPEEVM ,
166+ features : [ ...AccountCoin . DEFAULT_FEATURES , CoinFeature . EIP1559 ] ,
167+ prefix : '' ,
168+ suffix : 'TESTTOKEN' ,
169+ primaryKeyCurve : KeyCurve . Secp256k1 ,
170+ isToken : true ,
171+ baseUnit : BaseUnit . ETH ,
172+ } ) ;
173+
174+ const config = getFormattedEthLikeTokenConfig ( CoinMap . fromCoins ( [ mockTestnetToken ] ) ) [ 0 ] ;
175+
176+ config . should . not . be . undefined ( ) ;
177+ config . type . should . equal ( 'thypeevm:testtoken' ) ;
178+ config . coin . should . equal ( 'thypeevm' ) ;
179+ config . network . should . equal ( 'Testnet' ) ;
180+ config . name . should . equal ( 'HypeEVM Test Token Testnet' ) ;
181+ config . tokenContractAddress . should . equal ( '0xfedcba0987654321fedcba0987654321fedcba09' ) ;
182+ config . decimalPlaces . should . equal ( 18 ) ;
183+ } ) ;
126184 } ) ;
127185
128186 describe ( 'getFormattedEthLikeTokenConfig' , function ( ) {
@@ -254,11 +312,15 @@ describe('EthLike Token Config Functions', function () {
254312 const result = getEthLikeTokens ( 'Mainnet' ) ;
255313
256314 result . should . be . an . Object ( ) ;
257- // The function filters by enabledChains which currently includes 'ip'
315+ // The function filters by enabledChains which currently includes 'ip' and 'hypeevm'
258316 if ( result . ip ) {
259317 result . ip . should . have . property ( 'tokens' ) ;
260318 result . ip . tokens . should . be . an . Array ( ) ;
261319 }
320+ if ( result . hypeevm ) {
321+ result . hypeevm . should . have . property ( 'tokens' ) ;
322+ result . hypeevm . tokens . should . be . an . Array ( ) ;
323+ }
262324 } ) ;
263325
264326 it ( 'should filter mainnet tokens correctly' , function ( ) {
@@ -289,6 +351,11 @@ describe('EthLike Token Config Functions', function () {
289351 token . coin . should . equal ( 'tip' ) ;
290352 } ) ;
291353 }
354+ if ( result . hypeevm && result . hypeevm . tokens . length > 0 ) {
355+ result . hypeevm . tokens . forEach ( ( token ) => {
356+ token . coin . should . equal ( 'thypeevm' ) ;
357+ } ) ;
358+ }
292359 } ) ;
293360
294361 it ( 'should not prepend "t" to coin name for mainnet tokens' , function ( ) {
@@ -299,6 +366,11 @@ describe('EthLike Token Config Functions', function () {
299366 token . coin . should . equal ( 'ip' ) ;
300367 } ) ;
301368 }
369+ if ( result . hypeevm && result . hypeevm . tokens . length > 0 ) {
370+ result . hypeevm . tokens . forEach ( ( token ) => {
371+ token . coin . should . equal ( 'hypeevm' ) ;
372+ } ) ;
373+ }
302374 } ) ;
303375
304376 it ( 'should only include tokens from chains with SUPPORTS_ERC20 feature' , function ( ) {
@@ -318,8 +390,8 @@ describe('EthLike Token Config Functions', function () {
318390 const mainnetResult = getEthLikeTokens ( 'Mainnet' ) ;
319391 const testnetResult = getEthLikeTokens ( 'Testnet' ) ;
320392
321- // Current implementation only enables 'ip' chain
322- const enabledChains = [ 'ip' ] ;
393+ // Current implementation enables 'ip' and 'hypeevm' chains
394+ const enabledChains = [ 'ip' , 'hypeevm' ] ;
323395
324396 Object . keys ( mainnetResult ) . forEach ( ( family ) => {
325397 enabledChains . should . containEql ( family ) ;
@@ -348,6 +420,12 @@ describe('EthLike Token Config Functions', function () {
348420 token . coin . should . equal ( 'ip' ) ;
349421 } ) ;
350422 }
423+ if ( result . hypeevm && result . hypeevm . tokens . length > 0 ) {
424+ result . hypeevm . tokens . forEach ( ( token ) => {
425+ // All tokens in hypeevm group should have coin 'hypeevm'
426+ token . coin . should . equal ( 'hypeevm' ) ;
427+ } ) ;
428+ }
351429 } ) ;
352430
353431 it ( 'should return tokens with correct structure' , function ( ) {
0 commit comments