Skip to content

Commit a496512

Browse files
committed
correct logic
1 parent e28ec2d commit a496512

File tree

1 file changed

+5
-3
lines changed
  • packages/assets-controllers/src/token-prices-service

1 file changed

+5
-3
lines changed

packages/assets-controllers/src/token-prices-service/codefi-v2.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,13 @@ export class CodefiTokenPricesServiceV2
462462
hexToNumber(asset.chainId).toString(),
463463
);
464464

465-
const nativeAsset =
466-
HEX_CHAIN_ID_TO_CAIP19_NATIVE_ASSET_MAP[asset.chainId];
465+
const nativeAddress = getNativeTokenAddress(asset.chainId);
467466

468467
return {
469-
assetId: nativeAsset ?? `${caipChainId}/erc20:${asset.address}`,
468+
assetId:
469+
nativeAddress.toLowerCase() === asset.address.toLowerCase()
470+
? HEX_CHAIN_ID_TO_CAIP19_NATIVE_ASSET_MAP[asset.chainId]
471+
: `${caipChainId}/erc20:${asset.address}`,
470472
address: asset.address,
471473
chainId: asset.chainId,
472474
};

0 commit comments

Comments
 (0)