Skip to content

Commit

Permalink
remove dynamic import for json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Aug 13, 2024
1 parent c0008c8 commit a7d3c79
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { rpcErrors } from "@toruslabs/openlogin-jrpc";
import { isHexStrict } from "@web3auth/base";
import assert from "assert";
import { BigNumber } from "bignumber.js";
import jsonschema from "jsonschema";

import { TypedMessageParams } from "../../../rpc/interfaces";
import { decGWEIToHexWEI, hexWEIToDecGWEI } from "../../converter";
Expand Down Expand Up @@ -104,7 +105,6 @@ export const validateTypedMessageParams = async (parameters: TypedMessageParams<
}>;

assert.ok(typedData.primaryType in typedData.types, `Primary type of "${typedData.primaryType}" has no type definition.`);
const jsonschema = await import("jsonschema");
const validation = jsonschema.validate(typedData, TYPED_MESSAGE_SCHEMA.properties);
assert.strictEqual(validation.errors.length, 0, "Signing data must conform to EIP-712 schema. See https://git.io/fNtcx.");
chainId = typedData.domain?.chainId;
Expand Down

0 comments on commit a7d3c79

Please sign in to comment.