tornado-core/dist/websnark.d.ts

28 lines
734 B
TypeScript
Raw Permalink Normal View History

2024-04-29 18:55:15 +03:00
import type { Element } from '@tornado/fixed-merkle-tree';
2024-10-16 17:19:49 +03:00
export interface snarkInputs {
2024-04-29 18:55:15 +03:00
root: Element;
nullifierHex: string;
recipient: string;
relayer: string;
2024-04-29 18:55:15 +03:00
fee: bigint;
refund: bigint;
nullifier: bigint;
secret: bigint;
pathElements: Element[];
pathIndices: Element[];
2024-10-16 17:19:49 +03:00
}
2024-09-26 15:29:29 +03:00
export type snarkArgs = [
_root: string,
_nullifierHash: string,
_recipient: string,
_relayer: string,
_fee: string,
_refund: string
];
2024-10-16 17:19:49 +03:00
export interface snarkProofs {
proof: string;
2024-09-26 15:29:29 +03:00
args: snarkArgs;
2024-10-16 17:19:49 +03:00
}
2024-04-30 19:55:51 +03:00
export declare function initGroth16(): Promise<void>;
2024-04-29 18:55:15 +03:00
export declare function calculateSnarkProof(input: snarkInputs, circuit: object, provingKey: ArrayBuffer): Promise<snarkProofs>;