import { BigNumber } from '@ethersproject/bignumber'; import { XOR } from 'ts-xor'; /** * Matches SwapQuery passed to/returned by SynapseRouter (V1). */ export declare type RouterQuery = { swapAdapter: string; tokenOut: string; minAmountOut: BigNumber; deadline: BigNumber; rawParams: string; }; /** * Matches SwapQuery passed to/returned by SynapseCCTPRouter. */ export declare type CCTPRouterQuery = { routerAdapter: string; tokenOut: string; minAmountOut: BigNumber; deadline: BigNumber; rawParams: string; }; /** * Matches SwapQuery passed to/returned by SynapseRouter (V1) or SynapseCCTPRouter, but not both. */ export declare type Query = XOR; /** * Reduces the object to contain only the keys that are present in the Query type. */ export declare const reduceToQuery: (query: Query) => Query; /** * Narrows the query to the SynapseRouter (V1) type. * * @param query The query to narrow. * @returns The narrowed query object compatible with SynapseRouter (V1). * @throws If the query is not compatible with SynapseRouter (V1). */ export declare const narrowToRouterQuery: (query: Query) => RouterQuery; /** * Narrows the query to the SynapseCCTPRouter type. * * @param query The query to narrow. * @returns The narrowed query object compatible with SynapseCCTPRouter. * @throws If the query is not compatible with SynapseCCTPRouter. */ export declare const narrowToCCTPRouterQuery: (query: Query) => CCTPRouterQuery; /** * Checks if the query will lead to a complex bridge action, when used as the destination query. * Complex action is defined as an additional external call that the Bridge contract will have to perform * in order to complete the bridge action (e.g. mintAndSwap). * * @param destQuery The query to check. * @returns True if the query will lead to a complex bridge action, false otherwise. */ export declare const hasComplexBridgeAction: (destQuery: Query) => boolean; /** * Applies the deadline to the query and returns the modified query. * Note: the original query is preserved unchanged. * * @param query - The query to modify. * @param deadline - The new deadline. * @returns The modified query with the new deadline. */ export declare const applyDeadlineToQuery: (query: Query, deadline: BigNumber) => Query; /** * Applies the slippage to the query's minAmountOut (rounded down), and returns the modified query * with the reduced minAmountOut. * Note: the original query is preserved unchanged. * * @param query - The query to modify. * @param slipNumerator - The numerator of the slippage. * @param slipDenominator - The denominator of the slippage. * @returns The modified query with the reduced minAmountOut. * @throws If the slippage fraction is invalid (<0, >1, or NaN) */ export declare const applySlippageToQuery: (query: Query, slipNumerator: number, slipDenominator: number) => Query; /** * Creates a Query object for a no-swap bridge action. * * @param token - The token to bridge. * @param amount - The amount of token to bridge. * @returns The Query object for a no-swap bridge action. */ export declare const createNoSwapQuery: (token: string, amount: BigNumber) => Query; export declare const isSwapQuery: (query: Query) => boolean;