/** * Flowtype definitions for api * Generated by Flowgen from a Typescript Definition * Flowgen v1.21.0 */ import { ApiResponse } from "../api/response"; import { PortfolioTokenInfo } from "../portfolio/info"; import { PortfolioTokenId } from "../portfolio/token"; import { SwapAggregator } from "./aggregator"; import { SwapOrder } from "./order"; import { SwapProtocol } from "./protocol"; export type SwapLimitOptionsRequest = { tokenIn: PortfolioTokenId, tokenOut: PortfolioTokenId, ... }; export type SwapLimitOptionsResponse = { defaultProtocol: SwapProtocol, wantedPrice: number, options: Array<{ protocol: SwapProtocol, initialPrice: number, batcherFee: number, ... }>, ... }; export type SwapEstimateRequest = { ...{ slippage: number, tokenIn: PortfolioTokenId, tokenOut: PortfolioTokenId, protocol?: SwapProtocol, blockedProtocols?: Array, ... }, ... | { amountOut?: void, amountIn: number, multiples?: number, wantedPrice?: number, ... } | { amountOut: number, amountIn?: void, multiples?: void, wantedPrice?: void, ... }, }; export type SwapSplit = { amountIn: number, batcherFee: number, deposits: number, protocol: SwapProtocol, expectedOutput: number, expectedOutputWithoutSlippage: number, fee: number, finalPrice: number, initialPrice: number, poolFee: number, poolId: string, priceDistortion: number, priceImpact: number, aggregator?: SwapAggregator, aggregatorDexKey?: string, aggregatorPoolId?: string | string[], quoteId?: string, aggregatorImageUrl?: string, ... }; export type SwapEstimateResponse = { splits: Array, batcherFee: number, deposits: number, aggregatorFee: number, frontendFee: number, netPrice: number, priceImpact: number, totalFee: number, totalOutput: number, totalOutputWithoutSlippage?: number, totalInput?: number, ... }; export type SwapCreateRequest = { ...{ amountIn: number, tokenIn: PortfolioTokenId, tokenOut: PortfolioTokenId, protocol?: SwapProtocol, inputs?: Array, blockedProtocols?: Array, routeHint?: SwapRouteHint, ... }, ... | { wantedPrice?: number, slippage?: void, multiples?: number, ... } | { wantedPrice?: void, slippage: number, multiples?: void, ... }, }; export type SwapRouteHint = { aggregator: SwapAggregator, aggregatorDexKey?: string, poolIds?: string[], quoteId?: string, singlePreferredDexKey?: string, frontendOptions?: string[], orderContract?: string, ... }; export type SwapCreateResponse = { splits: SwapSplit[], batcherFee: number, deposits: number, aggregatorFee: number, frontendFee: number, netPrice?: number, priceImpact: number, totalFee: number, totalInput: number, totalOutput: number, totalOutputWithoutSlippage?: number, aggregator: SwapAggregator, cbor: string, ... }; export type SwapCancelRequest = { order: SwapOrder, ... }; export type SwapCancelResponse = { cbor: string, additionalCancellationFee?: number, ... }; export type SwapApi = $ReadOnly<{ orders: () => Promise>>, tokens: () => Promise>>, limitOptions( args: $ReadOnly ): Promise>, estimate( args: $ReadOnly ): Promise>, create( args: $ReadOnly ): Promise>, cancel: ( args: $ReadOnly ) => Promise>, ... }>;