mirror of
https://github.com/privacy-scaling-explorations/zk-kit.git
synced 2026-04-22 03:00:15 -04:00
style: reformat code with prettier
This commit is contained in:
@@ -141,4 +141,3 @@ $ npm run publish # Publish packages on npm.
|
||||
```
|
||||
|
||||
You can see the other npm scripts in the `package.json` file.
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"projects": ["<rootDir>/packages/*"],
|
||||
"coverageThreshold": {
|
||||
"global": {
|
||||
"branches": 30,
|
||||
"functions": 30,
|
||||
"lines": 30,
|
||||
"statements": 30
|
||||
}
|
||||
"projects": ["<rootDir>/packages/*"],
|
||||
"coverageThreshold": {
|
||||
"global": {
|
||||
"branches": 30,
|
||||
"functions": 30,
|
||||
"lines": 30,
|
||||
"statements": 30
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,22 +49,24 @@ yarn add @libsem/identity
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { ZkIdentity, Identity } from "@libsem/identity";
|
||||
import { ZkIdentity, Identity } from "@libsem/identity"
|
||||
```
|
||||
|
||||
```javascript
|
||||
const { ZkIdentity } = require("@libsem/identity");
|
||||
const { ZkIdentity } = require("@libsem/identity")
|
||||
```
|
||||
|
||||
**Mainpulation**
|
||||
|
||||
```typescript
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity);
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity)
|
||||
```
|
||||
|
||||
**Serialization**
|
||||
|
||||
```typescript
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity);
|
||||
const unserialized: Identity = ZkIdentity.unSerializeIdentity(serialized);
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity)
|
||||
const unserialized: Identity = ZkIdentity.unSerializeIdentity(serialized)
|
||||
```
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"transform": {
|
||||
"\\.(ts|tsx)": "ts-jest"
|
||||
},
|
||||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
||||
"moduleFileExtensions": ["ts", "js"],
|
||||
"coveragePathIgnorePatterns": ["/node_modules/", "/test/"],
|
||||
"collectCoverageFrom": ["src/**/*.{js,ts}"]
|
||||
}
|
||||
"transform": {
|
||||
"\\.(ts|tsx)": "ts-jest"
|
||||
},
|
||||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
||||
"moduleFileExtensions": ["ts", "js"],
|
||||
"coveragePathIgnorePatterns": ["/node_modules/", "/test/"],
|
||||
"collectCoverageFrom": ["src/**/*.{js,ts}"]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import typescript from "rollup-plugin-typescript2";
|
||||
import * as fs from "fs";
|
||||
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"));
|
||||
import typescript from "rollup-plugin-typescript2"
|
||||
import * as fs from "fs"
|
||||
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
|
||||
|
||||
const banner = `/**
|
||||
* @module ${pkg.name}
|
||||
@@ -9,14 +9,14 @@ const banner = `/**
|
||||
* @copyright ${pkg.author.name} ${new Date().getFullYear()}
|
||||
* @license ${pkg.license}
|
||||
* @see [Github]{@link ${pkg.homepage}}
|
||||
*/`;
|
||||
*/`
|
||||
|
||||
export default {
|
||||
input: "src/index.ts",
|
||||
output: [
|
||||
{ file: pkg.exports.require, format: "cjs", banner, exports: "auto" },
|
||||
{ file: pkg.exports.import, format: "es", banner },
|
||||
{ file: pkg.exports.import, format: "es", banner }
|
||||
],
|
||||
external: Object.keys(pkg.dependencies),
|
||||
plugins: [typescript({ useTsconfigDeclarationDir: true })],
|
||||
};
|
||||
plugins: [typescript({ useTsconfigDeclarationDir: true })]
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { genRandomIdentity, genIdentityFromSignedMessage, genRandomNumber } from "./strategies";
|
||||
import * as bigintConversion from "bigint-conversion";
|
||||
import * as ciromlibjs from "circomlibjs";
|
||||
import { Identity } from "@libsem/types";
|
||||
import { genRandomIdentity, genIdentityFromSignedMessage, genRandomNumber } from "./strategies"
|
||||
import * as bigintConversion from "bigint-conversion"
|
||||
import * as ciromlibjs from "circomlibjs"
|
||||
import { Identity } from "@libsem/types"
|
||||
|
||||
const poseidonHash = (data: Array<bigint>): bigint => {
|
||||
return ciromlibjs.poseidon(data);
|
||||
};
|
||||
return ciromlibjs.poseidon(data)
|
||||
}
|
||||
|
||||
class ZkIdentity {
|
||||
/**
|
||||
@@ -15,10 +15,10 @@ class ZkIdentity {
|
||||
* @returns Identity
|
||||
*/
|
||||
genIdentity(strategy: "random" | "signedMessage" = "random", metadata: any = {}): Identity {
|
||||
if (strategy === "random") return genRandomIdentity();
|
||||
else if (strategy === "signedMessage") return genIdentityFromSignedMessage(metadata);
|
||||
if (strategy === "random") return genRandomIdentity()
|
||||
else if (strategy === "signedMessage") return genIdentityFromSignedMessage(metadata)
|
||||
|
||||
throw new Error("provided strategy is not supported");
|
||||
throw new Error("provided strategy is not supported")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ class ZkIdentity {
|
||||
* @returns secret
|
||||
*/
|
||||
genSecretFromIdentity(identity: Identity): bigint[] {
|
||||
return [identity.identityNullifier, identity.identityTrapdoor];
|
||||
return [identity.identityNullifier, identity.identityTrapdoor]
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,11 +36,11 @@ class ZkIdentity {
|
||||
* @returns secret
|
||||
*/
|
||||
genRandomSecret(parts = 2): bigint[] {
|
||||
const secret: bigint[] = [];
|
||||
const secret: bigint[] = []
|
||||
for (let i = 0; i < parts; i++) {
|
||||
secret.push(genRandomNumber());
|
||||
secret.push(genRandomNumber())
|
||||
}
|
||||
return secret;
|
||||
return secret
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,8 +49,8 @@ class ZkIdentity {
|
||||
* @returns identity commitment
|
||||
*/
|
||||
genIdentityCommitmentFromSecret(secret: bigint[]): bigint {
|
||||
const secretHash = poseidonHash(secret);
|
||||
return poseidonHash([secretHash]);
|
||||
const secretHash = poseidonHash(secret)
|
||||
return poseidonHash([secretHash])
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,8 +59,8 @@ class ZkIdentity {
|
||||
* @returns identity commitment
|
||||
*/
|
||||
genIdentityCommitment(identity: Identity): bigint {
|
||||
const secretHash = poseidonHash([identity.identityNullifier, identity.identityTrapdoor]);
|
||||
return poseidonHash([secretHash]);
|
||||
const secretHash = poseidonHash([identity.identityNullifier, identity.identityTrapdoor])
|
||||
return poseidonHash([secretHash])
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,8 +69,8 @@ class ZkIdentity {
|
||||
* @returns serialized identity
|
||||
*/
|
||||
serializeIdentity(identity: Identity): string {
|
||||
const data = [identity.identityNullifier.toString(16), identity.identityTrapdoor.toString(16)];
|
||||
return JSON.stringify(data);
|
||||
const data = [identity.identityNullifier.toString(16), identity.identityTrapdoor.toString(16)]
|
||||
return JSON.stringify(data)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,12 +79,12 @@ class ZkIdentity {
|
||||
* @returns ZkIdentity
|
||||
*/
|
||||
unSerializeIdentity(serialisedIdentity: string): Identity {
|
||||
const data = JSON.parse(serialisedIdentity);
|
||||
const data = JSON.parse(serialisedIdentity)
|
||||
return {
|
||||
identityNullifier: bigintConversion.hexToBigint(data[0]),
|
||||
identityTrapdoor: bigintConversion.hexToBigint(data[1]),
|
||||
};
|
||||
identityTrapdoor: bigintConversion.hexToBigint(data[1])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default new ZkIdentity();
|
||||
export default new ZkIdentity()
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import ZkIdentity from './identity';
|
||||
import { Identity } from "@libsem/types";
|
||||
import ZkIdentity from "./identity"
|
||||
import { Identity } from "@libsem/types"
|
||||
|
||||
export {
|
||||
ZkIdentity,
|
||||
Identity
|
||||
}
|
||||
export { ZkIdentity, Identity }
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import * as crypto from 'crypto';
|
||||
import * as bigintConversion from 'bigint-conversion';
|
||||
import { sha256 as _sha256 } from "js-sha256";
|
||||
import { Identity } from '@libsem/types';
|
||||
import * as crypto from "crypto"
|
||||
import * as bigintConversion from "bigint-conversion"
|
||||
import { sha256 as _sha256 } from "js-sha256"
|
||||
import { Identity } from "@libsem/types"
|
||||
|
||||
const genRandomNumber = (numBytes = 31): bigint => {
|
||||
return bigintConversion.bufToBigint(crypto.randomBytes(numBytes))
|
||||
return bigintConversion.bufToBigint(crypto.randomBytes(numBytes))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12,10 +12,10 @@ const genRandomNumber = (numBytes = 31): bigint => {
|
||||
* @returns Identity
|
||||
*/
|
||||
const genRandomIdentity = (): Identity => {
|
||||
return {
|
||||
identityNullifier: genRandomNumber(31),
|
||||
identityTrapdoor: genRandomNumber(31)
|
||||
}
|
||||
return {
|
||||
identityNullifier: genRandomNumber(31),
|
||||
identityTrapdoor: genRandomNumber(31)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,26 +24,22 @@ const genRandomIdentity = (): Identity => {
|
||||
* @returns Identity
|
||||
*/
|
||||
const genIdentityFromSignedMessage = (metadata: any): Identity => {
|
||||
const sha256 = (message: string): string => {
|
||||
const hash = _sha256.create()
|
||||
hash.update(message)
|
||||
return hash.hex()
|
||||
}
|
||||
const sha256 = (message: string): string => {
|
||||
const hash = _sha256.create()
|
||||
hash.update(message)
|
||||
return hash.hex()
|
||||
}
|
||||
|
||||
const { signedMessage } = metadata;
|
||||
const { signedMessage } = metadata
|
||||
|
||||
const messageHash = sha256(signedMessage)
|
||||
const identityNullifier = bigintConversion.hexToBigint(sha256(`${messageHash}identity_nullifier`))
|
||||
const identityTrapdoor = bigintConversion.hexToBigint(sha256(`${messageHash}identity_trapdoor`))
|
||||
const messageHash = sha256(signedMessage)
|
||||
const identityNullifier = bigintConversion.hexToBigint(sha256(`${messageHash}identity_nullifier`))
|
||||
const identityTrapdoor = bigintConversion.hexToBigint(sha256(`${messageHash}identity_trapdoor`))
|
||||
|
||||
return {
|
||||
identityTrapdoor,
|
||||
identityNullifier
|
||||
}
|
||||
return {
|
||||
identityTrapdoor,
|
||||
identityNullifier
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
genRandomIdentity,
|
||||
genIdentityFromSignedMessage,
|
||||
genRandomNumber
|
||||
}
|
||||
export { genRandomIdentity, genIdentityFromSignedMessage, genRandomNumber }
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
import { ZkIdentity } from "../src";
|
||||
import { Identity } from "../../types";
|
||||
import { ZkIdentity } from "../src"
|
||||
import { Identity } from "../../types"
|
||||
|
||||
describe("Semaphore identity", () => {
|
||||
describe("Create identity", () => {
|
||||
it("Should create a Semaphore identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
expect(typeof identity).toEqual("object")
|
||||
})
|
||||
it("Should generate secret from identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const identitySecret: bigint[] = ZkIdentity.genSecretFromIdentity(identity);
|
||||
expect(identitySecret.length).toEqual(2);
|
||||
expect(identitySecret[0]).toEqual(identity.identityNullifier);
|
||||
expect(identitySecret[1]).toEqual(identity.identityTrapdoor);
|
||||
expect(typeof identitySecret).toEqual("object")
|
||||
})
|
||||
|
||||
it("Should generate random secret", async () => {
|
||||
const secretParts = 5;
|
||||
const identitySecret: bigint[] = ZkIdentity.genRandomSecret(secretParts);
|
||||
expect(identitySecret.length).toEqual(5);
|
||||
expect(typeof identitySecret).toEqual("object")
|
||||
})
|
||||
|
||||
it("Should generate identity commitment from identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity);
|
||||
expect(typeof identityCommitment).toEqual("bigint")
|
||||
})
|
||||
|
||||
it("Should generate identity commitment from random secret", async () => {
|
||||
const secretParts = 5;
|
||||
const identitySecret: bigint[] = ZkIdentity.genRandomSecret(secretParts);
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitmentFromSecret(identitySecret);
|
||||
expect(typeof identityCommitment).toEqual("bigint")
|
||||
})
|
||||
|
||||
it("Should serialize identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity);
|
||||
expect(typeof serialized).toEqual("string")
|
||||
})
|
||||
it("Should unserialize identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity);
|
||||
const unserialized: Identity = ZkIdentity.unSerializeIdentity(serialized);
|
||||
expect(unserialized).toStrictEqual(identity)
|
||||
})
|
||||
describe("Create identity", () => {
|
||||
it("Should create a Semaphore identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
expect(typeof identity).toEqual("object")
|
||||
})
|
||||
it("Should generate secret from identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const identitySecret: bigint[] = ZkIdentity.genSecretFromIdentity(identity)
|
||||
expect(identitySecret.length).toEqual(2)
|
||||
expect(identitySecret[0]).toEqual(identity.identityNullifier)
|
||||
expect(identitySecret[1]).toEqual(identity.identityTrapdoor)
|
||||
expect(typeof identitySecret).toEqual("object")
|
||||
})
|
||||
|
||||
it("Should generate random secret", async () => {
|
||||
const secretParts = 5
|
||||
const identitySecret: bigint[] = ZkIdentity.genRandomSecret(secretParts)
|
||||
expect(identitySecret.length).toEqual(5)
|
||||
expect(typeof identitySecret).toEqual("object")
|
||||
})
|
||||
|
||||
it("Should generate identity commitment from identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity)
|
||||
expect(typeof identityCommitment).toEqual("bigint")
|
||||
})
|
||||
|
||||
it("Should generate identity commitment from random secret", async () => {
|
||||
const secretParts = 5
|
||||
const identitySecret: bigint[] = ZkIdentity.genRandomSecret(secretParts)
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitmentFromSecret(identitySecret)
|
||||
expect(typeof identityCommitment).toEqual("bigint")
|
||||
})
|
||||
|
||||
it("Should serialize identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity)
|
||||
expect(typeof serialized).toEqual("string")
|
||||
})
|
||||
it("Should unserialize identity", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity)
|
||||
const unserialized: Identity = ZkIdentity.unSerializeIdentity(serialized)
|
||||
expect(unserialized).toStrictEqual(identity)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -49,19 +49,24 @@ yarn add @libsem/protocols
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { ZkIdentity, Identity } from '@libsem/identity';
|
||||
import { Semaphore, MerkleProof, IProof, generateMerkleProof, genExternalNullifier, genSignalHash } from '@libsem/protocols';
|
||||
|
||||
|
||||
import { ZkIdentity, Identity } from "@libsem/identity"
|
||||
import {
|
||||
Semaphore,
|
||||
MerkleProof,
|
||||
IProof,
|
||||
generateMerkleProof,
|
||||
genExternalNullifier,
|
||||
genSignalHash
|
||||
} from "@libsem/protocols"
|
||||
```
|
||||
```javascript
|
||||
|
||||
const { ZkIdentity } = require('@libsem/identity');
|
||||
const { Semaphore, Rln, NRln, generateMerkleProof, genExternalNullifier, genSignalHash } = require('@libsem/protocols');
|
||||
```javascript
|
||||
const { ZkIdentity } = require("@libsem/identity")
|
||||
const { Semaphore, Rln, NRln, generateMerkleProof, genExternalNullifier, genSignalHash } = require("@libsem/protocols")
|
||||
```
|
||||
|
||||
**Merkle Proofs**
|
||||
Generate merkle proof for your identity given the array of registered identity commitments
|
||||
Generate merkle proof for your identity given the array of registered identity commitments
|
||||
|
||||
```typescript
|
||||
const identityCommitments: Array<bigint> = [...];
|
||||
@@ -72,20 +77,21 @@ const merkleProof: MerkleProof = generateMerkleProof(TREE_DEPTH, ZERO_VALUE, NUM
|
||||
|
||||
**Semaphore**
|
||||
|
||||
In order to create semaphore proof, make sure to
|
||||
In order to create semaphore proof, make sure to
|
||||
|
||||
```typescript
|
||||
const witness = Semaphore.genWitness(identity, merkleProof, externalNullifier, signal);
|
||||
const fullProof = await Semaphore.genProof(witness, wasmFilePath, finalZkeyPath);
|
||||
const witness = Semaphore.genWitness(identity, merkleProof, externalNullifier, signal)
|
||||
const fullProof = await Semaphore.genProof(witness, wasmFilePath, finalZkeyPath)
|
||||
```
|
||||
|
||||
**Serialization**
|
||||
|
||||
```typescript
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity);
|
||||
const unserialized: Identity = ZkIdentity.unSerializeIdentity(serialized);
|
||||
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity)
|
||||
const unserialized: Identity = ZkIdentity.unSerializeIdentity(serialized)
|
||||
```
|
||||
|
||||
## 📜 Final Note
|
||||
|
||||
For full examples of how to integrate with contracts check https://github.com/appliedzkp/semaphore repository.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"transform": {
|
||||
"\\.(ts|tsx)": "ts-jest"
|
||||
},
|
||||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
||||
"moduleFileExtensions": ["ts", "js"],
|
||||
"coveragePathIgnorePatterns": ["/node_modules/", "/test/"],
|
||||
"collectCoverageFrom": ["src/**/*.{js,ts}"]
|
||||
}
|
||||
"transform": {
|
||||
"\\.(ts|tsx)": "ts-jest"
|
||||
},
|
||||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
||||
"moduleFileExtensions": ["ts", "js"],
|
||||
"coveragePathIgnorePatterns": ["/node_modules/", "/test/"],
|
||||
"collectCoverageFrom": ["src/**/*.{js,ts}"]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import typescript from "rollup-plugin-typescript2"
|
||||
import * as fs from 'fs';
|
||||
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"));
|
||||
import * as fs from "fs"
|
||||
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
|
||||
|
||||
const banner = `/**
|
||||
* @module ${pkg.name}
|
||||
@@ -9,7 +9,7 @@ const banner = `/**
|
||||
* @copyright ${pkg.author.name} ${new Date().getFullYear()}
|
||||
* @license ${pkg.license}
|
||||
* @see [Github]{@link ${pkg.homepage}}
|
||||
*/`;
|
||||
*/`
|
||||
|
||||
export default {
|
||||
input: "src/index.ts",
|
||||
|
||||
@@ -1,18 +1,7 @@
|
||||
import Semaphore from './semaphore';
|
||||
import Rln from './rln';
|
||||
import NRln from './nRln';
|
||||
import { generateMerkleProof, genExternalNullifier, genSignalHash } from './utils';
|
||||
import { Identity, MerkleProof, IProof } from "@libsem/types";
|
||||
import Semaphore from "./semaphore"
|
||||
import Rln from "./rln"
|
||||
import NRln from "./nRln"
|
||||
import { generateMerkleProof, genExternalNullifier, genSignalHash } from "./utils"
|
||||
import { Identity, MerkleProof, IProof } from "@libsem/types"
|
||||
|
||||
|
||||
export {
|
||||
Semaphore,
|
||||
Rln,
|
||||
NRln,
|
||||
generateMerkleProof,
|
||||
genExternalNullifier,
|
||||
genSignalHash,
|
||||
Identity,
|
||||
MerkleProof,
|
||||
IProof
|
||||
}
|
||||
export { Semaphore, Rln, NRln, generateMerkleProof, genExternalNullifier, genSignalHash, Identity, MerkleProof, IProof }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ZkProtocol } from "./zk-protocol";
|
||||
import { genSignalHash, poseidonHash } from "./utils";
|
||||
import { Fq } from "./utils";
|
||||
import { ZkProtocol } from "./zk-protocol"
|
||||
import { genSignalHash, poseidonHash } from "./utils"
|
||||
import { Fq } from "./utils"
|
||||
|
||||
class NRln extends ZkProtocol {
|
||||
/**
|
||||
@@ -12,14 +12,20 @@ class NRln extends ZkProtocol {
|
||||
* @param shouldHash should signal be hashed before broadcast
|
||||
* @returns rln witness
|
||||
*/
|
||||
genWitness(identitySecret: Array<bigint>, merkleProof: any, epoch: string | bigint, signal: string, shouldHash = true): any {
|
||||
genWitness(
|
||||
identitySecret: Array<bigint>,
|
||||
merkleProof: any,
|
||||
epoch: string | bigint,
|
||||
signal: string,
|
||||
shouldHash = true
|
||||
): any {
|
||||
return {
|
||||
identity_secret: identitySecret,
|
||||
path_elements: merkleProof.pathElements,
|
||||
identity_path_index: merkleProof.indices,
|
||||
x: shouldHash ? genSignalHash(signal) : signal,
|
||||
epoch,
|
||||
};
|
||||
epoch
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,23 +37,23 @@ class NRln extends ZkProtocol {
|
||||
* @returns
|
||||
*/
|
||||
calculateOutput(identitySecret: Array<bigint>, epoch: bigint, x: bigint, limit: number): Array<bigint> {
|
||||
const a0 = poseidonHash(identitySecret);
|
||||
const a0 = poseidonHash(identitySecret)
|
||||
|
||||
const coeffs: Array<bigint> = [];
|
||||
let tmpX = x;
|
||||
const coeffs: Array<bigint> = []
|
||||
let tmpX = x
|
||||
|
||||
coeffs.push(poseidonHash([identitySecret[0], epoch]));
|
||||
let y: bigint = Fq.add(Fq.mul(coeffs[0], tmpX), a0);
|
||||
coeffs.push(poseidonHash([identitySecret[0], epoch]))
|
||||
let y: bigint = Fq.add(Fq.mul(coeffs[0], tmpX), a0)
|
||||
|
||||
for (let i = 1; i < limit; i++) {
|
||||
tmpX = Fq.mul(x, tmpX);
|
||||
tmpX = Fq.mul(x, tmpX)
|
||||
|
||||
coeffs.push(poseidonHash([identitySecret[i], epoch]));
|
||||
y = Fq.add(y, Fq.mul(coeffs[i], tmpX));
|
||||
coeffs.push(poseidonHash([identitySecret[i], epoch]))
|
||||
y = Fq.add(y, Fq.mul(coeffs[i], tmpX))
|
||||
}
|
||||
|
||||
const nullifier: bigint = this.genNullifier(coeffs);
|
||||
return [y, nullifier];
|
||||
const nullifier: bigint = this.genNullifier(coeffs)
|
||||
return [y, nullifier]
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +62,7 @@ class NRln extends ZkProtocol {
|
||||
* @returns slashing nullifier
|
||||
*/
|
||||
genNullifier(coeffs: Array<bigint>): bigint {
|
||||
return poseidonHash(coeffs);
|
||||
return poseidonHash(coeffs)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,21 +72,20 @@ class NRln extends ZkProtocol {
|
||||
* @returns identity secret
|
||||
*/
|
||||
retrieveSecret(xs: Array<bigint>, ys: Array<bigint>): bigint {
|
||||
if (xs.length !== ys.length) throw new Error("x and y arrays must be of same size");
|
||||
const numOfPoints: number = xs.length;
|
||||
let f0 = BigInt(0);
|
||||
if (xs.length !== ys.length) throw new Error("x and y arrays must be of same size")
|
||||
const numOfPoints: number = xs.length
|
||||
let f0 = BigInt(0)
|
||||
for (let i = 0; i < numOfPoints; i++) {
|
||||
let p = BigInt(1);
|
||||
let p = BigInt(1)
|
||||
for (let j = 0; j < numOfPoints; j++) {
|
||||
if (j !== i) {
|
||||
p = Fq.mul(p, Fq.div(xs[j], Fq.sub(xs[j], xs[i])));
|
||||
p = Fq.mul(p, Fq.div(xs[j], Fq.sub(xs[j], xs[i])))
|
||||
}
|
||||
}
|
||||
f0 = Fq.add(f0, Fq.mul(ys[i], p));
|
||||
f0 = Fq.add(f0, Fq.mul(ys[i], p))
|
||||
}
|
||||
return f0;
|
||||
return f0
|
||||
}
|
||||
}
|
||||
|
||||
export default new NRln();
|
||||
|
||||
export default new NRln()
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { ZkProtocol } from "./zk-protocol";
|
||||
import { genSignalHash, poseidonHash } from "./utils";
|
||||
import { Fq } from "./utils";
|
||||
|
||||
import { ZkProtocol } from "./zk-protocol"
|
||||
import { genSignalHash, poseidonHash } from "./utils"
|
||||
import { Fq } from "./utils"
|
||||
|
||||
class Rln extends ZkProtocol {
|
||||
|
||||
/**
|
||||
* Creates witness for rln proof
|
||||
* @param identitySecret identity secret
|
||||
@@ -15,65 +13,71 @@ class Rln extends ZkProtocol {
|
||||
* @param shouldHash should signal be hashed before broadcast
|
||||
* @returns rln witness
|
||||
*/
|
||||
genWitness(identitySecret: bigint, merkleProof: any, epoch: string | bigint, signal: string, rlnIdentifier: bigint, shouldHash = true): any {
|
||||
return {
|
||||
identity_secret: identitySecret,
|
||||
path_elements: merkleProof.pathElements,
|
||||
identity_path_index: merkleProof.indices,
|
||||
x: shouldHash ? genSignalHash(signal): signal,
|
||||
epoch,
|
||||
rln_identifier: rlnIdentifier,
|
||||
}
|
||||
genWitness(
|
||||
identitySecret: bigint,
|
||||
merkleProof: any,
|
||||
epoch: string | bigint,
|
||||
signal: string,
|
||||
rlnIdentifier: bigint,
|
||||
shouldHash = true
|
||||
): any {
|
||||
return {
|
||||
identity_secret: identitySecret,
|
||||
path_elements: merkleProof.pathElements,
|
||||
identity_path_index: merkleProof.indices,
|
||||
x: shouldHash ? genSignalHash(signal) : signal,
|
||||
epoch,
|
||||
rln_identifier: rlnIdentifier
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates
|
||||
* @param identitySecret identity secret
|
||||
* @param epoch epoch on which signal is broadcasted
|
||||
* @param rlnIdentifier unique identifier of rln dapp
|
||||
* @param x signal hash
|
||||
* @returns y & slashing nullfier
|
||||
*/
|
||||
calculateOutput(identitySecret: bigint, epoch: bigint, rlnIdentifier: bigint, x: bigint): Array<bigint> {
|
||||
const a1: bigint = poseidonHash([identitySecret, epoch, rlnIdentifier]);
|
||||
const y: bigint = Fq.normalize(a1 * x + identitySecret);
|
||||
const nullifier = this.genNullifier(a1, rlnIdentifier);
|
||||
return [y, nullifier]
|
||||
}
|
||||
/**
|
||||
* Calculates
|
||||
* @param identitySecret identity secret
|
||||
* @param epoch epoch on which signal is broadcasted
|
||||
* @param rlnIdentifier unique identifier of rln dapp
|
||||
* @param x signal hash
|
||||
* @returns y & slashing nullfier
|
||||
*/
|
||||
calculateOutput(identitySecret: bigint, epoch: bigint, rlnIdentifier: bigint, x: bigint): Array<bigint> {
|
||||
const a1: bigint = poseidonHash([identitySecret, epoch, rlnIdentifier])
|
||||
const y: bigint = Fq.normalize(a1 * x + identitySecret)
|
||||
const nullifier = this.genNullifier(a1, rlnIdentifier)
|
||||
return [y, nullifier]
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param a1 y = a1 * x + a0 (a1 = poseidonHash(identity secret, epoch, rlnIdentifier))
|
||||
* @param rlnIdentifier unique identifier of rln dapp
|
||||
* @returns rln slashing nullifier
|
||||
*/
|
||||
genNullifier(a1: bigint, rlnIdentifier: bigint): bigint {
|
||||
return poseidonHash([a1, rlnIdentifier]);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param a1 y = a1 * x + a0 (a1 = poseidonHash(identity secret, epoch, rlnIdentifier))
|
||||
* @param rlnIdentifier unique identifier of rln dapp
|
||||
* @returns rln slashing nullifier
|
||||
*/
|
||||
genNullifier(a1: bigint, rlnIdentifier: bigint): bigint {
|
||||
return poseidonHash([a1, rlnIdentifier])
|
||||
}
|
||||
|
||||
/**
|
||||
* When spam occurs, identity secret can be retrieved
|
||||
* @param x1 x1
|
||||
* @param x2 x2
|
||||
* @param y1 y1
|
||||
* @param y2 y2
|
||||
* @returns identity secret
|
||||
*/
|
||||
retrieveSecret(x1: bigint, x2:bigint, y1:bigint, y2:bigint): bigint {
|
||||
const slope = Fq.div(Fq.sub(y2, y1), Fq.sub(x2, x1))
|
||||
const privateKey = Fq.sub(y1, Fq.mul(slope, x1));
|
||||
return Fq.normalize(privateKey);
|
||||
}
|
||||
/**
|
||||
* When spam occurs, identity secret can be retrieved
|
||||
* @param x1 x1
|
||||
* @param x2 x2
|
||||
* @param y1 y1
|
||||
* @param y2 y2
|
||||
* @returns identity secret
|
||||
*/
|
||||
retrieveSecret(x1: bigint, x2: bigint, y1: bigint, y2: bigint): bigint {
|
||||
const slope = Fq.div(Fq.sub(y2, y1), Fq.sub(x2, x1))
|
||||
const privateKey = Fq.sub(y1, Fq.mul(slope, x1))
|
||||
return Fq.normalize(privateKey)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns unique identifier of rln dapp
|
||||
*/
|
||||
|
||||
genIdentifier(): bigint {
|
||||
return Fq.random();
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @returns unique identifier of rln dapp
|
||||
*/
|
||||
|
||||
genIdentifier(): bigint {
|
||||
return Fq.random()
|
||||
}
|
||||
}
|
||||
|
||||
export default new Rln();
|
||||
export default new Rln()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ZkProtocol } from "./zk-protocol";
|
||||
import { genSignalHash, poseidonHash } from "./utils";
|
||||
import { Identity, MerkleProof } from "@libsem/types";
|
||||
import { ZkProtocol } from "./zk-protocol"
|
||||
import { genSignalHash, poseidonHash } from "./utils"
|
||||
import { Identity, MerkleProof } from "@libsem/types"
|
||||
|
||||
class Semaphore extends ZkProtocol {
|
||||
/**
|
||||
@@ -25,8 +25,8 @@ class Semaphore extends ZkProtocol {
|
||||
identity_path_index: merkleProof.indices,
|
||||
path_elements: merkleProof.pathElements,
|
||||
external_nullifier: externalNullifier,
|
||||
signal_hash: shouldHash ? genSignalHash(signal) : signal,
|
||||
};
|
||||
signal_hash: shouldHash ? genSignalHash(signal) : signal
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,9 +37,8 @@ class Semaphore extends ZkProtocol {
|
||||
* @returns
|
||||
*/
|
||||
genNullifierHash(externalNullifier: string | bigint, identityNullifier: string | bigint, nLevels: number): bigint {
|
||||
return poseidonHash([BigInt(externalNullifier), BigInt(identityNullifier), BigInt(nLevels)]);
|
||||
return poseidonHash([BigInt(externalNullifier), BigInt(identityNullifier), BigInt(nLevels)])
|
||||
}
|
||||
}
|
||||
|
||||
export default new Semaphore();
|
||||
|
||||
export default new Semaphore()
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
/* eslint @typescript-eslint/no-var-requires: "off" */
|
||||
const Tree = require("incrementalquintree/build/IncrementalQuinTree");
|
||||
import * as ciromlibjs from "circomlibjs";
|
||||
import * as ethers from "ethers";
|
||||
import { MerkleProof } from "@libsem/types";
|
||||
const Tree = require("incrementalquintree/build/IncrementalQuinTree")
|
||||
import * as ciromlibjs from "circomlibjs"
|
||||
import * as ethers from "ethers"
|
||||
import { MerkleProof } from "@libsem/types"
|
||||
|
||||
export const SNARK_FIELD_SIZE = BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");
|
||||
export const SNARK_FIELD_SIZE = BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617")
|
||||
|
||||
const ZqField = require("ffjavascript").ZqField;
|
||||
export const Fq = new ZqField(SNARK_FIELD_SIZE);
|
||||
const ZqField = require("ffjavascript").ZqField
|
||||
export const Fq = new ZqField(SNARK_FIELD_SIZE)
|
||||
|
||||
type IncrementalQuinTree = any;
|
||||
type IncrementalQuinTree = any
|
||||
|
||||
export const poseidonHash = (data: Array<bigint>): bigint => {
|
||||
return ciromlibjs.poseidon(data);
|
||||
};
|
||||
return ciromlibjs.poseidon(data)
|
||||
}
|
||||
|
||||
export const genSignalHash = (signal: string): bigint => {
|
||||
const converted = ethers.utils.hexlify(ethers.utils.toUtf8Bytes(signal));
|
||||
return BigInt(ethers.utils.solidityKeccak256(["bytes"], [converted])) >> BigInt(8);
|
||||
};
|
||||
const converted = ethers.utils.hexlify(ethers.utils.toUtf8Bytes(signal))
|
||||
return BigInt(ethers.utils.solidityKeccak256(["bytes"], [converted])) >> BigInt(8)
|
||||
}
|
||||
|
||||
export const genExternalNullifier = (plaintext: string): string => {
|
||||
const _cutOrExpandHexToBytes = (hexStr: string, bytes: number): string => {
|
||||
const len = bytes * 2;
|
||||
const len = bytes * 2
|
||||
|
||||
const h = hexStr.slice(2, len + 2);
|
||||
return "0x" + h.padStart(len, "0");
|
||||
};
|
||||
const h = hexStr.slice(2, len + 2)
|
||||
return "0x" + h.padStart(len, "0")
|
||||
}
|
||||
|
||||
const hashed = ethers.utils.solidityKeccak256(["string"], [plaintext]);
|
||||
return _cutOrExpandHexToBytes("0x" + hashed.slice(8), 32);
|
||||
};
|
||||
const hashed = ethers.utils.solidityKeccak256(["string"], [plaintext])
|
||||
return _cutOrExpandHexToBytes("0x" + hashed.slice(8), 32)
|
||||
}
|
||||
|
||||
export const createTree = (depth: number, zeroValue: number | BigInt, leavesPerNode: number): IncrementalQuinTree => {
|
||||
return new Tree.IncrementalQuinTree(depth, zeroValue, leavesPerNode, poseidonHash);
|
||||
};
|
||||
return new Tree.IncrementalQuinTree(depth, zeroValue, leavesPerNode, poseidonHash)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates merkle proof
|
||||
@@ -52,18 +52,17 @@ export const generateMerkleProof = (
|
||||
leaves: Array<bigint | string>,
|
||||
leaf: bigint | string
|
||||
): MerkleProof => {
|
||||
const tree: IncrementalQuinTree = new Tree.IncrementalQuinTree(depth, zeroValue, leavesPerNode, poseidonHash);
|
||||
const leafIndex = leaves.indexOf(leaf);
|
||||
if (leafIndex === -1) throw new Error("Leaf does not exists");
|
||||
const tree: IncrementalQuinTree = new Tree.IncrementalQuinTree(depth, zeroValue, leavesPerNode, poseidonHash)
|
||||
const leafIndex = leaves.indexOf(leaf)
|
||||
if (leafIndex === -1) throw new Error("Leaf does not exists")
|
||||
|
||||
for (const leaf of leaves) {
|
||||
tree.insert(leaf);
|
||||
tree.insert(leaf)
|
||||
}
|
||||
|
||||
const merkleProof = tree.genMerklePath(leafIndex);
|
||||
const merkleProof = tree.genMerklePath(leafIndex)
|
||||
return {
|
||||
root: tree.root,
|
||||
...merkleProof,
|
||||
};
|
||||
};
|
||||
|
||||
...merkleProof
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint @typescript-eslint/no-var-requires: "off" */
|
||||
const { groth16 } = require("snarkjs");
|
||||
import { SNARK_FIELD_SIZE } from "./utils";
|
||||
import { IProof } from "@libsem/types";
|
||||
const { groth16 } = require("snarkjs")
|
||||
import { SNARK_FIELD_SIZE } from "./utils"
|
||||
import { IProof } from "@libsem/types"
|
||||
|
||||
export class ZkProtocol {
|
||||
/**
|
||||
@@ -12,7 +12,7 @@ export class ZkProtocol {
|
||||
* @returns zero knowledge proof
|
||||
*/
|
||||
genProof(grothInput: any, wasmFilePath: string, finalZkeyPath: string): Promise<IProof> {
|
||||
return groth16.fullProve(grothInput, wasmFilePath, finalZkeyPath);
|
||||
return groth16.fullProve(grothInput, wasmFilePath, finalZkeyPath)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -22,8 +22,8 @@ export class ZkProtocol {
|
||||
* @returns Is provided proof valid
|
||||
*/
|
||||
verifyProof(vKey: string, fullProof: IProof): Promise<boolean> {
|
||||
const { proof, publicSignals } = fullProof;
|
||||
return groth16.verify(vKey, publicSignals, proof);
|
||||
const { proof, publicSignals } = fullProof
|
||||
return groth16.verify(vKey, publicSignals, proof)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,17 +32,16 @@ export class ZkProtocol {
|
||||
* @returns Proof
|
||||
*/
|
||||
packToSolidityProof(fullProof: IProof) {
|
||||
const { proof, publicSignals } = fullProof;
|
||||
const { proof, publicSignals } = fullProof
|
||||
|
||||
return {
|
||||
a: proof.pi_a.slice(0, 2),
|
||||
b: proof.pi_b.map((x: any) => x.reverse()).slice(0, 2),
|
||||
c: proof.pi_c.slice(0, 2),
|
||||
inputs: publicSignals.map((x: any) => {
|
||||
x = BigInt(x);
|
||||
return (x % SNARK_FIELD_SIZE).toString();
|
||||
}),
|
||||
};
|
||||
x = BigInt(x)
|
||||
return (x % SNARK_FIELD_SIZE).toString()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
import { Fq } from "../src/utils";
|
||||
import { Fq } from "../src/utils"
|
||||
|
||||
describe("Field arithmetics", () => {
|
||||
describe("Test bunch of calculations in Fq", () => {
|
||||
it("Retrieve n from y = kx + n", () => {
|
||||
const k = Fq.random();
|
||||
const n = Fq.random();
|
||||
|
||||
const x1 = Fq.random();
|
||||
const y1 = Fq.add(Fq.mul(k, x1), n);
|
||||
|
||||
const x2 = Fq.random();
|
||||
const y2 = Fq.add(Fq.mul(k, x2), n);
|
||||
|
||||
const ydiff = Fq.sub(y2, y1);
|
||||
const xdiff = Fq.sub(x2, x1);
|
||||
|
||||
const slope = Fq.div(ydiff, xdiff);
|
||||
const retrieved = Fq.sub(y1, Fq.mul(x1, slope));
|
||||
|
||||
expect(retrieved).toEqual(n)
|
||||
})
|
||||
it("Lagrange in Fq", () => {
|
||||
const degree = 4;
|
||||
describe("Test bunch of calculations in Fq", () => {
|
||||
it("Retrieve n from y = kx + n", () => {
|
||||
const k = Fq.random()
|
||||
const n = Fq.random()
|
||||
|
||||
const coeffs: Array<bigint> = [BigInt(7), BigInt(6), BigInt(9), BigInt(1), BigInt(7)];
|
||||
const xs: Array<bigint> = [];
|
||||
|
||||
for(let i=0;i<degree;i++) {
|
||||
xs.push(BigInt(i))
|
||||
}
|
||||
|
||||
const ys: Array<bigint> = [];
|
||||
for (let i=0;i<degree;i++) {
|
||||
const x: bigint = xs[i];
|
||||
let tmpX: bigint = x;
|
||||
let y: bigint = coeffs[0];
|
||||
for(let j=1;j<degree + 1;j++) {
|
||||
y = Fq.add(y, Fq.mul(tmpX, coeffs[j]))
|
||||
tmpX = Fq.mul(tmpX, x);
|
||||
}
|
||||
ys.push(y)
|
||||
}
|
||||
|
||||
let f0 = BigInt(0);
|
||||
for(let i = 0; i < degree; i++) {
|
||||
let p = BigInt(1);
|
||||
for(let j = 0; j < degree; j++) {
|
||||
if(j !== i) {
|
||||
p = Fq.mul(p, Fq.div(xs[j], Fq.sub(xs[j], xs[i])))
|
||||
}
|
||||
}
|
||||
f0 = Fq.add(f0, Fq.mul(ys[i], p));
|
||||
}
|
||||
|
||||
expect(Fq.eq(f0, coeffs[0])).toBe(true);
|
||||
})
|
||||
const x1 = Fq.random()
|
||||
const y1 = Fq.add(Fq.mul(k, x1), n)
|
||||
|
||||
const x2 = Fq.random()
|
||||
const y2 = Fq.add(Fq.mul(k, x2), n)
|
||||
|
||||
const ydiff = Fq.sub(y2, y1)
|
||||
const xdiff = Fq.sub(x2, x1)
|
||||
|
||||
const slope = Fq.div(ydiff, xdiff)
|
||||
const retrieved = Fq.sub(y1, Fq.mul(x1, slope))
|
||||
|
||||
expect(retrieved).toEqual(n)
|
||||
})
|
||||
})
|
||||
it("Lagrange in Fq", () => {
|
||||
const degree = 4
|
||||
|
||||
const coeffs: Array<bigint> = [BigInt(7), BigInt(6), BigInt(9), BigInt(1), BigInt(7)]
|
||||
const xs: Array<bigint> = []
|
||||
|
||||
for (let i = 0; i < degree; i++) {
|
||||
xs.push(BigInt(i))
|
||||
}
|
||||
|
||||
const ys: Array<bigint> = []
|
||||
for (let i = 0; i < degree; i++) {
|
||||
const x: bigint = xs[i]
|
||||
let tmpX: bigint = x
|
||||
let y: bigint = coeffs[0]
|
||||
for (let j = 1; j < degree + 1; j++) {
|
||||
y = Fq.add(y, Fq.mul(tmpX, coeffs[j]))
|
||||
tmpX = Fq.mul(tmpX, x)
|
||||
}
|
||||
ys.push(y)
|
||||
}
|
||||
|
||||
let f0 = BigInt(0)
|
||||
for (let i = 0; i < degree; i++) {
|
||||
let p = BigInt(1)
|
||||
for (let j = 0; j < degree; j++) {
|
||||
if (j !== i) {
|
||||
p = Fq.mul(p, Fq.div(xs[j], Fq.sub(xs[j], xs[i])))
|
||||
}
|
||||
}
|
||||
f0 = Fq.add(f0, Fq.mul(ys[i], p))
|
||||
}
|
||||
|
||||
expect(Fq.eq(f0, coeffs[0])).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,98 +1,96 @@
|
||||
import { Rln } from "../src";
|
||||
import { ZkIdentity } from "../../identity/src";
|
||||
import { Identity, MerkleProof, IProof } from "../../types";
|
||||
import { genSignalHash, genExternalNullifier, generateMerkleProof, poseidonHash } from "../src/utils";
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
import { Rln } from "../src"
|
||||
import { ZkIdentity } from "../../identity/src"
|
||||
import { Identity, MerkleProof, IProof } from "../../types"
|
||||
import { genSignalHash, genExternalNullifier, generateMerkleProof, poseidonHash } from "../src/utils"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
const identityCommitments: Array<bigint> = [];
|
||||
const identityCommitments: Array<bigint> = []
|
||||
|
||||
beforeAll(() => {
|
||||
const leafIndex = 3;
|
||||
const leafIndex = 3
|
||||
|
||||
for (let i=0; i<leafIndex;i++) {
|
||||
const tmpIdentity = ZkIdentity.genIdentity();
|
||||
const tmpCommitment: any = ZkIdentity.genIdentityCommitment(tmpIdentity);
|
||||
identityCommitments.push(tmpCommitment);
|
||||
}
|
||||
for (let i = 0; i < leafIndex; i++) {
|
||||
const tmpIdentity = ZkIdentity.genIdentity()
|
||||
const tmpCommitment: any = ZkIdentity.genIdentityCommitment(tmpIdentity)
|
||||
identityCommitments.push(tmpCommitment)
|
||||
}
|
||||
})
|
||||
|
||||
describe("Rln", () => {
|
||||
describe("Rln functionalities", () => {
|
||||
it("Generate rln witness", () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const identitySecret: bigint[] = ZkIdentity.genSecretFromIdentity(identity);
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity);
|
||||
const secretHash: bigint = poseidonHash(identitySecret);
|
||||
describe("Rln functionalities", () => {
|
||||
it("Generate rln witness", () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const identitySecret: bigint[] = ZkIdentity.genSecretFromIdentity(identity)
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity)
|
||||
const secretHash: bigint = poseidonHash(identitySecret)
|
||||
|
||||
const commitments: Array<bigint> = Object.assign([], identityCommitments);
|
||||
commitments.push(identityCommitment);
|
||||
const commitments: Array<bigint> = Object.assign([], identityCommitments)
|
||||
commitments.push(identityCommitment)
|
||||
|
||||
const signal = 'hey hey';
|
||||
const epoch: string = genExternalNullifier('test-epoch');
|
||||
const rlnIdentifier: bigint = Rln.genIdentifier();
|
||||
const signal = "hey hey"
|
||||
const epoch: string = genExternalNullifier("test-epoch")
|
||||
const rlnIdentifier: bigint = Rln.genIdentifier()
|
||||
|
||||
const merkleProof: MerkleProof = generateMerkleProof(15, BigInt(0), 5, commitments, identityCommitment);
|
||||
const witness: IProof = Rln.genWitness(secretHash, merkleProof, epoch, signal, rlnIdentifier);
|
||||
const merkleProof: MerkleProof = generateMerkleProof(15, BigInt(0), 5, commitments, identityCommitment)
|
||||
const witness: IProof = Rln.genWitness(secretHash, merkleProof, epoch, signal, rlnIdentifier)
|
||||
|
||||
expect(typeof witness).toBe("object");
|
||||
})
|
||||
it.skip("Generate rln proof and verify it", async () => {
|
||||
/**
|
||||
* Compiled RLN circuits are needed to run this test so it's being skipped in hooks
|
||||
*/
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const identitySecret: bigint[] = ZkIdentity.genSecretFromIdentity(identity);
|
||||
const secretHash: bigint = poseidonHash(identitySecret);
|
||||
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity);
|
||||
|
||||
const commitments: Array<bigint> = Object.assign([], identityCommitments);
|
||||
commitments.push(identityCommitment);
|
||||
|
||||
const signal = 'hey hey';
|
||||
const signalHash = genSignalHash(signal);
|
||||
const epoch: string = genExternalNullifier('test-epoch');
|
||||
const rlnIdentifier: bigint = Rln.genIdentifier();
|
||||
|
||||
|
||||
const merkleProof: MerkleProof = generateMerkleProof(15, BigInt(0), 2, commitments, identityCommitment);
|
||||
const witness: IProof = Rln.genWitness(secretHash, merkleProof, epoch, signal, rlnIdentifier);
|
||||
|
||||
const [y, nullifier] = Rln.calculateOutput(secretHash, BigInt(epoch), rlnIdentifier, signalHash);
|
||||
const publicSignals = [y, merkleProof.root, nullifier, signalHash, epoch, rlnIdentifier];
|
||||
|
||||
const vkeyPath: string = path.join('./zkeyFiles', 'rln', 'verification_key.json');
|
||||
const vKey = JSON.parse(fs.readFileSync(vkeyPath, 'utf-8'));
|
||||
|
||||
const wasmFilePath: string = path.join('./zkeyFiles', 'rln', 'rln.wasm');
|
||||
const finalZkeyPath: string = path.join('./zkeyFiles', 'rln', 'rln_final.zkey');
|
||||
|
||||
const fullProof: IProof = await Rln.genProof(witness, wasmFilePath, finalZkeyPath);
|
||||
const res: boolean = await Rln.verifyProof(vKey, { proof: fullProof.proof, publicSignals });
|
||||
|
||||
expect(res).toBe(true);
|
||||
})
|
||||
it("Should retrieve user secret after spaming", () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const identitySecret: bigint[] = ZkIdentity.genSecretFromIdentity(identity);
|
||||
const secretHash: bigint = poseidonHash(identitySecret);
|
||||
|
||||
const signal1 = 'hey hey';
|
||||
const signalHash1 = genSignalHash(signal1);
|
||||
const signal2 = 'hey hey again';
|
||||
const signalHash2 = genSignalHash(signal2);
|
||||
|
||||
const epoch: string = genExternalNullifier('test-epoch');
|
||||
const rlnIdentifier: bigint = Rln.genIdentifier();
|
||||
|
||||
const [y1] = Rln.calculateOutput(secretHash, BigInt(epoch), rlnIdentifier, signalHash1);
|
||||
const [y2] = Rln.calculateOutput(secretHash, BigInt(epoch), rlnIdentifier, signalHash2);
|
||||
|
||||
const retrievedSecret: bigint = Rln.retrieveSecret(signalHash1, signalHash2, y1, y2);
|
||||
|
||||
expect(retrievedSecret).toEqual(secretHash);
|
||||
|
||||
})
|
||||
expect(typeof witness).toBe("object")
|
||||
})
|
||||
it.skip("Generate rln proof and verify it", async () => {
|
||||
/**
|
||||
* Compiled RLN circuits are needed to run this test so it's being skipped in hooks
|
||||
*/
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const identitySecret: bigint[] = ZkIdentity.genSecretFromIdentity(identity)
|
||||
const secretHash: bigint = poseidonHash(identitySecret)
|
||||
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity)
|
||||
|
||||
const commitments: Array<bigint> = Object.assign([], identityCommitments)
|
||||
commitments.push(identityCommitment)
|
||||
|
||||
const signal = "hey hey"
|
||||
const signalHash = genSignalHash(signal)
|
||||
const epoch: string = genExternalNullifier("test-epoch")
|
||||
const rlnIdentifier: bigint = Rln.genIdentifier()
|
||||
|
||||
const merkleProof: MerkleProof = generateMerkleProof(15, BigInt(0), 2, commitments, identityCommitment)
|
||||
const witness: IProof = Rln.genWitness(secretHash, merkleProof, epoch, signal, rlnIdentifier)
|
||||
|
||||
const [y, nullifier] = Rln.calculateOutput(secretHash, BigInt(epoch), rlnIdentifier, signalHash)
|
||||
const publicSignals = [y, merkleProof.root, nullifier, signalHash, epoch, rlnIdentifier]
|
||||
|
||||
const vkeyPath: string = path.join("./zkeyFiles", "rln", "verification_key.json")
|
||||
const vKey = JSON.parse(fs.readFileSync(vkeyPath, "utf-8"))
|
||||
|
||||
const wasmFilePath: string = path.join("./zkeyFiles", "rln", "rln.wasm")
|
||||
const finalZkeyPath: string = path.join("./zkeyFiles", "rln", "rln_final.zkey")
|
||||
|
||||
const fullProof: IProof = await Rln.genProof(witness, wasmFilePath, finalZkeyPath)
|
||||
const res: boolean = await Rln.verifyProof(vKey, { proof: fullProof.proof, publicSignals })
|
||||
|
||||
expect(res).toBe(true)
|
||||
})
|
||||
it("Should retrieve user secret after spaming", () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const identitySecret: bigint[] = ZkIdentity.genSecretFromIdentity(identity)
|
||||
const secretHash: bigint = poseidonHash(identitySecret)
|
||||
|
||||
const signal1 = "hey hey"
|
||||
const signalHash1 = genSignalHash(signal1)
|
||||
const signal2 = "hey hey again"
|
||||
const signalHash2 = genSignalHash(signal2)
|
||||
|
||||
const epoch: string = genExternalNullifier("test-epoch")
|
||||
const rlnIdentifier: bigint = Rln.genIdentifier()
|
||||
|
||||
const [y1] = Rln.calculateOutput(secretHash, BigInt(epoch), rlnIdentifier, signalHash1)
|
||||
const [y2] = Rln.calculateOutput(secretHash, BigInt(epoch), rlnIdentifier, signalHash2)
|
||||
|
||||
const retrievedSecret: bigint = Rln.retrieveSecret(signalHash1, signalHash2, y1, y2)
|
||||
|
||||
expect(retrievedSecret).toEqual(secretHash)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,69 +1,74 @@
|
||||
import { ZkIdentity } from "../../identity/src";
|
||||
import { Identity, MerkleProof, IProof } from "../../types";
|
||||
import { genSignalHash, genExternalNullifier, generateMerkleProof } from "../src/utils";
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
import { ZkIdentity } from "../../identity/src"
|
||||
import { Identity, MerkleProof, IProof } from "../../types"
|
||||
import { genSignalHash, genExternalNullifier, generateMerkleProof } from "../src/utils"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
import { Semaphore } from "../src";
|
||||
import { Semaphore } from "../src"
|
||||
|
||||
const identityCommitments: Array<bigint> = [];
|
||||
const identityCommitments: Array<bigint> = []
|
||||
|
||||
beforeAll(() => {
|
||||
jest.useFakeTimers('legacy')
|
||||
jest.setTimeout(90 * 1000);
|
||||
const leafIndex = 3;
|
||||
jest.useFakeTimers("legacy")
|
||||
jest.setTimeout(90 * 1000)
|
||||
const leafIndex = 3
|
||||
|
||||
for (let i=0; i<leafIndex;i++) {
|
||||
const tmpIdentity = ZkIdentity.genIdentity();
|
||||
const tmpCommitment: bigint = ZkIdentity.genIdentityCommitment(tmpIdentity);
|
||||
identityCommitments.push(tmpCommitment);
|
||||
}
|
||||
for (let i = 0; i < leafIndex; i++) {
|
||||
const tmpIdentity = ZkIdentity.genIdentity()
|
||||
const tmpCommitment: bigint = ZkIdentity.genIdentityCommitment(tmpIdentity)
|
||||
identityCommitments.push(tmpCommitment)
|
||||
}
|
||||
})
|
||||
|
||||
describe("Semaphore", () => {
|
||||
describe("Generate and verify proof", () => {
|
||||
it("Should generate semaphore witness", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const externalNullifier: string = genExternalNullifier("voting_1");
|
||||
const signal = '0x111';
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity);
|
||||
describe("Generate and verify proof", () => {
|
||||
it("Should generate semaphore witness", async () => {
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const externalNullifier: string = genExternalNullifier("voting_1")
|
||||
const signal = "0x111"
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity)
|
||||
|
||||
const commitments: Array<bigint> = Object.assign([], identityCommitments);
|
||||
commitments.push(identityCommitment);
|
||||
const commitments: Array<bigint> = Object.assign([], identityCommitments)
|
||||
commitments.push(identityCommitment)
|
||||
|
||||
const merkleProof: MerkleProof = generateMerkleProof(20, BigInt(0), 5, commitments, identityCommitment);
|
||||
const witness: IProof = Semaphore.genWitness(identity, merkleProof, externalNullifier, signal);
|
||||
const merkleProof: MerkleProof = generateMerkleProof(20, BigInt(0), 5, commitments, identityCommitment)
|
||||
const witness: IProof = Semaphore.genWitness(identity, merkleProof, externalNullifier, signal)
|
||||
|
||||
expect(typeof witness).toBe("object");
|
||||
})
|
||||
it.skip("Should generate semaphore full proof", async () => {
|
||||
/**
|
||||
* Compiled semaphore circuits are needed to run this test, so it's being skipped in hooks
|
||||
*/
|
||||
const identity: Identity = ZkIdentity.genIdentity();
|
||||
const externalNullifier: string = genExternalNullifier("voting_1");
|
||||
const signal = '0x111';
|
||||
const nullifierHash: bigint = Semaphore.genNullifierHash(externalNullifier, identity.identityNullifier, 20);
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity);
|
||||
|
||||
const commitments: Array<bigint> = Object.assign([], identityCommitments);
|
||||
commitments.push(identityCommitment);
|
||||
|
||||
const merkleProof: MerkleProof = generateMerkleProof(20, BigInt(0), 5, commitments, identityCommitment);
|
||||
const witness: IProof = Semaphore.genWitness(identity, merkleProof, externalNullifier, signal);
|
||||
|
||||
const publicSignals: Array<bigint | string> = [merkleProof.root, nullifierHash, genSignalHash(signal), externalNullifier];
|
||||
|
||||
const vkeyPath: string = path.join('./zkeyFiles', 'semaphore', 'verification_key.json');
|
||||
const vKey = JSON.parse(fs.readFileSync(vkeyPath, 'utf-8'));
|
||||
|
||||
const wasmFilePath: string = path.join('./zkeyFiles', 'semaphore', 'semaphore.wasm');
|
||||
const finalZkeyPath: string = path.join('./zkeyFiles', 'semaphore', 'semaphore_final.zkey');
|
||||
|
||||
const fullProof: IProof = await Semaphore.genProof(witness, wasmFilePath, finalZkeyPath);
|
||||
const res: boolean = await Semaphore.verifyProof(vKey, { proof: fullProof.proof, publicSignals });
|
||||
|
||||
expect(res).toBe(true);
|
||||
})
|
||||
expect(typeof witness).toBe("object")
|
||||
})
|
||||
it.skip("Should generate semaphore full proof", async () => {
|
||||
/**
|
||||
* Compiled semaphore circuits are needed to run this test, so it's being skipped in hooks
|
||||
*/
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const externalNullifier: string = genExternalNullifier("voting_1")
|
||||
const signal = "0x111"
|
||||
const nullifierHash: bigint = Semaphore.genNullifierHash(externalNullifier, identity.identityNullifier, 20)
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity)
|
||||
|
||||
const commitments: Array<bigint> = Object.assign([], identityCommitments)
|
||||
commitments.push(identityCommitment)
|
||||
|
||||
const merkleProof: MerkleProof = generateMerkleProof(20, BigInt(0), 5, commitments, identityCommitment)
|
||||
const witness: IProof = Semaphore.genWitness(identity, merkleProof, externalNullifier, signal)
|
||||
|
||||
const publicSignals: Array<bigint | string> = [
|
||||
merkleProof.root,
|
||||
nullifierHash,
|
||||
genSignalHash(signal),
|
||||
externalNullifier
|
||||
]
|
||||
|
||||
const vkeyPath: string = path.join("./zkeyFiles", "semaphore", "verification_key.json")
|
||||
const vKey = JSON.parse(fs.readFileSync(vkeyPath, "utf-8"))
|
||||
|
||||
const wasmFilePath: string = path.join("./zkeyFiles", "semaphore", "semaphore.wasm")
|
||||
const finalZkeyPath: string = path.join("./zkeyFiles", "semaphore", "semaphore_final.zkey")
|
||||
|
||||
const fullProof: IProof = await Semaphore.genProof(witness, wasmFilePath, finalZkeyPath)
|
||||
const res: boolean = await Semaphore.verifyProof(vKey, { proof: fullProof.proof, publicSignals })
|
||||
|
||||
expect(res).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -46,5 +46,5 @@ yarn add @libsem/types
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { Identity, IProof, MerkleProof } from "@libsem/types";
|
||||
import { Identity, IProof, MerkleProof } from "@libsem/types"
|
||||
```
|
||||
|
||||
946
packages/types/package-lock.json
generated
946
packages/types/package-lock.json
generated
@@ -1,475 +1,475 @@
|
||||
{
|
||||
"name": "@libsem/types",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@libsem/types",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-node": "^10.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-consumer": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz",
|
||||
"integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz",
|
||||
"integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-consumer": "0.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@tsconfig/node10": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz",
|
||||
"integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node12": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz",
|
||||
"integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node14": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz",
|
||||
"integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node16": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz",
|
||||
"integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-node": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.3.0.tgz",
|
||||
"integrity": "sha512-RYIy3i8IgpFH45AX4fQHExrT8BxDeKTdC83QFJkNzkvt8uFB6QJ8XMyhynYiKMLxt9a7yuXaDBZNOYS3XjDcYw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-support": "0.7.0",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
"@tsconfig/node16": "^1.0.2",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn-walk": "^8.1.1",
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"yn": "3.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"ts-node": "dist/bin.js",
|
||||
"ts-node-cwd": "dist/bin-cwd.js",
|
||||
"ts-node-script": "dist/bin-script.js",
|
||||
"ts-node-transpile-only": "dist/bin-transpile.js",
|
||||
"ts-script": "dist/bin-script-deprecated.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@swc/core": ">=1.2.50",
|
||||
"@swc/wasm": ">=1.2.50",
|
||||
"@types/node": "*",
|
||||
"typescript": ">=2.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@swc/core": {
|
||||
"optional": true
|
||||
},
|
||||
"@swc/wasm": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-consumer": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz",
|
||||
"integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==",
|
||||
"dev": true
|
||||
},
|
||||
"@cspotcode/source-map-support": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz",
|
||||
"integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cspotcode/source-map-consumer": "0.8.0"
|
||||
}
|
||||
},
|
||||
"@tsconfig/node10": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz",
|
||||
"integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node12": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz",
|
||||
"integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node14": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz",
|
||||
"integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node16": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz",
|
||||
"integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn": {
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.3.0.tgz",
|
||||
"integrity": "sha512-RYIy3i8IgpFH45AX4fQHExrT8BxDeKTdC83QFJkNzkvt8uFB6QJ8XMyhynYiKMLxt9a7yuXaDBZNOYS3XjDcYw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cspotcode/source-map-support": "0.7.0",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
"@tsconfig/node16": "^1.0.2",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn-walk": "^8.1.1",
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
"name": "@libsem/types",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@libsem/types",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-node": "^10.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-consumer": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz",
|
||||
"integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz",
|
||||
"integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-consumer": "0.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@tsconfig/node10": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz",
|
||||
"integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node12": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz",
|
||||
"integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node14": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz",
|
||||
"integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node16": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz",
|
||||
"integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-node": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.3.0.tgz",
|
||||
"integrity": "sha512-RYIy3i8IgpFH45AX4fQHExrT8BxDeKTdC83QFJkNzkvt8uFB6QJ8XMyhynYiKMLxt9a7yuXaDBZNOYS3XjDcYw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-support": "0.7.0",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
"@tsconfig/node16": "^1.0.2",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn-walk": "^8.1.1",
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"yn": "3.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"ts-node": "dist/bin.js",
|
||||
"ts-node-cwd": "dist/bin-cwd.js",
|
||||
"ts-node-script": "dist/bin-script.js",
|
||||
"ts-node-transpile-only": "dist/bin-transpile.js",
|
||||
"ts-script": "dist/bin-script-deprecated.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@swc/core": ">=1.2.50",
|
||||
"@swc/wasm": ">=1.2.50",
|
||||
"@types/node": "*",
|
||||
"typescript": ">=2.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@swc/core": {
|
||||
"optional": true
|
||||
},
|
||||
"@swc/wasm": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-consumer": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz",
|
||||
"integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==",
|
||||
"dev": true
|
||||
},
|
||||
"@cspotcode/source-map-support": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz",
|
||||
"integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cspotcode/source-map-consumer": "0.8.0"
|
||||
}
|
||||
},
|
||||
"@tsconfig/node10": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz",
|
||||
"integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node12": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz",
|
||||
"integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node14": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz",
|
||||
"integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node16": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz",
|
||||
"integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn": {
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.3.0.tgz",
|
||||
"integrity": "sha512-RYIy3i8IgpFH45AX4fQHExrT8BxDeKTdC83QFJkNzkvt8uFB6QJ8XMyhynYiKMLxt9a7yuXaDBZNOYS3XjDcYw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cspotcode/source-map-support": "0.7.0",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
"@tsconfig/node16": "^1.0.2",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn-walk": "^8.1.1",
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
export interface Identity {
|
||||
identityNullifier: bigint,
|
||||
identityTrapdoor: bigint,
|
||||
identityNullifier: bigint
|
||||
identityTrapdoor: bigint
|
||||
}
|
||||
|
||||
export interface IProof {
|
||||
proof: any,
|
||||
publicSignals: Array<bigint | string>,
|
||||
proof: any
|
||||
publicSignals: Array<bigint | string>
|
||||
}
|
||||
|
||||
export interface MerkleProof {
|
||||
root: bigint,
|
||||
indices: Array<any>,
|
||||
pathElements: Array<any>
|
||||
}
|
||||
root: bigint
|
||||
indices: Array<any>
|
||||
pathElements: Array<any>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user