import * as z from 'zod/mini'; import * as core_Provider from '../Provider.js'; import * as Action from './Action.js'; import type * as core_Catalog from './Catalog.js'; import type * as core_Chain from './Chain.js'; import type * as core_Route from './Route.js'; import type * as core_Token from './Token.js'; import type * as Transfer from './Transfer.js'; /** Funding provider schemas. */ export declare namespace schema { /** Bounded upstream error code safe for structured logs. */ const ErrorCode: z.ZodMiniString; /** Nested upstream error fields used to extract a stable code. */ const Error: z.ZodMiniObject<{ code: z.ZodMiniOptional>; type: z.ZodMiniOptional>; }, z.core.$strip>; /** Common upstream error body fields used to extract a stable code. */ const ErrorBody: z.ZodMiniObject<{ _tag: z.ZodMiniOptional>; code: z.ZodMiniOptional>; error: z.ZodMiniOptional>; type: z.ZodMiniOptional>; }, z.core.$strip>>; errorCode: z.ZodMiniOptional>; errorType: z.ZodMiniOptional>; type: z.ZodMiniOptional>; }, z.core.$strip>; /** Positive decimal amount accepted by funding quote requests. */ const PositiveDecimal: z.ZodMiniString; /** Positive base-unit amount accepted by funding quote requests. */ const PositiveInteger: z.ZodMiniString; /** Normalized chain reference passed to funding providers. */ const ChainRef: 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>; /** Normalized token reference passed to funding providers. */ const TokenRef: 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 identity embedded in funding resources. */ const ProviderRef: z.ZodMiniObject<{ id: z.ZodMiniString; name: z.ZodMiniString; }, z.core.$strip>; /** Source amount unit accepted by a funding quote request. */ const SourceAmountUnits: z.ZodMiniDefault>; /** Normalized caller request passed to funding providers. */ const QuoteRequest: z.ZodMiniObject<{ destinationToken: z.ZodMiniOptional>; provider: z.ZodMiniOptional>; sourceAmount: z.ZodMiniString; sourceAmountUnits: z.ZodMiniDefault>; sourceChain: z.ZodMiniString; sourceToken: z.ZodMiniString; }, z.core.$strict>; /** Provider-specific quote status for the requested amount. */ const QuoteStatus: z.ZodMiniEnum<{ available: "available"; thin: "thin"; unavailable: "unavailable"; unknown: "unknown"; }>; /** Machine-readable provider quote quality tier. */ const QualityTier: z.ZodMiniEnum<{ liquid: "liquid"; thin: "thin"; unavailable: "unavailable"; unknown: "unknown"; }>; /** Quote data returned by a funding provider. */ const GetQuoteResult: z.ZodMiniObject<{ expiresAt: z.ZodMiniOptional; destinationAmountMin: z.ZodMiniOptional>; destinationAmount: z.ZodMiniOptional>; quality: z.ZodMiniOptional>; liquiditySource: z.ZodMiniString; sourceDetail: z.ZodMiniOptional>; tier: z.ZodMiniOptional>; }, z.core.$strip>>; sampledAt: z.ZodMiniISODateTime; status: z.ZodMiniEnum<{ available: "available"; thin: "thin"; unavailable: "unavailable"; unknown: "unknown"; }>; }, z.core.$strip>; /** Executable preparation returned by a funding provider. */ const PrepareResult: z.ZodMiniObject<{ action: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{ calls: z.ZodMiniArray; to: z.ZodMiniString; value: z.ZodMiniString; }, z.core.$strip>>; type: z.ZodMiniLiteral<"evm:calls">; }, z.core.$strip>], "type">; correlation: z.ZodMiniOptional>; requestId: z.ZodMiniString; }, z.core.$strip>>; destinationAmount: z.ZodMiniString; destinationAmountMin: z.ZodMiniString; expiresAt: z.ZodMiniOptional; fees: z.ZodMiniArray; side: z.ZodMiniEnum<{ destination: "destination"; source: "source"; }>; token: z.ZodMiniOptional; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>>; }, z.core.$strip>>; providerState: z.ZodMiniOptional, z.ZodMiniUnknown>>; quality: z.ZodMiniOptional>; liquiditySource: z.ZodMiniString; sourceDetail: z.ZodMiniOptional>; tier: z.ZodMiniOptional>; }, z.core.$strip>>; sampledAt: z.ZodMiniISODateTime; }, z.core.$strip>; /** Reusable deposit address provisioned by a funding provider. */ const DepositAddressResult: z.ZodMiniObject<{ address: z.ZodMiniString; correlation: z.ZodMiniObject<{ checkEndpoint: z.ZodMiniOptional>; requestId: z.ZodMiniString; }, z.core.$strip>; destinationAmount: z.ZodMiniString; destinationAmountMin: z.ZodMiniString; expiresAt: z.ZodMiniOptional; fees: z.ZodMiniArray; side: z.ZodMiniEnum<{ destination: "destination"; source: "source"; }>; token: z.ZodMiniOptional; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; name: z.ZodMiniString; standard: z.ZodMiniString; symbol: z.ZodMiniString; tokenKey: z.ZodMiniString; verified: z.ZodMiniBoolean; }, z.core.$strip>>; }, z.core.$strip>>; sampledAt: z.ZodMiniISODateTime; }, z.core.$strip>; /** One provider request discovered for a reusable deposit address. */ const DepositAddressRequest: z.ZodMiniObject<{ createdAt: z.ZodMiniISODateTime; destinationTransactionHashes: z.ZodMiniArray>; id: z.ZodMiniString; providerState: z.ZodMiniOptional, z.ZodMiniUnknown>>; refundAmountExpected: z.ZodMiniOptional>; refundTransactionHashes: z.ZodMiniArray>; sourceTransactionHashes: z.ZodMiniArray>; status: z.ZodMiniString; updatedAt: z.ZodMiniISODateTime; }, z.core.$strip>; /** One page of provider requests discovered for a reusable address. */ const DepositAddressRequestsResult: z.ZodMiniObject<{ continuation: z.ZodMiniOptional>; requests: z.ZodMiniArray>; id: z.ZodMiniString; providerState: z.ZodMiniOptional, z.ZodMiniUnknown>>; refundAmountExpected: z.ZodMiniOptional>; refundTransactionHashes: z.ZodMiniArray>; sourceTransactionHashes: z.ZodMiniArray>; status: z.ZodMiniString; updatedAt: z.ZodMiniISODateTime; }, z.core.$strip>>; }, z.core.$strip>; /** Quote quality signals exposed to funding API callers. */ const FundingQuoteQuality: z.ZodMiniObject<{ estimatedSeconds: z.ZodMiniOptional>; liquiditySource: z.ZodMiniString; sourceDetail: z.ZodMiniOptional>; tier: z.ZodMiniEnum<{ liquid: "liquid"; thin: "thin"; }>; }, z.core.$strip>; /** Provider quote freshness data exposed to funding API callers. */ const QuoteDetails: z.ZodMiniObject<{ expiresAt: z.ZodMiniOptional; sampledAt: z.ZodMiniISODateTime; }, z.core.$strip>; /** Successful normalized funding quote returned to callers. */ const FundingQuote: z.ZodMiniObject<{ 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>>; 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>; quality: z.ZodMiniObject<{ estimatedSeconds: z.ZodMiniOptional>; liquiditySource: z.ZodMiniString; sourceDetail: z.ZodMiniOptional>; tier: z.ZodMiniEnum<{ liquid: "liquid"; thin: "thin"; }>; }, 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>; 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>; }, z.core.$strip>; } /** Chain metadata declared by a funding route. */ export type Chain = core_Chain.Chain; /** Token metadata declared by a funding route. */ export type Token = core_Token.Resolved; /** Provider ids accepted by funding quote requests. */ export type ProviderId = string; /** Provider-specific quote status for the requested amount. */ export type QuoteStatus = z.output; /** Machine-readable quote quality tier. */ export type QualityTier = z.output; /** Normalized chain reference passed to funding providers. */ export type ChainRef = z.output; /** Normalized token amount passed to funding providers. */ export type TokenAmount = ReturnType; /** Normalized token reference passed to funding providers. */ export type TokenRef = z.output; /** A normalized internal candidate passed to funding quote providers. */ export type QuoteCandidate = ReturnType; /** A normalized route candidate passed to deposit-address providers. */ export type DepositAddressCandidate = ReturnType; /** A successful normalized funding quote returned to callers. */ export type FundingQuote = z.output; /** Cache policy for a single funding quote request. */ export type CachePolicy = { /** Whether providers should bypass their own quote or inventory caches. */ bypass: boolean; }; /** Normalized caller request passed to funding providers. */ export type QuoteRequest = z.output; /** Contract of the provider `getQuote` method. */ export declare namespace getQuote { /** Input passed to a funding provider for one curated quote candidate. */ type Parameters = { /** Curated candidate selected for live provider quoting. */ candidate: QuoteCandidate; /** Cache policy for provider-side discovery and quote lookups. */ cache: CachePolicy; /** Destination chain, always Tempo mainnet in V1. */ destinationChain: ChainRef; /** Tempo token expected from this quote. */ destinationToken: TokenRef; /** Normalized caller request that produced this quote candidate. */ request: QuoteRequest; /** Canonical funding route selected for this quote candidate. */ route: core_Route.Route; /** Source amount in base units and display form. */ sourceAmount: TokenAmount; /** Chain where the caller currently holds funds. */ sourceChain: ChainRef; /** Token the caller currently holds. */ sourceToken: TokenRef; }; /** Quote data returned by a funding provider. */ type ReturnType = z.output; } /** Contract of the provider `prepareTransfer` method. */ export declare namespace prepareTransfer { /** Private provider correlation retained for tracking, never exposed publicly. */ type Correlation = { /** Provider status endpoint bound to this preparation, when returned. */ checkEndpoint?: string | undefined; /** Provider-issued request identifier. */ requestId: string; }; /** Input passed to a funding provider preparing one executable transfer. */ type Parameters = { /** Curated candidate selected for preparation. */ candidate: QuoteCandidate; /** Funding method the caller selected. */ method: Transfer.Method; /** Amount mode the caller selected. */ mode: Transfer.Mode; /** Final beneficiary on the destination chain. */ recipient: string; /** Source-chain account that signs the funding action. */ sender: string; /** Caller slippage bound in basis points. */ slippageBps?: number | undefined; }; /** Executable preparation returned by a funding provider. */ type ReturnType = z.output; } /** Contract for provider-specific executable action validation. */ export declare namespace validateTransferAction { /** Prepared action and its curated route terms. */ type Parameters = prepareTransfer.Parameters & { /** Executable action returned by the provider. */ action: Action.Action; }; /** Provider-specific constraints established by validation. */ type ReturnType = { /** Exact native values independently validated against provider calldata. */ nativeValues?: readonly Action.NativeValue[] | undefined; }; } /** Contract for provider-specific source transaction verification. */ export declare namespace verifySourceTransaction { /** Stored transfer terms and submitted source transaction. */ type Parameters = { /** Configured chain that receives the provider delivery. */ destinationChain: Chain; /** Private provider state captured while preparing the transfer. */ providerState?: Transfer.ProviderState | undefined; /** Current configuration for the stored provider route. */ routeConfiguration?: core_Catalog.Configuration | undefined; /** Configured chain containing the submitted transaction. */ sourceChain: Chain; /** Submitted transaction reference. */ transactionHash: string; /** Stored public transfer terms. */ transfer: Transfer.Snapshot; }; /** Source transaction verification outcome. */ type ReturnType = { type: 'invalid'; } | { type: 'pending'; } | { /** Private provider evidence retained for reconciliation. */ providerState?: Transfer.ProviderState | undefined; /** The transaction matches the stored transfer terms. */ type: 'verified'; }; } /** Contract of the provider `createDepositAddress` method. */ export declare namespace createDepositAddress { /** Input passed to a provider provisioning one reusable deposit address. */ type Parameters = { /** Source token amount in base units used for initial route provisioning. */ amount: string; /** Curated reusable-address route selected for provisioning. */ candidate: DepositAddressCandidate; /** Final beneficiary on Tempo. */ recipient: string; /** Source-chain account that receives refunds. */ refundAddress: string; /** Whether Tempo guarantees normalized 1:1 delivery. */ subsidize: boolean; }; /** Reusable address and private provider correlation. */ type ReturnType = z.output; } /** Contract of the provider `listDepositAddressRequests` method. */ export declare namespace listDepositAddressRequests { /** Input passed to a provider when reconciling one reusable address. */ type Parameters = { /** Reusable provider deposit address. */ address: string; /** Opaque provider cursor returned by the previous page. */ continuation?: string | undefined; /** Existing provider request to refresh directly. */ requestId?: string | undefined; }; /** One page of normalized provider requests. */ type ReturnType = z.output; } /** Contract of the provider `observeDepositAddressRequest` method. */ export declare namespace observeDepositAddressRequest { /** Verified source transfer used to correlate provider delivery. */ type Source = { /** Token quantity in base units. */ amount: string; /** Verified source transaction reference. */ transactionHash: string; }; /** Input passed to a provider observing one pending reusable-address request. */ type Parameters = { /** Provider-owned reusable deposit address. */ address: string; /** Chain that receives provider delivery. */ destinationChain: ChainRef; /** Token delivered by the provider. */ destinationToken: TokenRef; /** Bounded private provider correlation from an earlier observation. */ providerState?: Record | undefined; /** Final beneficiary on the destination chain. */ recipient: string; /** Source-chain account credited by the provider deposit. */ refundAddress: string; /** Provider request, when the provider has indexed the source transfer. */ request?: listDepositAddressRequests.ReturnType['requests'][number] | undefined; /** One verified source transfer received by the deposit address. */ source: Source; /** Chain containing the source transfer. */ sourceChain: ChainRef; /** Token received by the reusable address. */ sourceToken: TokenRef; }; /** Private provider evidence shared by pending and verified observations. */ type Evidence = { /** Bounded private provider correlation retained for reconciliation. */ providerState?: Record | undefined; /** Verified provider-leg transaction references. */ providerTransactionHashes?: readonly string[] | undefined; }; /** Bounded provider delivery observation. */ type ReturnType = Evidence & ({ /** No matching provider delivery has reached the destination yet. */ type: 'pending'; } | { /** This provider or route cannot produce authenticated delivery observations. */ type: 'unsupported'; } | { /** Verified destination transaction references. */ destinationTransactionHashes: readonly string[]; /** Authenticated provider delivery was observed onchain. */ type: 'verified'; }); } /** Optional webhook capability implemented by a complete funding integration. */ export type Webhook = { /** Authenticates, resolves, and enqueues one provider status event. */ receive(input: Webhook.receive.Parameters): Promise; /** Authenticates a provider status event and returns its bounded hint. */ verify(input: Webhook.verify.Parameters): Webhook.verify.ReturnType; }; /** Contracts for a funding provider webhook capability. */ export declare namespace Webhook { /** Contracts for receiving one authenticated provider webhook. */ namespace receive { /** Raw provider webhook request passed to a funding integration. */ type Parameters = { /** Exact request body bytes decoded as UTF-8. */ body: string; /** Original provider webhook headers. */ headers: Headers; }; /** Durable queue message emitted for one authenticated funding status hint. */ type Dispatchable = { /** Stored funding deposit address id. */ addressId: string; /** Bounded follow-up state for work awaiting provider or settlement confirmation. */ followUp?: FollowUp | undefined; /** Reconciliation lease fencing token, when a scheduled poll already claimed the address. */ pollLeaseVersion?: number | undefined; /** Optional provider request id that triggered reconciliation. */ requestId?: string | undefined; /** Mechanism that requested reconciliation. */ trigger: 'chain' | 'manual' | 'poll' | 'webhook'; /** Reconciliation queue message discriminator. */ type: 'funding:deposit-address:reconcile'; /** Authenticated provider webhook timing carried into reconciliation. */ webhookTiming?: WebhookTiming | undefined; }; /** Bounded follow-up state carried between delayed reconciliation messages. */ type FollowUp = { /** Zero-based attempt in the current follow-up schedule. */ attempt: number; /** Work that still awaits confirmation. */ kind: 'delivery' | 'provider' | 'settlement'; }; /** Authenticated provider webhook timing used for latency measurement. */ type WebhookTiming = { /** When Tempo sent the reconciliation message to its queue. */ enqueuedAt: string; /** Bounded provider status carried by the webhook. */ providerStatus: string; /** When the provider last changed the request status. */ providerUpdatedAt: string; /** When Tempo started processing the webhook request. */ receivedAt: string; /** When the provider sent the signed webhook. */ sentAt: string; }; /** Durable reconciliation message, including messages queued before trigger attribution. */ type Queued = Omit & { /** Mechanism that requested reconciliation, when written by a trigger-aware producer. */ trigger?: Dispatchable['trigger'] | undefined; }; /** Safe disposition of one authenticated funding provider webhook. */ type ReturnType = { addressId: string; type: 'queued'; } | { type: 'ignored'; } | { type: 'unknown_address'; }; } /** Contracts for verifying one provider webhook. */ namespace verify { /** Raw provider webhook request passed to a funding integration. */ type Parameters = receive.Parameters; /** Authenticated provider hint extracted from a funding webhook. */ type ReturnType = { /** Reusable provider address, when the provider attributed one. */ address?: string | undefined; /** Bounded provider status carried by the webhook. */ providerStatus?: string | undefined; /** When the provider last changed the request status. */ providerUpdatedAt?: string | undefined; /** Provider request id, when included in the event. */ requestId?: string | undefined; /** When the provider sent the signed webhook. */ sentAt?: string | undefined; }; } } /** A funding provider descriptor and live quote implementation. */ export type Provider = core_Provider.Provider & { /** Provisions a reusable funding deposit address, when supported. */ createDepositAddress?(input: createDepositAddress.Parameters, signal: AbortSignal): Promise; /** Requests a live funding quote. */ getQuote(input: getQuote.Parameters, signal: AbortSignal): Promise; /** Lists requests discovered for a reusable deposit address, when supported. */ listDepositAddressRequests?(input: listDepositAddressRequests.Parameters, signal: AbortSignal): Promise; /** Observes authenticated delivery for a verified reusable-address transfer, when supported. */ observeDepositAddressRequest?(input: observeDepositAddressRequest.Parameters, signal: AbortSignal): Promise; /** Prepares an executable funding transfer, when the provider supports it. */ prepareTransfer?(input: prepareTransfer.Parameters, signal: AbortSignal): Promise; /** Validates provider-specific action semantics before generic persistence checks. */ validateTransferAction?(input: validateTransferAction.Parameters): validateTransferAction.ReturnType; /** Verifies a submitted source transaction, when supported. */ verifySourceTransaction?(input: verifySourceTransaction.Parameters, signal: AbortSignal): Promise; /** Receives authenticated provider status events, when configured. */ webhook?: Webhook | undefined; }; /** Defines a funding provider from its identity and quote implementation. */ export declare function from(options: from.Options): Provider; export declare namespace from { /** Funding provider definition. */ type Options = Omit, 'type'>; } /** Narrows a registered provider to a funding provider. */ export declare function is(provider: core_Provider.Provider): provider is Provider; /** Narrows a funding provider to one that prepares executable transfers. */ export declare function canPrepareTransfer(provider: Provider): provider is Provider & { prepareTransfer: NonNullable; }; /** Narrows a funding provider to one that provisions reusable deposit addresses. */ export declare function canCreateDepositAddress(provider: Provider): provider is Provider & { createDepositAddress: NonNullable; }; /** Narrows a funding provider to one that tracks reusable deposit addresses. */ export declare function canListDepositAddressRequests(provider: Provider): provider is Provider & { listDepositAddressRequests: NonNullable; }; /** Narrows a funding provider to one that observes reusable-address delivery onchain. */ export declare function canObserveDepositAddressRequest(provider: Provider): provider is Provider & { observeDepositAddressRequest: NonNullable; }; /** Narrows a funding provider to one that verifies submitted source transactions. */ export declare function canVerifySourceTransaction(provider: Provider): provider is Provider & { verifySourceTransaction: NonNullable; }; /** Narrows a funding provider to one with authenticated webhook receipt. */ export declare function canReceiveWebhook(provider: Provider): provider is Provider & { webhook: Webhook; }; /** Funding provider method recorded by request diagnostics. */ export type ProviderOperation = 'createDepositAddress' | 'getQuote' | 'listDepositAddressRequests' | 'prepareTransfer'; /** One provider attempt made while resolving a funding quote request. */ export type ProviderAttempt = { /** Wall-clock duration of the provider attempt in milliseconds. */ durationMs: number; /** Provider method invoked by the attempt. */ operation: ProviderOperation; /** Successful or expected-unavailable provider outcome. */ outcome: 'available' | 'thin' | 'unavailable'; /** Provider that handled the quote candidate. */ provider: Provider; } | { /** Error thrown by the provider boundary. */ cause: unknown; /** Wall-clock duration of the provider attempt in milliseconds. */ durationMs: number; /** Provider method invoked by the attempt. */ operation: ProviderOperation; /** Failed provider outcome. */ outcome: 'failed'; /** Provider that handled the quote candidate. */ provider: Provider; }; /** Bounded result for one provider attempt. */ export type ProviderAttemptResult = { /** Wall-clock duration of the provider attempt in milliseconds. */ durationMs: number; /** Failure class, present only when the provider attempt failed. */ failure?: failure.Result['failure'] | undefined; /** Provider identifier. */ id: string; /** Provider method invoked by the attempt. */ operation: ProviderOperation; /** Provider attempt outcome. */ outcome: ProviderAttempt['outcome']; }; /** A provider failure retained for bounded request diagnostics. */ export type ProviderFailure = { /** Error thrown by the provider boundary. */ cause: unknown; /** Provider method that failed. */ operation: ProviderOperation; /** Provider that failed. */ provider: Provider; }; /** Returns normalized chains and source tokens supported by quote providers. */ export declare function getChains(options: getChains.Options): { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; tokens: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }[]; }[]; export declare namespace getChains { /** Options for getting provider-supported source chains. */ type Options = { /** Compiled funding catalog containing provider routes. */ catalog: core_Catalog.Snapshot; /** Providers whose routes contribute source chains and tokens. */ providers: readonly Provider[]; }; } /** Returns the supplied funding quote providers. */ export declare function getProviders(options: getProviders.Options): { id: string; name: string; }[]; export declare namespace getProviders { /** Options for getting providers. */ type Options = { /** Compiled funding catalog containing provider routes. */ catalog: core_Catalog.Snapshot; /** Funding providers included in this deployment. */ providers: readonly Provider[]; }; } /** Returns successful live funding quotes from the supplied providers. */ export declare function getQuotes(options: getQuotes.Options): Promise<{ destinationAmount: { baseUnits: string; currency: string; decimals: number; formatted: string; }; destinationAmountMin?: { baseUnits: string; currency: string; decimals: number; formatted: string; } | undefined; destinationChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; destinationToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; id: string; provider: { id: string; name: string; }; quality: { estimatedSeconds?: number | undefined; liquiditySource: string; sourceDetail?: string | undefined; tier: "liquid" | "thin"; }; quote: { expiresAt?: string | undefined; sampledAt: string; }; sourceAmount: { baseUnits: string; currency: string; decimals: number; formatted: string; }; sourceChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; sourceToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; }[]>; /** Returns internal quote candidates for a normalized caller request. */ export declare function getQuoteCandidates(options: getQuoteCandidates.Options): { readonly configuration?: Record; readonly destinationChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly destinationToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; readonly id: string; readonly provider: { id: string; name: string; }; readonly route: core_Route.Route; readonly sourceAmount: { amount: string; formatted: string; }; readonly sourceChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly sourceToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; }[]; export declare namespace getQuoteCandidates { /** Options for selecting funding quote candidates. */ type Options = QuoteRequest & { /** Compiled funding catalog containing provider routes. */ catalog: core_Catalog.Snapshot; /** Funding providers considered by the request. */ providers: readonly Provider[]; }; } export declare namespace getQuotes { /** Options for requesting live funding quotes. */ type Options = getQuoteCandidates.Options & { /** Cache policy for provider-side discovery and quote lookups. */ cache?: CachePolicy | undefined; /** Receives one bounded observation for every provider attempt. */ onAttempt?: ((attempt: ProviderAttempt) => void) | undefined; /** Per-provider quote timeout in milliseconds. */ providerTimeoutMs?: number | undefined; }; } /** * Provisions one reusable deposit address through the first deterministic * capability-enabled provider. Returns `undefined` when no route is enabled. */ export declare function createDepositAddress(options: createDepositAddress.Options): Promise; export declare namespace createDepositAddress { /** Options for provisioning one reusable deposit address. */ type Options = getDepositAddressCandidates.Options & { /** Source token amount in base units used for initial route provisioning. */ amount: string; /** Receives one bounded observation for the provider attempt. */ onAttempt?: ((attempt: ProviderAttempt) => void) | undefined; /** Per-provider provisioning timeout in milliseconds. */ providerTimeoutMs?: number | undefined; /** Final beneficiary on Tempo. */ recipient: string; /** Source-chain account that receives refunds. */ refundAddress: string; /** Whether Tempo guarantees normalized 1:1 delivery. */ subsidize: boolean; }; /** Selected provider route and its reusable address. */ type Selection = { /** Curated route used to provision the address. */ candidate: DepositAddressCandidate; /** Provider that provisioned the address. */ provider: Provider; /** Normalized final beneficiary on Tempo. */ recipient: string; /** Normalized source-chain refund account. */ refundAddress: string; /** Reusable address and private provider correlation. */ result: createDepositAddress.ReturnType; }; } /** * Prepares one executable transfer across capability-enabled candidates, * selecting the best successful preparation. Returns `undefined` when no * enabled corridor matches; throws {@link ProviderQuoteError} when every * matching provider failed unexpectedly. */ export declare function prepareTransfer(options: prepareTransfer.Options): Promise; export declare namespace prepareTransfer { /** Options for preparing one executable transfer. */ type Options = getPrepareCandidates.Options & { /** Receives one bounded observation for every provider attempt. */ onAttempt?: ((attempt: ProviderAttempt) => void) | undefined; /** Per-provider preparation timeout in milliseconds. */ providerTimeoutMs?: number | undefined; /** Final beneficiary on the destination chain. */ recipient: string; /** Source-chain account that signs the funding action. */ sender: string; /** Caller slippage bound in basis points. */ slippageBps?: number | undefined; }; /** The selected preparation with a guaranteed expiry. */ type Selection = { /** Curated candidate the preparation was produced for. */ candidate: QuoteCandidate; /** Provider that produced the selected preparation. */ provider: Provider; /** The preparation, with a default expiry applied when the provider gave none. */ result: prepareTransfer.ReturnType & { expiresAt: string; }; }; } /** * Returns capability-enabled reusable-address candidates for a route. Tokens * resolve within their chains and only provider delivery qualifies. */ export declare function getDepositAddressCandidates(options: getDepositAddressCandidates.Options): { candidate: { readonly configuration?: Record; readonly destinationChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly destinationToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; readonly provider: { id: string; name: string; }; readonly route: core_Route.Route; readonly sourceChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly sourceToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; }; provider: core_Provider.Provider & { /** Provisions a reusable funding deposit address, when supported. */ createDepositAddress?(input: createDepositAddress.Parameters, signal: AbortSignal): Promise; /** Requests a live funding quote. */ getQuote(input: getQuote.Parameters, signal: AbortSignal): Promise; /** Lists requests discovered for a reusable deposit address, when supported. */ listDepositAddressRequests?(input: listDepositAddressRequests.Parameters, signal: AbortSignal): Promise; /** Observes authenticated delivery for a verified reusable-address transfer, when supported. */ observeDepositAddressRequest?(input: observeDepositAddressRequest.Parameters, signal: AbortSignal): Promise; /** Prepares an executable funding transfer, when the provider supports it. */ prepareTransfer?(input: prepareTransfer.Parameters, signal: AbortSignal): Promise; /** Validates provider-specific action semantics before generic persistence checks. */ validateTransferAction?(input: validateTransferAction.Parameters): validateTransferAction.ReturnType; /** Verifies a submitted source transaction, when supported. */ verifySourceTransaction?(input: verifySourceTransaction.Parameters, signal: AbortSignal): Promise; /** Receives authenticated provider status events, when configured. */ webhook?: Webhook | undefined; } & { createDepositAddress: NonNullable; }; }[]; export declare namespace getDepositAddressCandidates { /** Options for selecting reusable deposit-address routes. */ type Options = { /** Compiled funding catalog containing provider routes and capabilities. */ catalog: core_Catalog.Snapshot; /** Tempo destination chain selected by app composition. */ destinationChainId: number; /** Tempo destination token symbol, contract address, or token key. */ destinationToken: string; /** Funding providers considered by the request. */ providers: readonly Provider[]; /** Source chain CAIP-2 id, slug, or alias. */ sourceChain: string; /** Source token symbol, contract address, or token key. */ sourceToken: string; }; } /** * Returns capability-enabled preparation candidates for a creation request. * Tokens resolve within their chains. A route must enable the requested mode, * and its provider must implement `prepareTransfer`. */ export declare function getPrepareCandidates(options: getPrepareCandidates.Options): { candidate: { readonly configuration?: Record; readonly destinationChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly destinationToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; readonly id: string; readonly provider: { id: string; name: string; }; readonly route: core_Route.Route; readonly sourceAmount: { amount: string; formatted: string; }; readonly sourceChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly sourceToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; }; provider: core_Provider.Provider & { /** Provisions a reusable funding deposit address, when supported. */ createDepositAddress?(input: createDepositAddress.Parameters, signal: AbortSignal): Promise; /** Requests a live funding quote. */ getQuote(input: getQuote.Parameters, signal: AbortSignal): Promise; /** Lists requests discovered for a reusable deposit address, when supported. */ listDepositAddressRequests?(input: listDepositAddressRequests.Parameters, signal: AbortSignal): Promise; /** Observes authenticated delivery for a verified reusable-address transfer, when supported. */ observeDepositAddressRequest?(input: observeDepositAddressRequest.Parameters, signal: AbortSignal): Promise; /** Prepares an executable funding transfer, when the provider supports it. */ prepareTransfer?(input: prepareTransfer.Parameters, signal: AbortSignal): Promise; /** Validates provider-specific action semantics before generic persistence checks. */ validateTransferAction?(input: validateTransferAction.Parameters): validateTransferAction.ReturnType; /** Verifies a submitted source transaction, when supported. */ verifySourceTransaction?(input: verifySourceTransaction.Parameters, signal: AbortSignal): Promise; /** Receives authenticated provider status events, when configured. */ webhook?: Webhook | undefined; } & { prepareTransfer: NonNullable; }; }[]; export declare namespace getPrepareCandidates { /** Options for selecting preparation candidates. */ type Options = { /** Compiled funding catalog containing provider routes and capabilities. */ catalog: core_Catalog.Snapshot; /** Tempo destination chain selected by app composition. */ destinationChainId: number; /** Tempo destination token symbol, contract address, or token key. */ destinationToken: string; /** Funding method passed to provider preparation. */ method: Transfer.Method; /** Amount mode the caller selected. */ mode: Transfer.Mode; /** Funding provider ID selected by the caller. */ provider?: string | undefined; /** Funding providers considered by the request. */ providers: readonly Provider[]; /** Source amount in base units. */ sourceAmount: string; /** Source chain CAIP-2 id, slug, or alias. */ sourceChain: string; /** Source token symbol, contract address, or token key. */ sourceToken: string; }; } /** Source amount unit accepted by the funding quote request. */ export type SourceAmountUnits = z.output; /** Fetch implementation accepted by funding provider factories. */ export type Fetch = typeof globalThis.fetch; /** Returns bounded provider failure details suitable for structured request logs. */ export declare function failure(options: ProviderFailure): failure.Result; export declare namespace failure { /** Bounded provider failure fields. */ type Result = { /** Stable provider error code, when one is safe to retain. */ code?: string | undefined; /** Failure boundary that rejected the provider request. */ failure: 'http' | 'network' | 'payload' | 'rate_limit' | 'timeout' | 'unknown'; /** Provider identifier. */ id: string; /** Provider operation identifier. */ operation: ProviderOperation; /** Upstream HTTP status, when a response was received. */ status?: number | undefined; }; } /** Returns a supported expected-unavailable code from a provider response. */ export declare function unavailable(cause: unknown, codes: readonly string[]): string | undefined; /** Requests and parses a JSON provider response. */ export declare function requestJson(url: URL, options: requestJson.Options): Promise; export declare namespace requestJson { /** Provider request options. */ type Options = { /** Optional JSON request body. */ body?: unknown; /** Fetch implementation. */ fetch: Fetch; /** Optional request headers. */ headers?: Record | undefined; /** Optional HTTP method. */ method?: string | undefined; /** Request abort signal. */ signal: AbortSignal; }; } /** Creates a normalized expected-unavailable quote result. */ export declare function unavailableResult(options: unavailableResult.Options): getQuote.ReturnType; export declare namespace unavailableResult { /** Expected-unavailable quote details. */ type Options = { /** Provider operation detail. */ detail: string; /** Stable provider reason. */ message: string; /** Quote sample time. */ now: Date; /** Liquidity signal source. */ source: string; }; } declare function createDepositAddressCandidate(options: createDepositAddressCandidate.Options): { readonly configuration?: Record; readonly destinationChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly destinationToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; readonly provider: { id: string; name: string; }; readonly route: core_Route.Route; readonly sourceChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly sourceToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; }; declare namespace createDepositAddressCandidate { type Options = { configuration?: core_Catalog.Configuration | undefined; provider: Provider; route: core_Route.Route; }; } declare function createQuoteCandidate(options: createQuoteCandidate.Options): { readonly configuration?: Record; readonly destinationChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly destinationToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; readonly id: string; readonly provider: { id: string; name: string; }; readonly route: core_Route.Route; readonly sourceAmount: { amount: string; formatted: string; }; readonly sourceChain: { addressFormat: "base58" | "base58check" | "hex"; id: string; kind: "evm" | "solana" | "tron"; name: string; }; readonly sourceToken: { address: string; currency: string; decimals: number; name: string; standard: string; symbol: string; tokenKey: string; verified: boolean; }; }; declare namespace createQuoteCandidate { type Options = { configuration?: core_Catalog.Configuration | undefined; destinationToken: Token; provider: Provider; route: core_Route.Route; sourceAmount: ReturnType; sourceToken: Token; }; } declare function resolveSourceAmount(options: resolveSourceAmount.Options): { amount: string; formatted: string; }; declare namespace resolveSourceAmount { type Options = { amount: string; token: Token; units: SourceAmountUnits; }; } /** Error thrown when the caller supplies an unsupported destination token. */ export declare class UnsupportedDestinationTokenError extends Error { name: string; } /** Error thrown when a provider webhook cannot be authenticated. */ export declare class WebhookAuthenticationError extends Error { name: string; } /** Error thrown when an authenticated provider webhook has an invalid body. */ export declare class WebhookPayloadError extends Error { name: string; } /** Error thrown when the caller supplies an invalid source amount. */ export declare class InvalidAmountError extends Error { name: string; } /** Error thrown when the caller supplies an invalid source-chain refund address. */ export declare class InvalidRefundAddressError extends Error { name: string; } /** Error thrown when provider deployment configuration is invalid. */ export declare class ProviderConfigurationError extends Error { name: string; } /** Error thrown when a provider response does not match the requested quote. */ export declare class ProviderPayloadError extends Error { name: string; } /** Error thrown when a provider confirms that no executable route is available. */ export declare class ProviderUnavailableError extends Error { name: string; } /** Error thrown internally when a provider exceeds its quote timeout. */ export declare class ProviderTimeoutError extends Error { name: string; } /** Error thrown when an internal provider quota rejects a quote request. */ export declare class ProviderRateLimitError extends Error { name: string; } /** Error thrown when a provider returns an unsuccessful HTTP response. */ export declare class ProviderResponseError extends Error { /** Provider response status. */ readonly status: number; /** Parsed provider response body. */ readonly body: unknown; name: string; constructor( /** Provider response status. */ status: number, /** Parsed provider response body. */ body: unknown); } /** Error thrown when every matching provider fails to produce a quote. */ export declare class ProviderQuoteError extends Error { name: string; /** Provider failures that prevented a successful quote. */ failures: readonly ProviderFailure[]; /** Bounded provider attempts retained for request logs. */ fundingProviderAttempts: readonly ProviderAttemptResult[]; /** First bounded provider failure retained for request logs. */ providerFailure?: failure.Result | undefined; /** Bounded provider failures retained when multiple providers failed. */ providerFailures?: readonly failure.Result[] | undefined; constructor(failures: readonly ProviderFailure[], attempts?: readonly ProviderAttempt[]); } /** Error thrown when the caller filters to an unknown provider. */ export declare class UnsupportedProviderError extends Error { name: string; } /** Error thrown when the caller supplies an unsupported source chain. */ export declare class UnsupportedSourceChainError extends Error { name: string; } export {}; //# sourceMappingURL=Provider.d.ts.map