import type { CompactNamedEntryDrawConfig, FormulaParticipant, SnapshotMerkleProofNode, SnapshotProofStatus, SnapshotPublicationStatus, OutcomeStandardV12ProofManifest, OutcomeStandardV121ProofManifest, OutcomeStandardV121ScaleDrawConfig, OutcomeStandardV121SnapshotManifest, OutcomeStandardV12ScaleDrawConfig, OutcomeStandardV12SnapshotManifest, ResolutionFormula, SignedIntegerValue, SnapshotFormulaDrawConfig, SnapshotManifest, SnapshotParticipant } from "./types.js"; export declare const FORMAT_VERSION_V4 = 4; export declare const FORMAT_VERSION_V5 = 5; export declare const FORMAT_VERSION_V1_2_SCALE = 6; export declare const FORMAT_VERSION_V1_2_1_SCALE = 7; export declare const OUTCOME_STANDARD_V1_1 = "Outcome Standard V1.1"; export declare const OUTCOME_STANDARD_V1_2 = "1.2"; export declare const OUTCOME_STANDARD_V1_2_1 = "1.2.1"; export declare const OUTCOME_STANDARD_V1_3_2 = "1.3.2"; export declare const WINNER_CLAIM_HASH_DOMAIN = "outcome-standard-v1.2.1/winner-claim"; export declare const MAX_OUTCOME_ID_BYTES = 64; export declare const MAX_WINNERS = 32; export declare const MAX_SNAPSHOT_URI_BYTES = 512; export declare const MAX_COMPILED_ARTIFACT_BYTES = 8192; export declare const V5_ENTRY_BYTES: number; export declare const MAX_U32 = 4294967295; export declare const MAX_U64: bigint; export declare const MIN_I64: bigint; export declare const MAX_I64: bigint; export declare const EFFECT_TYPE_TRANSFER_SOL = 1; export declare const MULTI_WINNER_DOMAIN = "VRE_MULTI_WINNER_V1"; export declare const SNAPSHOT_LEAF_HASH_SCHEME = "sha256d_jsonl_v1"; export declare const SNAPSHOT_MERKLE_HASH_SCHEME = "sha256_pair_v1"; export declare const V4_FLAG_HAS_MERKLE_ROOT = 1; export declare const FORMULA_CODES: Record; export type SnapshotParticipantRecord = { id: string; order: number; weight: number; score: bigint; }; export type ParsedSnapshotArtifactV4 = { formatVersion: typeof FORMAT_VERSION_V4; minInputLamports: bigint; maxInputLamports: bigint; winnersCount: number; formulaCode: number; targetScore: bigint; snapshotCount: number; payoutLamports: bigint; snapshotHash: Buffer; merkleRoot: Buffer | null; snapshotUri: string; }; export type ParsedOutcomeStandardV12Artifact = Omit & { formatVersion: typeof FORMAT_VERSION_V1_2_SCALE; standardVersion: typeof OUTCOME_STANDARD_V1_2; }; export type ParsedOutcomeStandardV121Artifact = Omit & { formatVersion: typeof FORMAT_VERSION_V1_2_1_SCALE; standardVersion: typeof OUTCOME_STANDARD_V1_2_1; }; export type CompactNamedEntryRecord = { id: string; order: number; weight: number; score: bigint; }; export type ParsedCompactNamedEntryArtifactV5 = { formatVersion: 5; standardVersion: typeof OUTCOME_STANDARD_V1_1; minInputLamports: bigint; maxInputLamports: bigint; winnersCount: number; formulaCode: number; targetScore: bigint; entryCount: number; payoutLamports: bigint; entries: CompactNamedEntryRecord[]; }; export type SnapshotClaim = { outcomeIds: string[]; winnersCount: number; totalOutputLamports: bigint; effectCount: number; effectsDigest: Buffer; winnerClaimHash: Buffer; }; export declare function canonicalSnapshotLine(entry: SnapshotParticipantRecord, formula: ResolutionFormula): string; export declare function hashSnapshotLeafLine(line: string): Buffer; export declare function hashSnapshotLeaf(entry: SnapshotParticipantRecord, formula: ResolutionFormula): Buffer; export declare function buildMerkleLevels(leafHashes: Buffer[]): Buffer[][]; export declare function buildMerkleRoot(leafHashes: Buffer[]): Buffer; export declare function buildMerkleProof(levels: Buffer[][], leafIndex: number): SnapshotMerkleProofNode[]; /** * Recomputes the Merkle root from one canonical snapshot line and its proof. Proof nodes run from * the leaf upward; `position` says on which side the sibling sits. */ export declare function computeSnapshotMerkleRootFromProof(line: string, proof: SnapshotMerkleProofNode[]): Buffer; /** * Checks that a participant belongs to a committed snapshot without trusting whoever served the * proof: compare against the Merkle root read from the on-chain artifact (fetchSnapshotCommitment). * Pass the canonical `line`, or the `entry` with its `formula`. A malformed proof returns false. */ export declare function verifySnapshotMerkleProof(opts: { line?: string; entry?: SnapshotParticipantRecord; formula?: ResolutionFormula; proof: SnapshotMerkleProofNode[]; merkleRoot: string | Buffer; }): boolean; export declare function normalizeSnapshotParticipants(participants: Array, formulaInput: ResolutionFormula): SnapshotParticipantRecord[]; export declare function buildSnapshotHash(opts: { formula: ResolutionFormula; participants: Array; }): { snapshotHash: string; snapshotCount: number; merkleRoot: string; canonicalSnapshot: string; }; export declare function buildSnapshotManifest(opts: { snapshotHash: string; snapshotCount: number; formula: ResolutionFormula; winnersCount: number; snapshotUri: string; payoutLamports: bigint; targetScore?: bigint; thresholdMode?: SnapshotManifest["threshold_mode"]; merkleRoot?: string; proofManifestUrl?: string; irysUrl?: string; publicationStatus?: SnapshotPublicationStatus; publicationError?: string; proofStatus?: SnapshotProofStatus; }): SnapshotManifest; export declare function buildOutcomeStandardV12SnapshotManifest(opts: { snapshotHash: string; snapshotCount: number; formula: ResolutionFormula; winnersCount: number; snapshotUri: string; merkleRoot: string; payoutLamports?: bigint; targetScore?: bigint; thresholdMode?: OutcomeStandardV12SnapshotManifest["threshold_mode"]; publicationStatus?: SnapshotPublicationStatus; publicationUrl?: string | null; proofManifestUrl?: string | null; publicationError?: string; proofStatus?: SnapshotProofStatus; }): OutcomeStandardV12SnapshotManifest; export declare function buildOutcomeStandardV12ProofManifest(opts: { signature: string; programId: string; snapshotHash: string; snapshotCount: number; snapshotUri: string; merkleRoot: string; formula: ResolutionFormula; selectedIds: string[]; snapshotManifestUri: string; proofEndpointTemplate: string; publicationStatus?: SnapshotPublicationStatus; publicationUrl?: string | null; target?: SignedIntegerValue; publicationError?: string; proofStatus?: SnapshotProofStatus; }): OutcomeStandardV12ProofManifest; export declare function buildOutcomeStandardV121SnapshotManifest(opts: Parameters[0] & { winnerClaimHash: string; }): OutcomeStandardV121SnapshotManifest; export declare function buildOutcomeStandardV121ProofManifest(opts: Parameters[0] & { winnerClaimHash: string; }): OutcomeStandardV121ProofManifest; export declare function validateWinnersCount(value: unknown, participantCount: number): number; export declare function buildArtifactV4(config: SnapshotFormulaDrawConfig): Buffer; export declare function buildArtifactV12(config: OutcomeStandardV12ScaleDrawConfig): Buffer; export declare function buildArtifactV121(config: OutcomeStandardV121ScaleDrawConfig): Buffer; export declare function parseArtifactV4(blob: Buffer): ParsedSnapshotArtifactV4; export declare function parseArtifactV12(blob: Buffer): ParsedOutcomeStandardV12Artifact; export declare function parseArtifactV121(blob: Buffer): ParsedOutcomeStandardV121Artifact; export declare function buildArtifactV5(config: CompactNamedEntryDrawConfig): Buffer; export declare function parseArtifactV5(blob: Buffer): ParsedCompactNamedEntryArtifactV5; export declare function formulaNameFromArtifactV4(parsed: ParsedSnapshotArtifactV4 | ParsedOutcomeStandardV12Artifact | ParsedOutcomeStandardV121Artifact): ResolutionFormula; export declare function formulaNameFromArtifactV5(parsed: ParsedCompactNamedEntryArtifactV5): ResolutionFormula; export declare function deriveResolveRandomness(masterSeed: Buffer, runtimeId: Buffer, resolveId: bigint, actor: Buffer): Buffer; export declare function rollForRound(randomness: Buffer, round: number): bigint; export declare function inspectSnapshotFile(opts: { snapshotPath: string; formula: ResolutionFormula; expectedHash?: string; expectedCount?: number; expectedMerkleRoot?: string; }): Promise<{ snapshotHash: string; snapshotCount: number; merkleRoot: string; }>; export declare function buildSnapshotMerkleProofFromFile(opts: { snapshotPath: string; formula: ResolutionFormula; participantId: string; expectedHash?: string; expectedCount?: number; expectedMerkleRoot?: string; }): Promise<{ snapshotHash: string; snapshotCount: number; merkleRoot: string; participant: SnapshotParticipantRecord | null; leafHash: string | null; proof: SnapshotMerkleProofNode[]; }>; export declare function buildWinnerClaimHash(winnerIds: string[]): Buffer; export declare function buildSnapshotClaimFromWinnerIds(winnerIds: string[], payoutLamports: bigint): SnapshotClaim; export declare function buildSnapshotClaimFromFile(opts: { snapshotPath: string; formula: ResolutionFormula; winnersCount: number; randomness: Buffer; payoutLamports: bigint; targetScore?: bigint; }): Promise; export declare function buildCompactNamedEntryClaimFromArtifactV5(parsed: ParsedCompactNamedEntryArtifactV5, randomness: Buffer): SnapshotClaim; //# sourceMappingURL=snapshot.d.ts.map