zkverifyjs
Version:
Submit proofs to zkVerify and query proof state with ease using our npm package.
39 lines • 2.35 kB
TypeScript
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;
/**
* Reconstructs a signable SubmittableExtrinsic from a hex-encoded string.
*
* Uses `api.tx(hex)` to restore full submittable behavior (e.g., `.signAsync`).
* Note: The original signature and metadata are not preserved.
*
* @param api - Polkadot API instance.
* @param extrinsicHex - Hex-encoded extrinsic string.
* @returns A SubmittableExtrinsic<'promise'>.
* @throws Error if decoding or reconstruction fails.
*/
export declare const createSubmittableExtrinsicFromHex: (api: ApiPromise, extrinsicHex: string) => SubmittableExtrinsic<"promise">;
//# sourceMappingURL=index.d.ts.map