Skip to content

Commit 9d8915b

Browse files
fix: Use BigInt for insight chain IDs (#2935)
Use `BigInt` for insight chain IDs since Ethereum chain IDs have no sizing limits.
1 parent d07227b commit 9d8915b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/snaps-controllers/src/insights/SnapInsightsController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from '@metamask/snaps-rpc-methods';
1717
import type { Json, SnapId } from '@metamask/snaps-sdk';
1818
import { HandlerType } from '@metamask/snaps-utils';
19-
import { hasProperty } from '@metamask/utils';
19+
import { hasProperty, hexToBigInt } from '@metamask/utils';
2020

2121
import type { DeleteInterface } from '../interface';
2222
import type { GetAllSnaps, HandleSnapRequest } from '../snaps';
@@ -170,7 +170,7 @@ export class SnapInsightsController extends BaseController<
170170
const { id, txParams, chainId, origin } = transaction;
171171

172172
// This assumes that the transactions are EVM-compatible for now.
173-
const caipChainId = `eip155:${parseInt(chainId, 16)}`;
173+
const caipChainId = `eip155:${hexToBigInt(chainId).toString(10)}`;
174174

175175
const snaps = this.#getSnapsWithPermission(
176176
SnapEndowments.TransactionInsight,

0 commit comments

Comments
 (0)