import { Chain, QuoteData } from '@hashflow/taker-js/dist/types/common'; import { RequestHeaders } from '../../dex-helper'; import { ERROR_CODE_TO_RESTRICT_TTL } from './constants'; export type HashflowData = { mm: string; quoteData?: QuoteData; signature?: string; }; export type DexParams = { routerAddress: string; }; export interface PriceLevel { q: string; p: string; } export declare class RfqError extends Error { code: ErrorCode; constructor(message: string, code?: ErrorCode); } export declare enum RFQType { RFQT = 0, RFQM = 1 } export type HashflowRatesLevel = { pair: Record; levels: Array>; }; export type HashflowMarketMakersResponse = { marketMakers: string[]; }; export type HashflowRatesResponse = { status: string; baseChain: Chain; quoteChain: Chain; levels: Record>; }; export type HashflowRateFetcherConfig = { rateConfig: { marketMakersReqParams: { url: string; headers?: RequestHeaders; params?: any; }; pricesReqParams: { url: string; headers?: RequestHeaders; params?: any; }; pricesIntervalMs: number; markerMakersIntervalMs: number; getCachedMarketMakers: () => Promise; filterMarketMakers: (makers: string[]) => Promise; pricesCacheKey: string; marketMakersCacheKey: string; pricesCacheTTLSecs: number; marketMakersCacheTTLSecs: number; }; }; export type ErrorCode = keyof typeof ERROR_CODE_TO_RESTRICT_TTL; export type CacheErrorCodesData = { [code in ErrorCode]: { addedDatetimeMS: number; count: number; } | null; };