diff --git a/bindings/node.js/dist/dts/kzg.d.ts b/bindings/node.js/dist/dts/kzg.d.ts deleted file mode 100644 index c542a1f..0000000 --- a/bindings/node.js/dist/dts/kzg.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare type BLSFieldElement = Uint8Array; -export declare type KZGProof = Uint8Array; -export declare type KZGCommitment = Uint8Array; -export declare type Blob = Uint8Array; -export declare const FIELD_ELEMENTS_PER_BLOB: number; -export declare const BYTES_PER_FIELD_ELEMENT: number; -export declare function loadTrustedSetup(filePath: string): void; -export declare function freeTrustedSetup(): void; -export declare function blobToKzgCommitment(blob: Blob): KZGCommitment; -export declare function computeAggregateKzgProof(blobs: Blob[]): KZGProof; -export declare function verifyAggregateKzgProof(blobs: Blob[], expectedKzgCommitments: KZGCommitment[], kzgAggregatedProof: KZGProof): boolean; diff --git a/bindings/node.js/dist/dts/test.d.ts b/bindings/node.js/dist/dts/test.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/bindings/node.js/dist/dts/test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/bindings/node.js/dist/kzg.js b/bindings/node.js/dist/kzg.js deleted file mode 100644 index d4aeac5..0000000 --- a/bindings/node.js/dist/kzg.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -/** - * The public interface of this module exposes the functions as specified by - * https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/polynomial-commitments.md#kzg - */ -const kzg = require("./kzg.node"); -const FIELD_ELEMENTS_PER_BLOB = kzg.FIELD_ELEMENTS_PER_BLOB; -const BYTES_PER_FIELD_ELEMENT = kzg.BYTES_PER_FIELD_ELEMENT; -// Stored as internal state -let setupHandle; -function requireSetupHandle() { - if (!setupHandle) { - throw new Error("You must call loadTrustedSetup to initialize KZG."); - } - return setupHandle; -} -function loadTrustedSetup(filePath) { - if (setupHandle) { - throw new Error("Call freeTrustedSetup before loading a new trusted setup."); - } - setupHandle = kzg.loadTrustedSetup(filePath); -} -function freeTrustedSetup() { - kzg.freeTrustedSetup(requireSetupHandle()); - setupHandle = undefined; -} -function blobToKzgCommitment(blob) { - return kzg.blobToKzgCommitment(blob, requireSetupHandle()); -} -function computeAggregateKzgProof(blobs) { - return kzg.computeAggregateKzgProof(blobs, requireSetupHandle()); -} -function verifyAggregateKzgProof(blobs, expectedKzgCommitments, kzgAggregatedProof) { - return kzg.verifyAggregateKzgProof(blobs, expectedKzgCommitments, kzgAggregatedProof, requireSetupHandle()); -} - -exports.BYTES_PER_FIELD_ELEMENT = BYTES_PER_FIELD_ELEMENT; -exports.FIELD_ELEMENTS_PER_BLOB = FIELD_ELEMENTS_PER_BLOB; -exports.blobToKzgCommitment = blobToKzgCommitment; -exports.computeAggregateKzgProof = computeAggregateKzgProof; -exports.freeTrustedSetup = freeTrustedSetup; -exports.loadTrustedSetup = loadTrustedSetup; -exports.verifyAggregateKzgProof = verifyAggregateKzgProof;