import BigNumber from 'bignumber.js'; import { RequestConfig } from '../../dex-helper/irequest-wrapper'; import { Address, NumberAsString, Token } from '../../types'; import { AugustusOrderWithString, OrderInfo } from '../paraswap-limit-orders/types'; import { Network, SwapSide } from '../../constants'; import { ErrorCode } from '../hashflow/types'; export type Pair = { base: string; quote: string; liquidityUSD: number; }; export type PairMap = { [pairName: string]: Pair; }; export type PairsResponse = { pairs: PairMap; }; export type TokenWithInfo = Token & { name: string; description: string; }; export type TokensResponse = { tokens: Record; }; export type BlackListResponse = { blacklist: string[]; }; export type PriceAndAmount = [string, string]; export type PriceAndAmountBigNumber = [BigNumber, BigNumber]; export type PairPriceResponse = { bids?: PriceAndAmount[]; asks?: PriceAndAmount[]; }; export type RatesResponse = { prices: { [pair: string]: PairPriceResponse; }; }; export type RFQSecret = { domain: string; accessKey: string; secretKey: string; }; export type FetcherParams = { reqParams: RequestConfig; secret: RFQSecret; intervalMs: number; dataTTLS: number; }; export type Rates = Array<[string, string]>; export type BigNumberRate = [BigNumber, BigNumber]; export type BigNumberRates = Array; type RequestConfigWithAuth = RequestConfig & { secret?: RFQSecret; }; export type RFQConfig = { tokensConfig: FetcherParams; pairsConfig: FetcherParams; rateConfig: FetcherParams; firmRateConfig: RequestConfigWithAuth; blacklistConfig?: FetcherParams; maker: Address; pathToRemove?: string; minTradeUsd: number | null; }; export type TokenWithAmount = Token & { amount: string; }; export type RFQPayload = { makerAsset: Address; takerAsset: Address; makerAmount?: string; takerAmount?: string; userAddress: Address; takerAddress: Address; partner?: string; special?: boolean; }; export type AugustusOrderWithStringAndSignature = AugustusOrderWithString & { signature: string; }; export type RFQFirmRateResponse = { status: 'accepted' | 'rejected'; order: AugustusOrderWithStringAndSignature; }; export declare class BlacklistError extends Error { dexKey: string; network: Network; user: Address; isBlacklistError: boolean; cause: string; code: string; constructor(dexKey: string, network: Network, user: Address); } export declare class SlippageCheckError extends Error { isSlippageError: boolean; cause: string; code: ErrorCode; constructor(dexKey: string, network: Network, side: SwapSide, expectedAmount: string, quotedAmount: string, slippageFactor: BigNumber, insufficientOutput?: boolean); } export declare class TooStrictSlippageCheckError extends SlippageCheckError { cause: string; constructor(dexKey: string, network: Network, side: SwapSide, expectedAmount: string, quotedAmount: string, slippageFactor: BigNumber); } export type RFQParams = [ fromAmount: NumberAsString, toAmount: NumberAsString, wrapApproveDirection: NumberAsString, metadata: string, beneficiary: Address ]; export type RFQDirectPayload = [ params: RFQParams, orders: OrderInfo[], permit: string ]; export {};