import { type ColumnType, type JSONColumnType } from 'kysely'; import type { Address } from 'viem'; import * as Campaigns from '../../internal/rewards/Campaigns.js'; import type * as Db from '../Db.js'; import type * as db_Schema from '../Schema.js'; /** Columns of the `reward_campaigns` table. */ export type Table = Omit & { /** Bigint chain id, read as a string from pg and written as a number. */ chainId: ColumnType; /** Active campaign configuration. */ config: JSONColumnType; /** Last applied TIDX event. */ eventCursor: JSONColumnType; /** Configuration scheduled at a future boundary. */ pendingConfig: JSONColumnType; }; /** A stored reward campaign. */ export type Record = db_Schema.RewardCampaign; /** A requested campaign configuration cannot safely replace the stored configuration. */ export declare class ConfigurationError extends Error { name: string; } /** Reads one campaign by chain and EarnVault. */ export declare function get(db: Db.Db, options: get.Options): Promise; export declare namespace get { /** Campaign identity. */ type Options = { /** Chain containing the vault. */ chainId: number; /** EarnVault address. */ vaultAddress: string; }; } /** Reads campaigns for one bounded set of EarnVaults. */ export declare function listByVaults(db: Db.Db, options: listByVaults.Options): Promise; export declare namespace listByVaults { /** Bounded campaign selector. */ type Options = { /** Chain containing every vault. */ chainId: number; /** EarnVault addresses. */ vaultAddresses: readonly string[]; }; } /** Creates a campaign or schedules its complete replacement configuration. */ export declare function upsert(db: Db.Db, options: upsert.Options): Promise; export declare namespace upsert { /** Verified vault and complete configuration. */ type Options = { /** Vault base-asset address. */ assetAddress: Address; /** Vault base-asset decimals. */ assetDecimals: number; /** Chain containing the vault. */ chainId: number; /** Complete campaign configuration. */ config: Campaigns.Config; /** Current Unix timestamp used to choose the update boundary. */ now: number; /** Vault EarnShare address. */ earnShareAddress: Address; /** Vault EarnShare decimals. */ earnShareDecimals: number; /** EarnVault address. */ vaultAddress: Address; }; } /** Changes the campaign's operational scheduler pause. */ export declare function setPaused(db: Db.Db, options: setPaused.Options): Promise; export declare namespace setPaused { /** Campaign identity and pause state. */ type Options = { /** Chain containing the vault. */ chainId: number; /** Desired scheduler pause state. */ paused: boolean; /** EarnVault address. */ vaultAddress: string; }; } /** Permanently binds one campaign to its first signer account. */ export declare function bindSigner(db: Db.Db, options: bindSigner.Options): Promise; export declare namespace bindSigner { /** Campaign identity and signer account. */ type Options = { /** Chain containing the vault. */ chainId: number; /** Signer permanently associated with the campaign. */ signerAddress: Address; /** EarnVault address. */ vaultAddress: Address; }; } /** Records verified deterministic reward periphery bindings. */ export declare function setBindings(db: Db.Db, options: setBindings.Options): Promise; export declare namespace setBindings { /** Verified periphery bindings for one campaign. */ type Options = { /** Chain containing the vault. */ chainId: number; /** Target-yield controller, when configured. */ controllerAddress?: Address | undefined; /** Configuration whose immutable periphery is being recorded. */ config?: Campaigns.Config | undefined; /** Merkle distributor, when configured. */ distributorAddress?: Address | undefined; /** Actionable provisioning error. */ error?: string | null | undefined; /** Signer owning the deterministic periphery. */ signerAddress?: Address | undefined; /** EarnVault address. */ vaultAddress: Address; }; } /** Records the latest campaign provisioning failure without changing bindings. */ export declare function setProvisioningError(db: Db.Db, options: setProvisioningError.Options): Promise; export declare namespace setProvisioningError { /** Campaign identity and current failure. */ type Options = { /** Chain containing the vault. */ chainId: number; /** Configuration observed by the failed provisioning attempt. */ config: Campaigns.Config; /** Actionable provisioning failure. */ error: string; /** EarnVault address. */ vaultAddress: Address; }; } /** Advances one campaign after every payout bundle reaches a terminal result. */ export declare function advance(db: Db.Db, options: advance.Options): Promise; export declare namespace advance { /** Fenced delivered cursor update. */ type Options = { /** Chain containing the vault. */ chainId: number; /** Newly delivered boundary. */ deliveredThrough: number; /** Final applied TIDX event. */ eventCursor?: Campaigns.EventCursor | undefined; /** Previously delivered boundary. */ expectedDeliveredThrough: number; /** EarnVault address. */ vaultAddress: string; }; } /** Lists campaigns requiring work at or before one Unix timestamp. */ export declare function listDue(db: Db.Db, options: listDue.Options): Promise; export declare namespace listDue { /** Due-campaign scan bounds. */ type Options = { /** Maximum campaigns returned. */ limit: number; /** Number of earlier due campaigns skipped. */ offset?: number | undefined; /** Unix timestamp through which work is due. */ through: number; }; } /** Lists active campaigns whose deterministic reward periphery is not recorded yet. */ export declare function listUnprovisioned(db: Db.Db, options: listUnprovisioned.Options): Promise; export declare namespace listUnprovisioned { /** Provisioning scan bounds. */ type Options = { /** Maximum campaigns returned. */ limit: number; /** Number of earlier campaigns skipped. */ offset?: number | undefined; }; } //# sourceMappingURL=rewardCampaigns.d.ts.map