import { Provider } from '@ethersproject/abstract-provider'; import { BigNumber } from '@ethersproject/bignumber'; import { BigNumberish } from 'ethers'; import { BridgeRoute, FeeConfig, Query, SynapseModule, SynapseModuleSet, BridgeTokenCandidate, BridgeRouteV2, GetBridgeTokenCandidatesParameters, GetBridgeRouteV2Parameters } from '../module'; import { FastBridgeRouter } from './fastBridgeRouter'; import { ChainProvider } from '../router'; declare enum CacheDuration { Short = "short", Long = "long" } export declare class FastBridgeRouterSet extends SynapseModuleSet { static readonly MAX_QUOTE_AGE_MILLISECONDS: number; static readonly QUOTES_TTL: Record; readonly moduleName = "SynapseRFQ"; readonly allEvents: string[]; readonly isBridgeV2Supported = true; routers: { [chainId: number]: FastBridgeRouter; }; providers: { [chainId: number]: Provider; }; private quotesCache; constructor(chains: ChainProvider[]); /** * @inheritdoc SynapseModuleSet.getModule */ getModule(chainId: number): SynapseModule | undefined; /** * @inheritdoc SynapseModuleSet.getOriginAmountOut */ getEstimatedTime(originChainId: number, destChainId?: number): number; /** * @inheritdoc SynapseModuleSet.getGasDropAmount */ getGasDropAmount(): Promise; getBridgeTokenCandidates({ fromChainId, toChainId, toToken, }: GetBridgeTokenCandidatesParameters): Promise; getBridgeRouteV2(params: GetBridgeRouteV2Parameters): Promise; /** * @inheritdoc SynapseModuleSet.getBridgeRoutes */ getBridgeRoutes(originChainId: number, destChainId: number, tokenIn: string, tokenOut: string, amountIn: BigNumberish, originUserAddress?: string): Promise; /** * @inheritdoc SynapseModuleSet.getFeeData */ getFeeData(bridgeRoute: BridgeRoute): Promise<{ feeAmount: BigNumber; feeConfig: FeeConfig; }>; /** * @inheritdoc SynapseModuleSet.getDefaultPeriods */ getDefaultPeriods(): { originPeriod: number; destPeriod: number; }; /** * @inheritdoc SynapseModuleSet.applySlippage */ applySlippage(originQueryPrecise: Query, destQueryPrecise: Query, slipNumerator: number, slipDenominator: number): { originQuery: Query; destQuery: Query; }; /** * Returns the existing FastBridgeRouter instance for the given chain. * * @throws Will throw an error if FastBridgeRouter is not deployed on the given chain. */ getFastBridgeRouter(chainId: number): FastBridgeRouter; /** * Returns the address of the FastBridge contract for the given chain. */ getFastBridgeAddress(chainId: number): Promise; /** * Applies the protocol fee to the amount. * * @returns The amount after the fee. */ applyProtocolFeeRate(amount: BigNumber, protocolFeeRate: BigNumber): BigNumber; /** * Filters the list of quotes to only include those that can be used for given amount of input token. * For every filtered quote, the origin query is returned with the information for tokenIn -> RFQ token swaps. */ private filterOriginQuotes; /** * Retrieves all quotes with caching. * * @returns A promise that resolves to all available quotes. */ private getAllQuotes; /** * Get the list of quotes between two chains for a given final token. * * @param originChainId - The ID of the origin chain. * @param destChainId - The ID of the destination chain. * @param tokenOut - The final token of the cross-chain swap. * @returns A promise that resolves to the list of supported tickers. */ private getQuotes; static createRFQDestQuery(tokenOut: string, amountOut: BigNumber, originUserAddress?: string): Query; private getBridgeZapData; } export {};