1.0.16 • Published 7 months ago

@hazae41/networker v1.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
7 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

7 months ago

1.0.1

8 months ago

1.0.16

7 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.11

7 months ago

1.0.15

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.0

1 year ago