diff --git a/bridge_ui/src/components/Transfer/SendConfirmationDialog.tsx b/bridge_ui/src/components/Transfer/SendConfirmationDialog.tsx index cedcf9c7e..ead8018d5 100644 --- a/bridge_ui/src/components/Transfer/SendConfirmationDialog.tsx +++ b/bridge_ui/src/components/Transfer/SendConfirmationDialog.tsx @@ -123,7 +123,6 @@ function SendConfirmationContent({ originChain={originChain} targetAsset={targetAsset ?? undefined} targetChain={targetChain} - symbol={symbol} /> diff --git a/bridge_ui/src/components/Transfer/TokenWarning.tsx b/bridge_ui/src/components/Transfer/TokenWarning.tsx index 5453512e1..1fdae5c60 100644 --- a/bridge_ui/src/components/Transfer/TokenWarning.tsx +++ b/bridge_ui/src/components/Transfer/TokenWarning.tsx @@ -90,14 +90,12 @@ export default function TokenWarning({ originChain, targetChain, targetAsset, - symbol, }: { sourceChain?: ChainId; sourceAsset?: string; originChain?: ChainId; targetChain?: ChainId; targetAsset?: string; - symbol?: string; }) { if ( !(originChain && targetChain && targetAsset && sourceChain && sourceAsset) @@ -109,7 +107,9 @@ export default function TokenWarning({ ? sourceAsset.toLowerCase() : sourceAsset; const isWormholeWrapped = originChain !== targetChain; - const isMultiChain = !!MULTI_CHAIN_TOKENS[sourceChain]?.[searchableAddress]; + const multichainSymbol = + MULTI_CHAIN_TOKENS[sourceChain]?.[searchableAddress] || undefined; + const isMultiChain = !!multichainSymbol; const isRewardsToken = searchableAddress === "0xae7ab96520de3a18e5e111b5eaab095312d7fe84" && sourceChain === CHAIN_ID_ETH; @@ -122,7 +122,7 @@ export default function TokenWarning({ <> {showMultiChainWarning ? ( ) : null} diff --git a/bridge_ui/src/hooks/useMetadata.ts b/bridge_ui/src/hooks/useMetadata.ts index 131812a18..905ec9562 100644 --- a/bridge_ui/src/hooks/useMetadata.ts +++ b/bridge_ui/src/hooks/useMetadata.ts @@ -17,7 +17,7 @@ export type GenericMetadata = { symbol?: string; logo?: string; tokenName?: string; - decimals?: number; + //decimals?: number; //TODO more items raw?: any; }; @@ -36,9 +36,9 @@ const constructSolanaMetadata = ( const tokenInfo = solanaTokenMap.data?.find((x) => x.address === address); //Both this and the token picker, at present, give priority to the tokenmap const obj = { - symbol: tokenInfo?.symbol || metaplex?.data.symbol || undefined, - logo: tokenInfo?.logoURI || metaplex?.data.uri || undefined, //TODO is URI on metaplex actually the logo? If not, where is it? - tokenName: tokenInfo?.name || metaplex?.data.name || undefined, + symbol: metaplex?.data?.symbol || tokenInfo?.symbol || undefined, + logo: tokenInfo?.logoURI || undefined, //TODO is URI on metaplex actually the logo? If not, where is it? + tokenName: metaplex?.data?.name || tokenInfo?.name || undefined, decimals: tokenInfo?.decimals || undefined, //TODO decimals are actually on the mint, not the metaplex account. raw: metaplex, }; diff --git a/bridge_ui/src/utils/consts.ts b/bridge_ui/src/utils/consts.ts index 7e3412fe0..72ce16d97 100644 --- a/bridge_ui/src/utils/consts.ts +++ b/bridge_ui/src/utils/consts.ts @@ -631,12 +631,13 @@ export const VAA_EMITTER_ADDRESSES = [ export const WORMHOLE_EXPLORER_BASE = "https://wormholenetwork.com/en/explorer"; -export const MULTI_CHAIN_TOKENS: { - [x: number]: { [address: string]: string }; -} = +export type MultiChainInfo = { + [key in ChainId]: { [address: string]: string }; +}; +export const MULTI_CHAIN_TOKENS: MultiChainInfo = //EVM chains should format the addresses to all lowercase CLUSTER === "mainnet" - ? { + ? ({ [CHAIN_ID_SOLANA]: { EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: "USDC", Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB: "USDT", @@ -654,12 +655,16 @@ export const MULTI_CHAIN_TOKENS: { "0x2791bca1f2de4661ed88a30c99a7a9449aa84174": "USDC", "0xc2132d05d31c914a87c6611c10748aeb04b58e8f": "USDT", }, - } - : { + } as MultiChainInfo) + : ({ [CHAIN_ID_SOLANA]: { "2WDq7wSs9zYrpx2kbHDA4RUTRch2CCTP6ZWaH4GNfnQQ": "SOLT", }, - }; + [CHAIN_ID_ETH]: {}, + [CHAIN_ID_TERRA]: {}, + [CHAIN_ID_BSC]: {}, + [CHAIN_ID_POLYGON]: {}, + } as MultiChainInfo); export const AVAILABLE_MARKETS_URL = "https://docs.wormholenetwork.com/wormhole/overview-liquid-markets";