import * as z from 'zod/mini'; import type * as Db from '../../db/Db.js'; import * as FundingDepositAddresses from '../../db/tables/fundingDepositAddresses.js'; import * as Provider from './Provider.js'; /** Public funding deposit address statuses. */ export declare const statuses: readonly ['action-required', 'active']; /** Lifecycle status of a funding deposit address. */ export type Status = (typeof statuses)[number]; /** Internal responsibility for delivering the requested destination token. */ export declare const deliveryStrategies: readonly ['provider', 'tempo']; /** Whether the provider or Tempo delivers the requested destination token. */ export type DeliveryStrategy = (typeof deliveryStrategies)[number]; /** Bounded provider state retained privately for reconciliation. */ export type ProviderState = Record; /** Returns whether the lifecycle allows moving between address statuses. */ export declare function canTransition(from: Status, to: Status): boolean; /** Generates a funding deposit address id (`fda_…`, lexically time-ordered). */ export declare function generateId(now?: Date): string; /** Zod schemas owned by the funding deposit address resource. */ export declare namespace schema { /** Funding deposit address lifecycle status. */ const Status: z.ZodMiniEnum<{ "action-required": "action-required"; active: "active"; }>; /** Public fields persisted as the address snapshot. */ const Snapshot: z.ZodMiniObject<{ address: z.ZodMiniString; destinationChain: z.ZodMiniObject<{ addressFormat: z.ZodMiniEnum<{ base58: "base58"; base58check: "base58check"; hex: "hex"; }>; id: z.ZodMiniString; kind: z.ZodMiniEnum<{ evm: "evm"; solana: "solana"; tron: "tron"; }>; name: z.ZodMiniString; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ address: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>; provider: z.ZodMiniObject<{ id: z.ZodMiniString; name: z.ZodMiniString; }, z.core.$strip>; recipient: z.ZodMiniString; refundAddress: z.ZodMiniString; sourceChain: z.ZodMiniObject<{ addressFormat: z.ZodMiniEnum<{ base58: "base58"; base58check: "base58check"; hex: "hex"; }>; id: z.ZodMiniString; kind: z.ZodMiniEnum<{ evm: "evm"; solana: "solana"; tron: "tron"; }>; name: z.ZodMiniString; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ address: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>; subsidize: z.ZodMiniBoolean; }, z.core.$strip>; /** One reusable funding deposit address. */ const FundingDepositAddress: z.ZodMiniObject<{ address: z.ZodMiniString; createdAt: z.ZodMiniISODateTime; destinationChain: z.ZodMiniObject<{ addressFormat: z.ZodMiniEnum<{ base58: "base58"; base58check: "base58check"; hex: "hex"; }>; id: z.ZodMiniString; kind: z.ZodMiniEnum<{ evm: "evm"; solana: "solana"; tron: "tron"; }>; name: z.ZodMiniString; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ address: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>; id: z.ZodMiniString; provider: z.ZodMiniObject<{ id: z.ZodMiniString; name: z.ZodMiniString; }, z.core.$strip>; recipient: z.ZodMiniString; refundAddress: z.ZodMiniString; sourceChain: z.ZodMiniObject<{ addressFormat: z.ZodMiniEnum<{ base58: "base58"; base58check: "base58check"; hex: "hex"; }>; id: z.ZodMiniString; kind: z.ZodMiniEnum<{ evm: "evm"; solana: "solana"; tron: "tron"; }>; name: z.ZodMiniString; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ address: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>; status: z.ZodMiniEnum<{ "action-required": "action-required"; active: "active"; }>; subsidize: z.ZodMiniBoolean; updatedAt: z.ZodMiniISODateTime; }, z.core.$strip>; /** A reusable funding deposit address with terms sampled during creation. */ const CreatedFundingDepositAddress: z.ZodMiniObject<{ address: z.ZodMiniString; createdAt: z.ZodMiniISODateTime; destinationChain: z.ZodMiniObject<{ addressFormat: z.ZodMiniEnum<{ base58: "base58"; base58check: "base58check"; hex: "hex"; }>; id: z.ZodMiniString; kind: z.ZodMiniEnum<{ evm: "evm"; solana: "solana"; tron: "tron"; }>; name: z.ZodMiniString; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ address: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>; id: z.ZodMiniString; provider: z.ZodMiniObject<{ id: z.ZodMiniString; name: z.ZodMiniString; }, z.core.$strip>; recipient: z.ZodMiniString; refundAddress: z.ZodMiniString; sourceChain: z.ZodMiniObject<{ addressFormat: z.ZodMiniEnum<{ base58: "base58"; base58check: "base58check"; hex: "hex"; }>; id: z.ZodMiniString; kind: z.ZodMiniEnum<{ evm: "evm"; solana: "solana"; tron: "tron"; }>; name: z.ZodMiniString; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ address: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>; status: z.ZodMiniEnum<{ "action-required": "action-required"; active: "active"; }>; subsidize: z.ZodMiniBoolean; updatedAt: z.ZodMiniISODateTime; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; }, z.core.$strip>; destinationAmountMin: z.ZodMiniOptional; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; }, z.core.$strip>>; fees: z.ZodMiniArray; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; }, z.core.$strip>; side: z.ZodMiniEnum<{ destination: "destination"; source: "source"; }>; token: z.ZodMiniObject<{ address: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>; type: z.ZodMiniEnum<{ provider: "provider"; }>; }, z.core.$strip>>; quote: z.ZodMiniObject<{ expiresAt: z.ZodMiniOptional; sampledAt: z.ZodMiniISODateTime; }, z.core.$strip>; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; }, z.core.$strip>; }, z.core.$strip>; } /** Stored public snapshot of a funding deposit address. */ export type Snapshot = z.output; /** A funding deposit address as returned by reads. */ export type Public = z.output; /** A funding deposit address returned by creation with current quoted terms. */ export type Created = z.output; /** Creates a durable funding deposit address for an already-provisioned provider address. */ export declare function create(db: Db.Db, input: create.Input): Promise; /** Creates or returns the reusable address for the same owner and route. */ export declare function createOrGet(db: Db.Db, input: createOrGet.Input): Promise; export declare namespace createOrGet { /** Fields required to persist or find a provisioned deposit address. */ type Input = create.Input; /** Whether provisioning created or matched the stored reusable address. */ type ReturnType = { /** Stored reusable deposit address. */ record: FundingDepositAddresses.Record; /** Whether the provider address was newly stored or matched an existing identity. */ type: 'created' | 'existing'; }; } export declare namespace create { /** Fields required to persist a provisioned deposit address. */ type Input = { /** API key that provisioned the address. */ apiKeyId: string; /** Responsibility for delivering the requested destination token. */ deliveryStrategy: DeliveryStrategy; /** Key environment the address belongs to. */ environment: 'production' | 'sandbox'; /** Address id override for deterministic tests. */ id?: string | undefined; /** Creation time override for deterministic tests. */ now?: Date | undefined; /** Owning organization id (`org_…`). */ orgId: string; /** Attributed project id for a project-scoped API key. */ projectId?: string | undefined; /** Token that the provider outputs on Tempo. */ providerOutputToken: Provider.TokenRef; /** Private provider request identifiers. */ providerRequestIds?: readonly string[] | undefined; /** Private bounded provider state. */ providerState?: ProviderState | undefined; /** Public address snapshot. */ snapshot: Snapshot; }; } /** Applies a version-guarded funding deposit address status transition. */ export declare function transition(db: Db.Db, options: transition.Options): Promise; export declare namespace transition { /** Fields required for a guarded status transition. */ type Options = { /** Version that the transition was computed against. */ expectedVersion: number; /** Funding deposit address id (`fda_…`). */ id: string; /** New lifecycle status. */ status: Status; }; /** Outcome of a guarded address transition. */ type Result = { record: FundingDepositAddresses.Record; type: 'applied'; } | { current: FundingDepositAddresses.Record; type: 'invalid'; } | { current: FundingDepositAddresses.Record; type: 'stale'; } | { type: 'not_found'; }; } /** Serializes a stored address to the public read shape. */ export declare function toPublic(record: FundingDepositAddresses.Record): Public; /** Error thrown when a provider conflicts with a stored reusable address. */ export declare class ConflictError extends Error { name: string; } //# sourceMappingURL=DepositAddress.d.ts.map