1.0.16 • Published 9 months ago

@hazae41/networker v1.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

NetWorker

Generate Network secrets in a worker

npm i @hazae41/networker

Node Package 📦

Features

Current features

  • 100% TypeScript and ESM
  • No external dependencies
  • Pre-bundled
  • WebAssembly

Usage

import { NetWorker, NetWorkerCreateParams } from "./worker/index.js";

using worker = new NetWorker()

const chainIdString = "1"
const contractZeroHex = "0xF1eC047cbd662607BBDE9Badd572cf0A23E1130B"
const receiverZeroHex = "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
const nonceZeroHex = "0x9537efb9ece40a1d72241f1fd5dcbb32e8eae43df579d02bf861b339a9126c64"

await using mixin = await worker.createOrThrow({ chainIdString, contractZeroHex, receiverZeroHex, nonceZeroHex })

const minimumZeroHex = "0x0000000000000000000000000000000000000000000000000000000000000001"

const { secretZeroHex, proofZeroHex } = await mixin.generateOrThrow(minimumZeroHex)

const proofValueZeroHex = await mixin.verifyProofOrThrow(proofZeroHex)
const secretValueZeroHex = await mixin.verifySecretOrThrow(secretZeroHex)

console.log(proofValueZeroHex)
console.log(secretValueZeroHex)
1.0.2

10 months ago

1.0.1

10 months ago

1.0.16

9 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.11

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.0

1 year ago