From c197d8d42ae7c773899a2660d4ddc57c58f4608a Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 9 Dec 2024 13:51:48 +0100 Subject: [PATCH] fix: Use BigInt for insight chain IDs --- .../snaps-controllers/src/insights/SnapInsightsController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/snaps-controllers/src/insights/SnapInsightsController.ts b/packages/snaps-controllers/src/insights/SnapInsightsController.ts index 0354c95047..55b2f471c8 100644 --- a/packages/snaps-controllers/src/insights/SnapInsightsController.ts +++ b/packages/snaps-controllers/src/insights/SnapInsightsController.ts @@ -16,7 +16,7 @@ import { } from '@metamask/snaps-rpc-methods'; import type { Json, SnapId } from '@metamask/snaps-sdk'; import { HandlerType } from '@metamask/snaps-utils'; -import { hasProperty } from '@metamask/utils'; +import { hasProperty, hexToBigInt } from '@metamask/utils'; import type { DeleteInterface } from '../interface'; import type { GetAllSnaps, HandleSnapRequest } from '../snaps'; @@ -170,7 +170,7 @@ export class SnapInsightsController extends BaseController< const { id, txParams, chainId, origin } = transaction; // This assumes that the transactions are EVM-compatible for now. - const caipChainId = `eip155:${parseInt(chainId, 16)}`; + const caipChainId = `eip155:${hexToBigInt(chainId).toString(10)}`; const snaps = this.#getSnapsWithPermission( SnapEndowments.TransactionInsight,