forked from tornado-packages/tornado-core
Fixed snarkArgs type defs
This commit is contained in:
parent
69faa7a974
commit
c155649719
10
dist/websnark.d.ts
vendored
10
dist/websnark.d.ts
vendored
@ -11,9 +11,17 @@ export type snarkInputs = {
|
|||||||
pathElements: Element[];
|
pathElements: Element[];
|
||||||
pathIndices: Element[];
|
pathIndices: Element[];
|
||||||
};
|
};
|
||||||
|
export type snarkArgs = [
|
||||||
|
_root: string,
|
||||||
|
_nullifierHash: string,
|
||||||
|
_recipient: string,
|
||||||
|
_relayer: string,
|
||||||
|
_fee: string,
|
||||||
|
_refund: string
|
||||||
|
];
|
||||||
export type snarkProofs = {
|
export type snarkProofs = {
|
||||||
proof: string;
|
proof: string;
|
||||||
args: string[];
|
args: snarkArgs;
|
||||||
};
|
};
|
||||||
export declare function initGroth16(): Promise<void>;
|
export declare function initGroth16(): Promise<void>;
|
||||||
export declare function calculateSnarkProof(input: snarkInputs, circuit: object, provingKey: ArrayBuffer): Promise<snarkProofs>;
|
export declare function calculateSnarkProof(input: snarkInputs, circuit: object, provingKey: ArrayBuffer): Promise<snarkProofs>;
|
||||||
|
@ -21,9 +21,18 @@ export type snarkInputs = {
|
|||||||
pathIndices: Element[];
|
pathIndices: Element[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type snarkArgs = [
|
||||||
|
_root: string,
|
||||||
|
_nullifierHash: string,
|
||||||
|
_recipient: string,
|
||||||
|
_relayer: string,
|
||||||
|
_fee: string,
|
||||||
|
_refund: string,
|
||||||
|
];
|
||||||
|
|
||||||
export type snarkProofs = {
|
export type snarkProofs = {
|
||||||
proof: string;
|
proof: string;
|
||||||
args: string[];
|
args: snarkArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
@ -71,7 +80,7 @@ export async function calculateSnarkProof(
|
|||||||
input.relayer,
|
input.relayer,
|
||||||
toFixedHex(input.fee, 32),
|
toFixedHex(input.fee, 32),
|
||||||
toFixedHex(input.refund, 32),
|
toFixedHex(input.refund, 32),
|
||||||
];
|
] as snarkArgs;
|
||||||
|
|
||||||
return { proof, args };
|
return { proof, args };
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user