import type { JsonObject } from "@decionis/agent-safe-pipeline"; import { type Sha256 } from "../JcsDigest.js"; import type { AdapterExecution, AdapterReconciliation, EffectAdapter, PreparedAction, ProviderReconciliationResult, ProviderResult } from "../EffectAdapter.js"; import { transportActionName, type BankingAction } from "./BankingAction.js"; export declare class BankingActionError extends Error { readonly code: string; constructor(code: string); } /** What a banking adapter needs beyond the generic contract. */ export interface BankingTransport { /** Sends the action, once. Throws `IndeterminateOutcome` when nothing can be concluded. */ execute(execution: AdapterExecution): Promise; /** Asks what happened to an idempotency key. Read-only, always. */ reconcile(context: AdapterReconciliation): Promise; } export interface BankingAdapterOptions { readonly id: string; readonly version: string; readonly transport: BankingTransport; } /** * The banking family's adapter: the BEAP vocabulary over the generic * contract. `prepare` is where the profile's arithmetic happens and where a * malformed action is refused before the authority is asked: * * - the amount is read through `Money`, so a decimal whose scale is not the * currency's is `AMOUNT_SCALE_INVALID` rather than a rounded number; * - an `iban:` reference with bad check digits is refused, because a typo * that would still reach a valid-looking account is worth catching here; * - the action type must be one the profile registers for its domain, and * the expected effect is the projection that registry names. * * The intent digest is taken over the canonical action exactly as received, * which is what the authority signs its binding against, and the * expected-effect digest over the projection, which is what an observation * is later compared to. */ export declare class BankingAdapter implements EffectAdapter { private readonly options; readonly id: string; readonly version: string; constructor(options: BankingAdapterOptions); /** Every transport name the profile's registered actions produce. */ get actionTypes(): readonly string[]; prepare(action: BankingAction): PreparedAction; execute(execution: AdapterExecution): Promise; /** * The observation, as the profile's projection. Only a provider that * returned the effect's own fields can produce one; an acknowledgement * carries none, and none is invented for it. */ observeEffect(result: ProviderResult, prepared: PreparedAction): JsonObject | null; reconcile(context: AdapterReconciliation): Promise; /** The digest of an action, for a caller that wants it without preparing. */ static intentDigest(action: BankingAction): Sha256; } /** The transport names of every action this build registers. */ export declare function registeredActionNames(): readonly string[]; export { transportActionName }; //# sourceMappingURL=BankingAdapter.d.ts.map