import { VerificationKey, DynamicProof, type InferProvable, FeatureFlags, Proof, Cache, Provable, PublicKey, type From, type InferValue, Field } from 'o1js';
import { ProvableType } from './o1js-missing.ts';
import { type InferNestedProvable, NestedProvable, type NestedProvableFor } from './nested.ts';
import { type CredentialSpec, type Credential, type StoredCredential, type WitnessSpec } from './credential.ts';
import type { ImportedWitnessSpecJSON } from './validation.ts';
export { Imported, type ImportedWitness, ImportedWitnessSpec };
type ImportedWitness = {
type: 'imported';
vk: VerificationKey;
proof: DynamicProof;
};
type ImportedWitnessSpec = {
type: 'imported';
publicInputType: ProvableType;
publicOutputType: ProvableType>;
maxProofsVerified: 0 | 1 | 2;
featureFlags: FeatureFlags;
};
type Imported = StoredCredential>;
declare const Imported: {
create: typeof createImported;
fromProgram: typeof importedFromProgram;
fromMethod: typeof importedFromMethod;
publicInputType: typeof publicInputType;
Generic: {
witnessType(witnessSpec: WitnessSpec): NestedProvableFor>;
verify({ vk, proof }: ImportedWitness, credHash: Field): void;
validate({ vk, proof }: ImportedWitness, credHash: Field): Promise;
matchesSpec(witness: ImportedWitness): boolean;
};
};
declare function createImported, Input extends InferProvable>(spec: {
data: DataType;
witness: ImportedWitnessSpec;
}): CredentialSpec, Data>;
declare function witnessSpecToJSON(spec: ImportedWitnessSpec): {
type: "imported";
publicInputType: import("./serialize-provable.ts").SerializedType;
publicOutputType: import("./serialize-provable.ts").SerializedType;
maxProofsVerified: 0 | 2 | 1;
featureFlags: {
rangeCheck0: boolean | null;
rangeCheck1: boolean | null;
foreignFieldAdd: boolean | null;
foreignFieldMul: boolean | null;
xor: boolean | null;
rot: boolean | null;
lookup: boolean | null;
runtimeTables: boolean | null;
};
};
declare function witnessSpecFromJSON(json: ImportedWitnessSpecJSON): ImportedWitnessSpec;
declare const ImportedWitnessSpec: {
toJSON: typeof witnessSpecToJSON;
fromJSON: typeof witnessSpecFromJSON;
};
declare function publicInputType(credentialSpec: Spec): ProvableType;
declare function importedFromProgram, Input extends InferProvable, AllInputs extends any[]>(program: {
publicInputType: InputType;
publicOutputType: ProvableType>;
analyzeMethods(): Promise>;
maxProofsVerified(): Promise<0 | 1 | 2>;
compile: (options?: {
cache?: Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: VerificationKey;
}>;
run(...inputs: AllInputs): Promise<{
proof: Proof>;
auxiliaryOutput: undefined;
}>;
}): Promise<{
spec: CredentialSpec, Data>;
program: {
publicInputType: InputType;
publicOutputType: ProvableType>;
analyzeMethods(): Promise>;
maxProofsVerified(): Promise<0 | 1 | 2>;
compile: (options?: {
cache?: Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: VerificationKey;
}>;
run(...inputs: AllInputs): Promise<{
proof: Proof>;
auxiliaryOutput: undefined;
}>;
};
isCompiled: boolean;
verificationKey: VerificationKey | undefined;
create(...inputs: AllInputs): Promise>;
fromProof(proof: Proof>, vk: VerificationKey): Promise>;
compile(options?: {
cache?: Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}): Promise;
dummy({ owner, data, }: Credential>): Promise>;
}>;
type PublicInput = InferProvableOrUndefined>;
type PrivateInput = InferProvable>;
type Data = InferProvable>;
declare function importedFromMethod(spec: Config, method: (inputs: {
publicInput: PublicInput;
privateInput: PrivateInput;
owner: PublicKey;
}) => Promise>): Promise>>, import("node_modules/o1js/dist/node/bindings/lib/provable-generic.js").InferProvable, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>>;
program: {
publicInputType: Provable>, InferValue>>;
publicOutputType: ProvableType, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>>>;
analyzeMethods(): Promise>;
maxProofsVerified(): Promise<0 | 1 | 2>;
compile: (options?: {
cache?: Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: VerificationKey;
}>;
run(...inputs: any): Promise<{
proof: Proof>, Credential, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>>>;
auxiliaryOutput: undefined;
}>;
};
isCompiled: boolean;
verificationKey: VerificationKey | undefined;
create(...inputs: any): Promise, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>, InferProvableOrUndefined>>>;
fromProof(proof: Proof>, Credential, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>>>, vk: VerificationKey): Promise, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>, InferProvableOrUndefined>>>;
compile(options?: {
cache?: Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
} | undefined): Promise;
dummy({ owner, data, }: Credential, import("node_modules/o1js/dist/node/lib/provable/field.js").Field> | InferValue>>): Promise, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>, InferProvableOrUndefined>>>;
}, "create"> & {
create(inputs: {
publicInput: From>;
privateInput: From>;
owner: PublicKey;
}): Promise>, InferProvableOrUndefined>>>;
}>;
type Get = T extends {
[K in Key]: infer Value;
} ? Value : undefined;
type InferProvableOrUndefined = A extends undefined ? undefined : InferProvable;