Skip to content

Commit

Permalink
fix: assign mainnetAddress correctly in token search (#1734)
Browse files Browse the repository at this point in the history
Co-authored-by: brdy <[email protected]>
  • Loading branch information
derHowie and BrodyHughes authored Oct 21, 2024
1 parent ff500fd commit c56dbbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/resources/search/parseTokenSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ export function parseTokenSearch(
chainId: ChainId,
): SearchAsset {
const networkInfo = asset.networks[chainId];
const mainnetInfo = asset.networks[ChainId.mainnet];

return {
...asset,
address: networkInfo ? networkInfo.address : asset.address,
chainId,
decimals: networkInfo ? networkInfo.decimals : asset.decimals,
isNativeAsset: isNativeAsset(asset.address, chainId),
mainnetAddress: asset.uniqueId as AddressOrEth,
mainnetAddress: mainnetInfo?.address as AddressOrEth,
uniqueId: `${networkInfo?.address || asset.uniqueId}_${chainId}`,
};
}

0 comments on commit c56dbbe

Please sign in to comment.