import type { Chain, Network } from "@wormhole-foundation/sdk-base"; import type { ChainContext, Signer, TokenId, TransactionId, UnsignedTransaction } from "@wormhole-foundation/sdk-definitions"; import type { Wormhole } from "../wormhole.js"; import type { RouteTransferRequest } from "./request.js"; import type { Options, Quote, QuoteResult, Receipt, TransferParams, ValidatedTransferParams, ValidationResult } from "./types.js"; import type { ChainAddress } from "@wormhole-foundation/sdk-definitions"; export declare abstract class Route = ValidatedTransferParams, R extends Receipt = Receipt> { wh: Wormhole; constructor(wh: Wormhole); abstract validate(request: RouteTransferRequest, params: TransferParams): Promise>; abstract quote(request: RouteTransferRequest, params: ValidatedTransferParams): Promise>; abstract initiate(request: RouteTransferRequest, sender: Signer, quote: Quote, to: ChainAddress): Promise; abstract track(receipt: R, timeout?: number): AsyncGenerator; transferUrl(txid: string): string; abstract getDefaultOptions(): OP; } export interface RouteMeta { name: string; provider?: string; logo?: string; support?: string; source?: string; } export interface RouteConstructor { new (wh: Wormhole): Route; /** Details about the route provided by the implementation */ readonly meta: RouteMeta; /** true means this route supports native gas dropoff */ readonly NATIVE_GAS_DROPOFF_SUPPORTED: boolean; /** true means this is a one-transaction route (using a relayer) */ readonly IS_AUTOMATIC: boolean; /** get the list of networks this route supports */ supportedNetworks(): Network[]; /** get the list of chains this route supports */ supportedChains(network: Network): Chain[]; /** get the list of destination tokens that may be received on the destination chain */ supportedDestinationTokens(token: TokenId, fromChain: ChainContext, toChain: ChainContext): Promise; /** get if the chain allows same-chain swaps */ supportsSameChainSwaps?(network: Network, chain: Chain): boolean; } export type StaticRouteMethods = InstanceType; /** * AutomaticRoute is used whenever a relayer is delivering the * Attestation to the destination chain */ export declare abstract class AutomaticRoute = ValidatedTransferParams, R extends Receipt = Receipt> extends Route { static IS_AUTOMATIC: boolean; } export declare function isAutomatic(route: Route): route is AutomaticRoute; /** * Manual route is used whenever a manual delivery of the Attestation * is necessary */ export declare abstract class ManualRoute = ValidatedTransferParams, R extends Receipt = Receipt> extends Route { static NATIVE_GAS_DROPOFF_SUPPORTED: boolean; static IS_AUTOMATIC: boolean; abstract complete(sender: Signer, receipt: R): Promise; abstract resume(tx: TransactionId): Promise; } export declare function isManual(route: Route): route is ManualRoute; /** * FinalizableRoute is used whenever the route has a step after * completion that needs to be done */ export declare abstract class FinalizableRoute = ValidatedTransferParams, R extends Receipt = Receipt> extends Route { abstract finalize(sender: Signer, receipt: R): Promise; abstract resume(tx: TransactionId): Promise; } export declare function isFinalizable(route: Route): route is FinalizableRoute; export declare function hasBuildInitiateTransactions(route: Route): route is Route & { buildInitiateTransactions: (request: RouteTransferRequest, sender: ChainAddress, recipient: ChainAddress, quote: Quote) => Promise[]>; }; export declare function hasBuildCompleteTransactions(route: Route): route is Route & { buildCompleteTransactions: (sender: ChainAddress, receipt: Receipt) => Promise[]>; }; export declare function hasBuildFinalizeTransactions(route: Route): route is Route & { buildFinalizeTransactions: (sender: ChainAddress, receipt: Receipt) => Promise[]>; }; //# sourceMappingURL=route.d.ts.map