import { type ColumnType, type JSONColumnType } from 'kysely'; import type { Address, Hex } from 'viem'; import type * 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_transaction_attempts` table. */ export type Table = Omit & { /** Bigint chain id, read as a string from pg and written as a number. */ chainId: ColumnType; /** Typed transaction intent. */ intent: JSONColumnType; /** Canonical receipt evidence. */ receipt: JSONColumnType; }; /** A stored signed transaction attempt. */ export type Record = db_Schema.RewardTransactionAttempt; /** Creates a typed attempt before requesting a signature. */ export declare function create(db: Db.Db, options: create.Options): Promise; export declare namespace create { /** Typed transaction attempt input. */ type Options = { /** Chain receiving the transaction. */ chainId: number; /** Typed signer intent. */ intent: Campaigns.TransactionIntent; /** Replaced attempt id. */ replacementOf?: string | undefined; /** Owning reward run id. */ runId?: string | undefined; /** Signing account. */ signer: Address; /** Bound EarnVault. */ vaultAddress: Address; }; } /** Persists exact signed bytes before broadcast. */ export declare function recordSignature(db: Db.Db, options: recordSignature.Options): Promise; export declare namespace recordSignature { /** Signed transaction evidence. */ type Options = { /** Expiring nonce deadline (ISO 8601). */ expiresAt: string | null; /** Attempt id. */ id: string; /** Account nonce. */ nonce: string | null; /** Exact signed transaction bytes. */ signedBytes: Hex; /** Hash derived from the signed bytes. */ transactionHash: Hex; }; } /** Marks a signed attempt as broadcast without changing its bytes. */ export declare function recordBroadcast(db: Db.Db, id: string): Promise; /** Marks an unconfirmed expiring-nonce attempt terminal before replacement. */ export declare function expire(db: Db.Db, id: string): Promise; /** Records a canonical terminal receipt. */ export declare function confirm(db: Db.Db, options: confirm.Options): Promise; export declare namespace confirm { /** Confirmed receipt evidence. */ type Options = { /** Attempt id. */ id: string; /** Compact terminal intent retained after exact bytes can no longer be retried. */ intent?: Campaigns.TransactionIntent | undefined; /** Canonical transaction receipt. */ receipt: Campaigns.TransactionReceipt; }; } /** Marks a confirmed transaction that produced no requested state change as terminal. */ export declare function markIneffective(db: Db.Db, id: string): Promise; /** Reads one transaction attempt. */ export declare function get(db: Db.Db, id: string): Promise; /** Reads the newest attempt for one deterministic intent within its execution. */ export declare function latestForIntent(db: Db.Db, options: latestForIntent.Options): Promise; export declare namespace latestForIntent { /** Intent and execution identity. */ type Options = { /** Deterministic typed intent id. */ intentId: Hex; /** Owning reward run, omitted only for campaign provisioning. */ runId?: string | undefined; }; } /** Lists confirmed transaction evidence for one run in creation order. */ export declare function confirmedForRun(db: Db.Db, runId: string): Promise; /** Lists every durable transaction attempt for one run in creation order. */ export declare function listForRun(db: Db.Db, runId: string): Promise; /** Reads the newest nonterminal or confirmed attempt recoverable by one run operation. */ export declare function latestRecoverable(db: Db.Db, options: latestRecoverable.Options): Promise; export declare namespace latestRecoverable { /** Run operation selector. */ type Options = { /** Typed signer operation. */ operation: Campaigns.TransactionIntent['operation']; /** Owning reward run. */ runId: string; }; } //# sourceMappingURL=rewardTransactionAttempts.d.ts.map