diff --git a/apps/connect/src/hooks/useFormatAssetParam.test.ts b/apps/connect/src/hooks/useFormatAssetParam.test.ts index 72b179ab7..a845b50e8 100644 --- a/apps/connect/src/hooks/useFormatAssetParam.test.ts +++ b/apps/connect/src/hooks/useFormatAssetParam.test.ts @@ -9,7 +9,7 @@ describe("useFormatAssetParam", () => { it("should NOT get a formatted asset when key does NOT have an exact match", () => { const { result } = renderHook(() => useFormatAssetParam("eth")); - expect(result.current).toEqual(null); + expect(result.current).toEqual("ETH"); }); it("should get a formatted asset using an address", () => { diff --git a/apps/connect/src/hooks/useFormatAssetParam.ts b/apps/connect/src/hooks/useFormatAssetParam.ts index 976f58024..bb05cd882 100644 --- a/apps/connect/src/hooks/useFormatAssetParam.ts +++ b/apps/connect/src/hooks/useFormatAssetParam.ts @@ -10,8 +10,11 @@ function getFormatedAsset(asset: string | null): string | null { ...ENV.wormholeConnectConfig?.tokensConfig, }; if (allTokens && asset) { - const tokenParam = Object.values(allTokens).find( - (config) => config?.tokenId?.address === asset || config?.key === asset + const tokenParam = Object.values(allTokens).find((config) => + [ + config?.tokenId?.address?.toLowerCase?.(), + config?.key?.toLowerCase?.(), + ].includes(asset.toLowerCase()) ); if (tokenParam) { return tokenParam.key; diff --git a/apps/connect/src/hooks/useQueryParams.ts b/apps/connect/src/hooks/useQueryParams.ts index fa6b9f096..b25425000 100644 --- a/apps/connect/src/hooks/useQueryParams.ts +++ b/apps/connect/src/hooks/useQueryParams.ts @@ -6,7 +6,7 @@ const getChainValue = ( query: URLSearchParams, key: string ): ChainName | null => { - const sourceChain = query.get(key); + const sourceChain = query.get(key)?.toLowerCase?.(); if (sourceChain) { if (isChain(sourceChain)) { return coalesceChainName(sourceChain) as ChainName;