Define token config for inEVM

pull/142/head
J M Rossy 9 months ago
parent d0209ec8f4
commit 84beee5f8f
  1. 12
      src/consts/tokens.ts
  2. 10
      src/scripts/buildConfigs/routes.ts

@ -4,6 +4,7 @@ import { WarpTokenConfig } from '../features/tokens/types';
// Tokens can be defined here, in tokens.json, or in tokens.yaml
// The input here is typically the output of the Hyperlane CLI warp deploy command
export const tokenList: WarpTokenConfig = [
// INJ on Injective
{
type: 'native',
chainId: 'injective-1',
@ -14,4 +15,15 @@ export const tokenList: WarpTokenConfig = [
igpTokenAddressOrDenom: 'inj',
logoURI: '/logos/injective.svg',
},
// INJ on inEVM
{
type: 'native',
chainId: 2525,
name: 'Injective Coin',
symbol: 'INJ',
decimals: 18,
hypNativeAddress: '0x26f32245fCF5Ad53159E875d5Cae62aEcf19c2d4',
logoURI: '/logos/injective.svg',
},
];

@ -49,10 +49,14 @@ export async function fetchRemoteHypTokens(
const hypTokens = await Promise.all(
remoteRouters.map(async (router) => {
const destMetadata = context.multiProvider.getChainMetadata(router.domain);
const protocol = destMetadata.protocol || ProtocolType.Ethereum;
const remoteMetadata = context.multiProvider.getChainMetadata(router.domain);
const protocol = remoteMetadata.protocol || ProtocolType.Ethereum;
const chain = getCaip2Id(protocol, context.multiProvider.getChainId(router.domain));
const formattedAddress = bytesToProtocolAddress(router.address, protocol);
const formattedAddress = bytesToProtocolAddress(
router.address,
protocol,
remoteMetadata.bech32Prefix,
);
if (isNft) return { chain, router: formattedAddress, decimals: 0 };
const routerDecimals = await getRemoteRouterDecimals(

Loading…
Cancel
Save