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

kzg-wasm

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kzg-wasm - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

4

CHANGELOG.md

@@ -8,2 +8,6 @@ # Changelog

## 0.3.1 - 2024-03-14
- Add optional trusted setup parameter to `loadKZG`, PR [#9](https://github.com/ethereumjs/kzg-wasm/pull/9)
## 0.3.0 - 2024-03-14

@@ -10,0 +14,0 @@

4

dist/cjs/index.d.ts

@@ -10,7 +10,7 @@ export type TrustedSetup = {

*
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used
*
* @returns object - the KZG methods required for all 4844 related operations
*/
export declare const loadKZG: () => Promise<{
export declare const loadKZG: (trustedSetup?: TrustedSetup) => Promise<{
loadTrustedSetup: (trustedSetup?: TrustedSetup) => number;

@@ -17,0 +17,0 @@ freeTrustedSetup: () => void;

@@ -10,7 +10,7 @@ "use strict";

*
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used
*
* @returns object - the KZG methods required for all 4844 related operations
*/
const loadKZG = async () => {
const loadKZG = async (trustedSetup = trustedSetup_js_1.default) => {
const module = await (0, kzg_js_1.default)();

@@ -29,5 +29,2 @@ const loadTrustedSetupWasm = module.cwrap('load_trusted_setup_from_wasm', 'number', ['string', 'number', 'string', 'number']);

const loadTrustedSetup = (trustedSetup = trustedSetup_js_1.default) => {
if (trustedSetup === undefined) {
trustedSetup = trustedSetup_js_1.default;
}
return loadTrustedSetupWasm(trustedSetup.g1, trustedSetup.n1, trustedSetup.g2, trustedSetup.n2);

@@ -95,2 +92,3 @@ };

};
loadTrustedSetup(trustedSetup);
return {

@@ -97,0 +95,0 @@ loadTrustedSetup, freeTrustedSetup, blobToKzgCommitment, computeBlobKzgProof, verifyBlobKzgProofBatch, verifyKzgProof, verifyBlobKzgProof

@@ -10,7 +10,7 @@ export type TrustedSetup = {

*
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used
*
* @returns object - the KZG methods required for all 4844 related operations
*/
export declare const loadKZG: () => Promise<{
export declare const loadKZG: (trustedSetup?: TrustedSetup) => Promise<{
loadTrustedSetup: (trustedSetup?: TrustedSetup) => number;

@@ -17,0 +17,0 @@ freeTrustedSetup: () => void;

@@ -7,7 +7,7 @@ import { hexToBytes } from './util.js';

*
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used
*
* @returns object - the KZG methods required for all 4844 related operations
*/
export const loadKZG = async () => {
export const loadKZG = async (trustedSetup = mainnetTrustedSetup) => {
const module = await kzgWasm();

@@ -26,5 +26,2 @@ const loadTrustedSetupWasm = module.cwrap('load_trusted_setup_from_wasm', 'number', ['string', 'number', 'string', 'number']);

const loadTrustedSetup = (trustedSetup = mainnetTrustedSetup) => {
if (trustedSetup === undefined) {
trustedSetup = mainnetTrustedSetup;
}
return loadTrustedSetupWasm(trustedSetup.g1, trustedSetup.n1, trustedSetup.g2, trustedSetup.n2);

@@ -92,2 +89,3 @@ };

};
loadTrustedSetup(trustedSetup);
return {

@@ -94,0 +92,0 @@ loadTrustedSetup, freeTrustedSetup, blobToKzgCommitment, computeBlobKzgProof, verifyBlobKzgProofBatch, verifyKzgProof, verifyBlobKzgProof

{
"name": "kzg-wasm",
"version": "0.3.0",
"description": "",
"version": "0.3.1",
"description": "a WASM compilation of c-kzg-4844",
"scripts": {

@@ -6,0 +6,0 @@ "build": "npm run build:ts && npm run transpileCJS && npm run fixRequire",

@@ -13,7 +13,7 @@ import { hexToBytes } from './util.js'

*
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used
*
* @returns object - the KZG methods required for all 4844 related operations
*/
export const loadKZG = async () => {
export const loadKZG = async (trustedSetup: TrustedSetup = mainnetTrustedSetup) => {
const module = await kzgWasm()

@@ -34,5 +34,2 @@

const loadTrustedSetup = (trustedSetup: TrustedSetup = mainnetTrustedSetup) => {
if (trustedSetup === undefined) {
trustedSetup = mainnetTrustedSetup
}
return loadTrustedSetupWasm(trustedSetup.g1, trustedSetup.n1, trustedSetup.g2, trustedSetup.n2)

@@ -104,2 +101,4 @@ }

loadTrustedSetup(trustedSetup)
return {

@@ -106,0 +105,0 @@ loadTrustedSetup, freeTrustedSetup, blobToKzgCommitment, computeBlobKzgProof, verifyBlobKzgProofBatch, verifyKzgProof, verifyBlobKzgProof

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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