Skip to content

Commit 373429e

Browse files
committed
fixes
1 parent a496512 commit 373429e

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

packages/assets-controllers/src/TokenRatesController.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -703,12 +703,11 @@ export class TokenRatesController extends StaticIntervalPollingController<TokenR
703703
chainId: Hex;
704704
nativeCurrency: string;
705705
}): Promise<ContractMarketData> {
706-
let contractNativeInformations;
707706
const tokenPricesByTokenAddress = await reduceInBatchesSerially<
708707
Hex,
709708
Record<Hex, EvmAssetWithMarketData>
710709
>({
711-
values: [...tokenAddresses].sort(),
710+
values: [...tokenAddresses, getNativeTokenAddress(chainId)].sort(),
712711
batchSize: TOKEN_PRICES_BATCH_SIZE,
713712
eachBatch: async (allTokenPricesByTokenAddress, batch) => {
714713
const tokenPricesByTokenAddressForBatch = (
@@ -734,26 +733,26 @@ export class TokenRatesController extends StaticIntervalPollingController<TokenR
734733
},
735734
initialResult: {},
736735
});
737-
contractNativeInformations = tokenPricesByTokenAddress;
736+
// const contractNativeInformations = tokenPricesByTokenAddress;
738737

739738
// fetch for native token
740-
if (tokenAddresses.length === 0) {
741-
const contractNativeInformationNative =
742-
await this.#tokenPricesService.fetchTokenPrices({
743-
assets: [
744-
{
745-
chainId,
746-
address: getNativeTokenAddress(chainId),
747-
},
748-
],
749-
currency: nativeCurrency,
750-
});
751-
752-
contractNativeInformations = {
753-
[getNativeTokenAddress(chainId)]: contractNativeInformationNative[0],
754-
};
755-
}
756-
return Object.entries(contractNativeInformations).reduce(
739+
// if (tokenAddresses.length === 0) {
740+
// const contractNativeInformationNative =
741+
// await this.#tokenPricesService.fetchTokenPrices({
742+
// assets: [
743+
// {
744+
// chainId,
745+
// address: getNativeTokenAddress(chainId),
746+
// },
747+
// ],
748+
// currency: nativeCurrency,
749+
// });
750+
751+
// contractNativeInformations = {
752+
// [getNativeTokenAddress(chainId)]: contractNativeInformationNative[0],
753+
// };
754+
// }
755+
return Object.entries(tokenPricesByTokenAddress).reduce(
757756
(obj, [tokenAddress, token]) => {
758757
obj = {
759758
...obj,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ export class CodefiTokenPricesServiceV2
468468
assetId:
469469
nativeAddress.toLowerCase() === asset.address.toLowerCase()
470470
? HEX_CHAIN_ID_TO_CAIP19_NATIVE_ASSET_MAP[asset.chainId]
471-
: `${caipChainId}/erc20:${asset.address}`,
471+
: `${caipChainId}/erc20:${asset.address.toLowerCase()}`,
472472
address: asset.address,
473473
chainId: asset.chainId,
474474
};

0 commit comments

Comments
 (0)