import { type Address, type Hex } from 'viem'; import * as z from 'zod/mini'; /** Zod schemas for Earn reward campaigns. */ export declare namespace schema { /** Target-yield configuration for one vault. */ const TargetYield: z.ZodMiniObject<{ annualRate: z.ZodMiniUnion; }, z.core.$strict>, z.ZodMiniObject<{ maxBps: z.ZodMiniNumber; minBps: z.ZodMiniNumber; morphoVault: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; staleAfterSeconds: z.ZodMiniNumber; }, z.core.$strict>]>; endTimestamp: z.ZodMiniNumber; funding: z.ZodMiniArray; }, z.core.$strict>; wallet: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>, z.ZodMiniObject<{ remainder: z.ZodMiniLiteral; wallet: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>]>>; intervalSeconds: z.ZodMiniNumber; startTimestamp: z.ZodMiniNumber; }, z.core.$strict>; /** Registered-depositor boost configuration for one vault. */ const BoostRewards: z.ZodMiniObject<{ enabled: z.ZodMiniOptional>; endTimestamp: z.ZodMiniNumber; excludedAddresses: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; funding: z.ZodMiniObject<{ wallet: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>; intervalSeconds: z.ZodMiniNumber; payoutSchedule: z.ZodMiniOptional; startTimestamp: z.ZodMiniNumber; }, z.core.$strict>>; perUserPrincipalCapAssets: z.ZodMiniString; startTimestamp: z.ZodMiniNumber; targetAnnualRateBps: z.ZodMiniNumber; totalPrincipalCapAssets: z.ZodMiniString; treasury: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>; /** Complete rewards configuration for one verified Earn vault. */ const Config: z.ZodMiniObject<{ boostRewards: z.ZodMiniOptional>; endTimestamp: z.ZodMiniNumber; excludedAddresses: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; funding: z.ZodMiniObject<{ wallet: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>; intervalSeconds: z.ZodMiniNumber; payoutSchedule: z.ZodMiniOptional; startTimestamp: z.ZodMiniNumber; }, z.core.$strict>>; perUserPrincipalCapAssets: z.ZodMiniString; startTimestamp: z.ZodMiniNumber; targetAnnualRateBps: z.ZodMiniNumber; totalPrincipalCapAssets: z.ZodMiniString; treasury: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>>; targetYield: z.ZodMiniOptional; }, z.core.$strict>, z.ZodMiniObject<{ maxBps: z.ZodMiniNumber; minBps: z.ZodMiniNumber; morphoVault: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; staleAfterSeconds: z.ZodMiniNumber; }, z.core.$strict>]>; endTimestamp: z.ZodMiniNumber; funding: z.ZodMiniArray; }, z.core.$strict>; wallet: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>, z.ZodMiniObject<{ remainder: z.ZodMiniLiteral; wallet: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>]>>; intervalSeconds: z.ZodMiniNumber; startTimestamp: z.ZodMiniNumber; }, z.core.$strict>>; }, z.core.$strict>; } /** Returns the single accounting interval shared by the configured capabilities. */ export declare function intervalSeconds(config: Config): number; /** Returns the final complete accounting boundary, excluding a trailing partial interval. */ export declare function finalBoundary(config: Config): number; /** Returns whether a completed accounting range overlaps one schedule's complete intervals. */ export declare function overlapsCompleteIntervals(schedule: NonNullable, options: overlapsCompleteIntervals.Options): boolean; export declare namespace overlapsCompleteIntervals { /** Completed accounting range tested against one reward schedule. */ type Options = { /** Inclusive closing accounting boundary. */ endsAt: number; /** Exclusive opening accounting boundary. */ startsAfter: number; }; } /** Returns whether one completed run should automatically push accumulated boost rewards. */ export declare function shouldPushPayout(boost: NonNullable, options: shouldPushPayout.Options): boolean; export declare namespace shouldPushPayout { /** Completed accounting range considered for an automatic payout. */ type Options = { /** Inclusive closing accounting boundary. */ endsAt: number; /** Exclusive opening accounting boundary. */ startsAfter: number; }; } /** Converts base assets into EarnShare at the fee-inclusive vault NAV, rounding down. */ export declare function assetsToEarnShares(options: { assets: bigint; totalAssets: bigint; totalEarnShares: bigint; }): bigint; /** Converts EarnShare into the assets needed at the fee-inclusive vault NAV, rounding up. */ export declare function earnSharesToAssets(options: { earnShares: bigint; totalAssets: bigint; totalEarnShares: bigint; }): bigint; /** Returns the inventory mint needed to fund a missing liability without coarse conversion loss. */ export declare function settlementFundingEarnShares(missingEarnShares: bigint): bigint; /** Removes explicit contributions from one interval's measured exchange-rate growth. */ export declare function organicGrowth(options: organicGrowth.Options): bigint; /** Removes explicit contributions from signed exchange-rate changes, retaining losses for interval aggregation. */ export declare function organicChange(options: organicChange.Options): bigint; export declare namespace organicChange { /** Exchange-rate values and contributions whose signed change is measured. */ type Options = organicGrowth.Options; } export declare namespace organicGrowth { /** One contribution normalized against its post-contribution holder supply. */ type Contribution = { /** Contributed base-asset units. */ assets: bigint; /** Fee-inclusive EarnShare supply after the contribution. */ earnShareSupply: bigint; }; /** Target-yield interval values. */ type Options = { /** Closing base assets per fixed EarnShare quote. */ closingValuePerEarnShare: bigint; /** Explicit contributions included in the closing value. */ contributions: readonly Contribution[]; /** Opening active base assets. */ openingAssets: bigint; /** Fee-inclusive opening EarnShare supply used to normalize mid-interval contributions. */ openingEarnShareSupply: bigint; /** Opening base assets per fixed EarnShare quote. */ openingValuePerEarnShare: bigint; }; } /** Allocates an interval's target shortfall using principal held between EarnShare supply changes. */ export declare function targetFunding(options: targetFunding.Options): targetFunding.Result; export declare namespace targetFunding { /** One period with unchanged EarnShare supply. */ type Period = organicGrowth.Options & { /** Seconds for which the opening principal remained active. */ elapsedSeconds: number; }; /** Target funding calculation for one complete accounting interval. */ type Options = { /** Resolved target annual rate in basis points. */ annualRateBps: number; /** Ordered funding waterfall. */ funding: readonly NonNullable['funding'][number][]; /** Historical periods covering the complete interval. */ periods: readonly Period[]; /** Exact accrual remainders carried from the preceding interval. */ remainders: readonly bigint[]; }; /** Exact assets and accrual remainders for each funding leg. */ type Result = { /** Assets requested from each funding wallet. */ assets: bigint[]; /** Accrual remainders retained for the next interval. */ remainders: bigint[]; }; } /** Annualizes contribution-adjusted asset growth as a simple ACT/365 rate. */ export declare function annualRateBps(options: annualRateBps.Options): number; export declare namespace annualRateBps { /** Inputs for annualizing exact interval growth. */ type Options = { /** Closed interval length in seconds. */ elapsedSeconds: number; /** Contribution-adjusted growth in base-asset units. */ growthAssets: bigint; /** Opening base-asset principal. */ principalAssets: bigint; }; } /** Resolves the effective base and incremental boost rates for one interval. */ export declare function rewardRates(options: rewardRates.Options): rewardRates.Result; export declare namespace rewardRates { /** Rate targets and observed growth for one closed interval. */ type Options = { /** Total annual rate targeted for qualified depositors. */ boostTargetRateBps: number; /** Contribution-adjusted annual rate observed during the interval. */ organicRateBps: number; /** Active target-yield floor. */ targetRateBps?: number | undefined; }; /** Effective base and incremental boost rates for one closed interval. */ type Result = { /** Higher of organic growth and the active target-yield floor. */ baseRateBps: number; /** Incremental depositor rate needed to reach the total target. */ boostRateBps: number; }; } /** Complete rewards configuration for one verified Earn vault. */ export type Config = z.output; /** Ordered TIDX event cursor for one campaign projection. */ export type EventCursor = { /** Tempo block number. */ blockNumber: number; /** Log index within the transaction receipt. */ logIndex: number; /** Transaction index within the block. */ transactionIndex: number; }; /** One surviving public deposit lot used for boost qualification. */ export type DepositLot = { /** Principal allocated against campaign caps. */ allocatedPrincipalAssets: string; /** Original deposited base assets. */ depositedAssets: string; /** EarnShare minted by the deposit. */ depositedEarnShares: string; /** Event order used for deterministic qualification. */ event: EventCursor; /** Qualified EarnShare not consumed by an outgoing transfer or burn. */ remainingEarnShares: string; }; /** Calculation and delivery state retained while one run is active. */ export type RunEvidence = { /** Target annual rate applied to this run's intervals. */ appliedTargetRateBps?: number | undefined; /** Incremental boost annual rate selected for the run. */ boostRateBps?: number | undefined; /** Complete closing recipient projection used to resume payout after a crash. */ closingAccounts: readonly AccountSnapshot[]; /** Newly credited recipients retaining an unpaid entitlement after delivery. */ deferredRecipients?: number | undefined; /** Stable registration high-water mark consumed by the run. */ eligibilityCheckpoint?: string | undefined; /** Exact eligibility snapshot identity used by resumable calculation. */ eligibilityVersion?: Hex | undefined; /** Exact effective exclusion set identity used by resumable calculation. */ exclusionVersion?: Hex | undefined; /** Final TIDX event applied to the closing projection. */ eventCursor?: EventCursor | undefined; /** Rate sources using a bounded prior observation. */ staleRates?: readonly ('organic' | 'target')[] | undefined; /** Contribution-adjusted annual rate observed in the run's latest boost interval. */ organicRateBps?: number | undefined; /** Closing boundary of the interval supplying the organic rate. */ organicRateObservedAt?: string | undefined; /** Newly credited recipients whose cumulative entitlement is fully paid after delivery. */ paidRecipients?: number | undefined; /** Recipients receiving an EarnShare transfer during this run. */ payoutPaidRecipients?: number | undefined; /** Frozen automatic-payout recipients reused across delivery retries. */ payoutRecipients?: readonly Address[] | undefined; /** Recipients retaining an unpaid cumulative entitlement after automatic delivery. */ pendingRecipients?: number | undefined; /** Latest target annual rate observation retained for source fallback. */ targetRateBps?: number | undefined; /** Exact per-funder target-yield assets committed before signing. */ targetFundingAssets?: readonly string[] | undefined; /** Per-waterfall-threshold division remainders carried into the next run. */ targetFundingRemainders?: readonly string[] | undefined; /** Principal accounting method used for the committed funding amounts. */ targetPrincipalMethod?: 'time-weighted:v1' | undefined; /** When the selected external target rate was observed. */ targetRateObservedAt?: string | undefined; /** Per-interval calculation records in chronological order. */ intervals: readonly { /** Fee-inclusive opening assets per EarnShare, scaled by 1e18. */ assetPerEarnShareWad: string; /** Per-recipient base-asset rewards for this interval. */ assetRewards: Readonly>; /** Final TIDX block included in the interval. */ blockNumber: number; /** Incremental boost annual rate applied to this interval. */ boostRateBps?: number | undefined; /** Exclusive interval end timestamp. */ endsAt: number; /** Contribution-adjusted annual rate observed in this interval. */ organicRateBps?: number | undefined; /** Inclusive interval start timestamp. */ startsAt: number; }[]; /** Explicit completed-state discriminator; absent on legacy completed evidence. */ kind?: 'complete' | undefined; /** Whether this run prepared and confirmed a new cumulative root. */ publishedRoot?: boolean | undefined; /** Base-asset units converted into the newly published entitlement. */ settledRewardAssets?: string | undefined; /** Recipients receiving a positive allocation in the new root. */ settlementRecipientAddresses?: readonly Address[] | undefined; /** Recipients receiving a positive allocation in the new root. */ settlementRecipients?: number | undefined; /** Closing account-state checksum. */ stateChecksum: Hex; }; /** Returns a stable identity for the complete eligibility snapshot. */ export declare function eligibilityVersion(entries: readonly eligibilityVersion.Entry[]): Hex; export declare namespace eligibilityVersion { /** Eligibility fields that can change projection membership or replay. */ type Entry = { /** Latest registration timestamp. */ latestRegisteredAt: string; /** Stable registration order. */ registrationOrder: string; /** Registered reward recipient. */ walletAddress: Address; }; } /** Returns a stable identity for the effective reward exclusion set. */ export declare function exclusionVersion(addresses: readonly Address[]): Hex; /** Durable pagewise calculation state retained until complete evidence replaces it. */ export type RunCheckpointEvidence = { /** Final TIDX event included in this checkpoint. */ cursor?: EventCursor | undefined; /** Stored-evidence discriminator. */ kind: 'checkpoint'; /** Completed calculation progress needed to resume the run. */ progress: Partial; /** Serializable projection reducer state. */ projection: { /** Recipient whose registration-ordered deposit page was last applied. */ allocationRecipient?: Address | undefined; /** Account projections after the checkpointed page. */ accounts: readonly AccountSnapshot[]; /** Last accrued timestamp keyed by normalized recipient. */ accruedThrough?: Readonly> | undefined; /** Remaining FIFO-consumed shares while allocating surviving deposits. */ consumedEarnShares?: Readonly> | undefined; /** Gross historical deposit shares keyed by normalized recipient. */ depositedEarnShares?: Readonly> | undefined; /** Historical reconciliation pass. */ pass?: 'allocation' | 'survival' | undefined; /** Final canonical event applied by the survival pass. */ replayedThrough?: EventCursor | undefined; /** Weighted EarnShare seconds keyed by normalized recipient. */ weightedEarnShareSeconds?: Readonly> | undefined; }; /** Calculation reducer that produced this checkpoint. */ stage: 'calculate' | 'reconcile'; }; /** Completed or resumable evidence stored on a reward run. */ export type StoredRunEvidence = RunCheckpointEvidence | RunEvidence; /** Narrows stored run evidence to resumable calculation state. */ export declare function isRunCheckpointEvidence(evidence: StoredRunEvidence | null | undefined): evidence is RunCheckpointEvidence; /** Restores funding amounts only when their saved principal accounting is safe to submit. */ export declare function targetFundingAssets(evidence: RunEvidence): bigint[]; /** Removes active recipient calculation and payout state after a run is durably delivered. */ export declare function compactEvidence(evidence: RunEvidence): RunEvidence; /** Serializable reward-account projection retained by an in-flight run. */ export type AccountSnapshot = { /** Arithmetic remainder carried across intervals. */ accrualRemainder: string; /** Principal allocated against campaign caps. */ allocatedPrincipalAssets: string; /** Cumulative EarnShare entitlement. */ cumulativeEntitlement: string; /** Cumulative EarnShare already paid. */ cumulativePaid: string; /** Current transfer deferral. */ deferral: string | null; /** Eligibility registration version consumed by this projection. */ eligibilityRegisteredAt: string | null; /** Surviving qualified deposits. */ lots: readonly DepositLot[]; /** Base-asset reward awaiting settlement. */ pendingRewardAssets: string; /** Current attributable public EarnShare. */ publicEarnShares: string; /** Current qualified EarnShare. */ qualifiedEarnShares: string; /** Registered recipient. */ recipient: Address; /** Monotonic registration order. */ registrationOrder: string; }; /** Typed signer intent persisted before transaction construction. */ export type TransactionIntent = { /** Deterministic content-addressed intent id. */ id: Hex; /** Operation accepted by the reward signer. */ operation: 'deploy' | 'targetYield' | 'settle' | 'publish' | 'push'; /** Operation-specific data validated by the signer. */ payload: Readonly>; }; /** Canonical receipt evidence retained after confirmation. */ export type TransactionReceipt = { /** Canonical receipt block hash. */ blockHash: Hex; /** Receipt block number. */ blockNumber: string; /** Gas consumed by the transaction. */ gasUsed: string; /** Receipt status. */ status: 'success' | 'reverted'; /** Transaction hash. */ transactionHash: Hex; }; /** One cumulative recipient entitlement. */ export type Entitlement = { /** EarnShare owed cumulatively. */ cumulativeAmount: string; /** Committed recipient. */ recipient: Address; }; /** One proof-bearing statement entry. */ export type StatementEntry = Entitlement & { /** Domain-separated leaf hash. */ leaf: Hex; }; /** One cumulative v2 Merkle statement. */ export type Statement = { /** Zero-padded EarnVault campaign id. */ campaignId: Hex; /** Tempo chain containing the distributor. */ chainId: number; /** EarnShare distributor address. */ distributor: Address; /** Sorted cumulative entries. */ entries: readonly StatementEntry[]; /** Merkle root. */ root: Hex; /** Statement schema version. */ schemaVersion: 2; /** Content hash of the statement payload. */ statementHash: Hex; /** Sum of all cumulative entitlements. */ totalEntitlement: string; }; /** One permissionless cumulative multiproof payout batch. */ export type PayoutBatch = { /** Cumulative amounts matching `recipients`. */ cumulativeAmounts: readonly string[]; /** StandardMerkleTree multiproof. */ multiproof: readonly Hex[]; /** OpenZeppelin multiproof queue flags. */ proofFlags: readonly boolean[]; /** Committed recipients in multiproof leaf order. */ recipients: readonly Address[]; }; /** Returns the next interval boundary relative to a schedule origin. */ export declare function nextBoundary(options: nextBoundary.Options): number; export declare namespace nextBoundary { /** Inputs for locating a schedule-relative interval boundary. */ type Options = { /** Accounting interval length in seconds. */ intervalSeconds: number; /** Unix timestamp anchoring the schedule's interval grid. */ origin: number; /** Unix timestamp after which the boundary must fall. */ timestamp: number; }; } /** Calculates simple ACT/365 reward assets and the carried division remainder. */ export declare function accrue(options: accrue.Options): accrue.Result; export declare namespace accrue { /** Inputs for one simple annual reward calculation. */ type Options = { /** Annual reward rate in basis points. */ annualRateBps: number; /** Seconds covered by the calculation. */ elapsedSeconds: number; /** Base-asset principal earning rewards. */ principalAssets: bigint; /** Division remainder carried from earlier intervals. */ remainder: bigint; }; /** Exact integer result and its remainder. */ type Result = { /** Whole base-asset units earned. */ amount: bigint; /** Numerator remainder carried into the next interval. */ remainder: bigint; }; } /** Allocates every minted EarnShare unit by deterministic largest remainder. */ export declare function allocate(options: allocate.Options): ReadonlyMap; export declare namespace allocate { /** Inputs for exact minted-share allocation. */ type Options = { /** Exact EarnShare units minted. */ earnShares: bigint; /** Per-recipient base-asset rewards. */ rewards: readonly { assets: bigint; recipient: Address; }[]; }; } /** Whether an unpaid EarnShare balance meets its base-asset payout floor. */ export declare function meetsPayoutMinimum(options: meetsPayoutMinimum.Options): boolean; export declare namespace meetsPayoutMinimum { /** Cumulative entitlement and current vault-value inputs. */ type Options = { /** Recipient's cumulative EarnShare entitlement. */ cumulativeEntitlement: bigint; /** Recipient's cumulative paid EarnShare amount. */ cumulativePaid: bigint; /** Minimum base-asset value required for automatic payout. */ minimumAssets: bigint; /** Current fee-inclusive vault assets. */ totalAssets: bigint; /** Current fee-inclusive EarnShare supply. */ totalEarnShares: bigint; }; } /** Builds an OpenZeppelin StandardMerkleTree-compatible cumulative statement. */ export declare function buildStatement(options: buildStatement.Options): Statement; export declare namespace buildStatement { /** Domain and entitlement inputs for one statement. */ type Options = { /** Zero-padded EarnVault campaign id. */ campaignId: Hex; /** Tempo chain containing the distributor. */ chainId: number; /** EarnShare distributor address. */ distributor: Address; /** Cumulative recipient entitlements. */ entitlements: readonly Entitlement[]; }; } /** Splits a cumulative statement into contiguous multiproof payout batches. */ export declare function buildPayoutBatches(statement: Statement, options: buildPayoutBatches.Options): readonly PayoutBatch[]; /** Rebuilds one individual recovery proof from the current cumulative statement. */ export declare function buildProof(statement: Statement, recipient: Address): readonly Hex[] | undefined; export declare namespace buildPayoutBatches { /** Runtime batch constraints. */ type Options = { /** Maximum recipients in one bounded payout call. */ maximumSize: number; /** Optional preflight-authorized recipient set. */ recipients?: ReadonlySet | undefined; }; } /** Computes the distributor's domain-separated standard leaf. */ export declare function rewardLeaf(options: rewardLeaf.Options): Hex; export declare namespace rewardLeaf { /** Domain and recipient inputs for one leaf. */ type Options = { /** Zero-padded EarnVault campaign id. */ campaignId: Hex; /** Tempo chain containing the distributor. */ chainId: number; /** Cumulative EarnShare amount. */ cumulativeAmount: bigint; /** EarnShare distributor address. */ distributor: Address; /** Committed recipient. */ recipient: Address; }; } //# sourceMappingURL=Campaigns.d.ts.map