Skip to content

Commit

Permalink
fix: Use BigInt for insight chain IDs (#2935)
Browse files Browse the repository at this point in the history
Use `BigInt` for insight chain IDs since Ethereum chain IDs have no
sizing limits.
  • Loading branch information
FrederikBolding authored Dec 9, 2024
1 parent d07227b commit 9d8915b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9d8915b

Please sign in to comment.