Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eip-712-types-generation

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eip-712-types-generation - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

1

dist/getEthTypesFromInputDoc.d.ts

@@ -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

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc