import type { ColumnType } from 'kysely'; import type * as Db from '../Db.js'; import type * as db_Schema from '../Schema.js'; /** Columns of the `reward_credits` table. */ export type Table = Omit & { /** Bigint chain id, read as a string from pg and written as a number. */ chainId: ColumnType; }; /** A stored manual reward credit. */ export type Record = db_Schema.RewardCredit; /** * Records one credit and adds it to the recipient's pending rewards atomically. * A repeated `(recipient, reference)` is a no-op, so a batch can be replayed safely. */ export declare function apply(db: Db.Db, options: apply.Options): Promise; export declare namespace apply { /** One credit to record. */ type Options = { /** Base-asset reward units to add. */ assets: bigint; /** Chain containing the vault. */ chainId: number; /** Registered recipient with a stored `reward_accounts` row. */ recipient: string; /** Batch reference; the same reference never credits a recipient twice. */ reference: string; /** EarnVault address. */ vaultAddress: string; }; /** Whether this call recorded the credit or found it already applied. */ type Result = { credited: boolean; }; } /** Lists one campaign's credits, optionally for one reference. */ export declare function list(db: Db.Db, options: list.Options): Promise; export declare namespace list { /** Campaign identity and optional batch filter. */ type Options = { /** Chain containing the vault. */ chainId: number; /** Batch reference to filter by. */ reference?: string | undefined; /** EarnVault address. */ vaultAddress: string; }; } /** Thrown when a credit targets a recipient without a stored reward account. */ export declare class MissingAccountError extends Error { name: string; constructor(recipient: string); } //# sourceMappingURL=rewardCredits.d.ts.map