#!/usr/bin/env node import { Functions } from "firebase/functions"; import { CeremonyTimeoutType, CircomCompilerData, CircuitInputData, CeremonyInputData, CircuitDocument } from "@p0tion/actions"; /** * Handle whatever is needed to obtain the input data for a circuit that the coordinator would like to add to the ceremony. * @param choosenCircuitFilename - the name of the circuit to add. * @param matchingWasmFilename - the name of the circuit wasm file. * @param ceremonyTimeoutMechanismType - the type of ceremony timeout mechanism. * @param sameCircomCompiler - true, if this circuit shares with the others the ; otherwise false. * @param circuitSequencePosition - the position of the circuit in the contribution queue. * @param sharedCircomCompilerData - version and commit hash of the Circom compiler used to compile the ceremony circuits. * @returns > - the input data of the circuit to add to the ceremony. */ export declare const getInputDataToAddCircuitToCeremony: (choosenCircuitFilename: string, matchingWasmFilename: string, ceremonyTimeoutMechanismType: CeremonyTimeoutType, sameCircomCompiler: boolean, circuitSequencePosition: number, sharedCircomCompilerData: CircomCompilerData) => Promise; /** * Handle the addition of one or more circuits to the ceremony. * @param options > - list of possible circuits that can be added to the ceremony. * @param ceremonyTimeoutMechanismType - the type of ceremony timeout mechanism. * @returns >> - the input data for each circuit that has been added to the ceremony. */ export declare const handleAdditionOfCircuitsToCeremony: (r1csOptions: Array, wasmOptions: Array, ceremonyTimeoutMechanismType: CeremonyTimeoutType) => Promise>; /** * Print ceremony and related circuits information. * @param ceremonyInputData - the input data of the ceremony. * @param circuits > - the circuit documents associated to the circuits of the ceremony. */ export declare const displayCeremonySummary: (ceremonyInputData: CeremonyInputData, circuits: Array) => void; /** * Check if the smallest Powers of Tau has already been downloaded/stored in the correspondent local path * @dev we are downloading the Powers of Tau file from Perpetual Powers of Tau Phase 1 Trusted Setup. * @param powers - the smallest amount of powers needed for the given circuit (should be in a 'XY' stringified form). * @param ptauCompleteFilename - the complete file name of the powers of tau file to be downloaded. * @returns > */ export declare const checkAndDownloadSmallestPowersOfTau: (powers: string, ptauCompleteFilename: string) => Promise; /** * Handle the needs in terms of Powers of Tau for the selected pre-computed zKey. * @notice in case there are no Powers of Tau file suitable for the pre-computed zKey (i.e., having a * number of powers greater than or equal to the powers needed by the zKey), the coordinator will be asked * to provide a number of powers manually, ranging from the smallest possible to the largest. * @param neededPowers - the smallest amount of powers needed by the zKey. * @returns Promise - the information about the chosen Powers of Tau file for the pre-computed zKey * along with related powers. */ export declare const handlePreComputedZkeyPowersOfTauSelection: (neededPowers: number) => Promise<{ doubleDigitsPowers: string; potCompleteFilename: string; usePreDownloadedPoT: boolean; }>; /** * Generate a brand new zKey from scratch. * @param r1csLocalPathAndFileName - the local complete path of the R1CS selected file. * @param potLocalPathAndFileName - the local complete path of the PoT selected file. * @param zkeyLocalPathAndFileName - the local complete path of the pre-computed zKey selected file. */ export declare const handleNewZkeyGeneration: (r1csLocalPathAndFileName: string, potLocalPathAndFileName: string, zkeyLocalPathAndFileName: string) => Promise; /** * Manage the creation of a ceremony file storage bucket. * @param firebaseFunctions - the Firebase Cloud Functions instance connected to the current application. * @param ceremonyPrefix - the prefix of the ceremony. * @returns > - the ceremony bucket name. */ export declare const handleCeremonyBucketCreation: (firebaseFunctions: Functions, ceremonyPrefix: string) => Promise; /** * Upload a circuit artifact (r1cs, WASM, ptau) to the ceremony storage. * @dev this method uses a multi part upload to upload the file in chunks. * @param firebaseFunctions - the Firebase Cloud Functions instance connected to the current application. * @param bucketName - the ceremony bucket name. * @param storageFilePath - the storage (bucket) path where the file should be uploaded. * @param localPathAndFileName - the local file path where is located. * @param completeFilename - the complete filename. */ export declare const handleCircuitArtifactUploadToStorage: (firebaseFunctions: Functions, bucketName: string, storageFilePath: string, localPathAndFileName: string, completeFilename: string) => Promise; /** * Setup command. * @notice The setup command allows the coordinator of the ceremony to prepare the next ceremony by interacting with the CLI. * @dev For proper execution, the command must be run in a folder containing the R1CS files related to the circuits * for which the coordinator wants to create the ceremony. The command will download the necessary Tau powers * from PPoT ceremony Phase 1 Setup Ceremony. * @param cmd? - the path to the ceremony setup file. */ declare const setup: (cmd: { template?: string; auth?: string; }) => Promise; export default setup;