UNPKG

zkverifyjs

Version:

Submit proofs to zkVerify and query proof state with ease using our npm package.

36 lines 2.28 kB
import { ApiPromise } from '@polkadot/api'; import { SubmittableExtrinsic } from '@polkadot/api/types'; import { ProofType } from '../../config'; import { FormattedProofData } from '../format/types'; /** * Creates a SubmittableExtrinsic using formatted proof details to enable submitting a proof. * * @param {ApiPromise} api - The Polkadot API instance. * @param {ProofType} proofType - The type of supported proof, used to select the correct pallet. * @param {FormattedProofData} params - Formatted Proof Parameters required by the extrinsic. * @param {number | null | undefined} domainId - The domain ID for the extrinsic (32-bit unsigned integer). * @returns {SubmittableExtrinsic<'promise'>} The generated SubmittableExtrinsic for submission. * @throws {Error} - Throws an error if the extrinsic creation fails. */ export declare const createSubmitProofExtrinsic: (api: ApiPromise, proofType: ProofType, params: FormattedProofData, domainId?: number | null) => SubmittableExtrinsic<"promise">; /** * Generates the hex representation of a SubmittableExtrinsic using formatted proof details. * * @param {ApiPromise} api - The Polkadot API instance. * @param {ProofType} proofType - The type of supported proof, used to select the correct pallet. * @param {FormattedProofData} params - Formatted Proof Parameters required by the extrinsic. * @param {number | null | undefined} domainId - The domain ID for the extrinsic (32-bit unsigned integer). * @returns {string} Hex-encoded string of the SubmittableExtrinsic. * @throws {Error} - Throws an error if the extrinsic creation fails. */ export declare const createExtrinsicHex: (api: ApiPromise, proofType: ProofType, params: FormattedProofData, domainId?: number | null) => string; /** * Recreates an extrinsic from its hex-encoded representation. * * @param {ApiPromise} api - The Polkadot API instance. * @param {string} extrinsicHex - Hex-encoded string of the SubmittableExtrinsic. * @returns {SubmittableExtrinsic<'promise'>} The reconstructed SubmittableExtrinsic. * @throws {Error} - Throws an error if the reconstruction from hex fails. */ export declare const createExtrinsicFromHex: (api: ApiPromise, extrinsicHex: string) => SubmittableExtrinsic<"promise">; //# sourceMappingURL=index.d.ts.map