eip-712-types-generation
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -6,2 +6,3 @@ interface TypedDataField { | ||
export declare function getEthTypesFromInputDoc(input: object, primaryType?: string): Record<string, TypedDataField[]>; | ||
export declare function getEthTypesFromInputDocEthers(input: object, primaryType?: string): Record<string, TypedDataField[]>; | ||
export {}; |
@@ -14,3 +14,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getEthTypesFromInputDoc = void 0; | ||
exports.getEthTypesFromInputDocEthers = exports.getEthTypesFromInputDoc = void 0; | ||
var json_canonicalize_1 = require("json-canonicalize"); | ||
@@ -32,2 +32,11 @@ function getEthTypesFromInputDoc(input, primaryType) { | ||
exports.getEthTypesFromInputDoc = getEthTypesFromInputDoc; | ||
function getEthTypesFromInputDocEthers(input, primaryType) { | ||
if (primaryType === void 0) { primaryType = "Document"; } | ||
var res = getEthTypesFromInputDocHelper(input, primaryType); | ||
if (!res.has("Proof")) { | ||
throw new Error("No proof was found on input document"); | ||
} | ||
return Object.fromEntries(res); | ||
} | ||
exports.getEthTypesFromInputDocEthers = getEthTypesFromInputDocEthers; | ||
// Given an Input Document, generate Types according to type generation algorithm specified in EIP-712 spec: | ||
@@ -34,0 +43,0 @@ // https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#ref-for-dfn-types-generation-algorithm-2 |
{ | ||
"name": "eip-712-types-generation", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -25,2 +25,11 @@ import { canonicalize } from "json-canonicalize"; | ||
export function getEthTypesFromInputDocEthers(input: object, primaryType: string = "Document"): Record<string, TypedDataField[]> { | ||
const res = getEthTypesFromInputDocHelper(input, primaryType); | ||
if (!res.has("Proof")) { | ||
throw new Error("No proof was found on input document"); | ||
} | ||
return Object.fromEntries(res); | ||
} | ||
// Given an Input Document, generate Types according to type generation algorithm specified in EIP-712 spec: | ||
@@ -27,0 +36,0 @@ // https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#ref-for-dfn-types-generation-algorithm-2 |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154556
641