import { DexName, DexType, FeatureFlagType, SquidCallData } from "@0xsquid/squid-types"; import { Bridge, Chain, Dex, Token, Wrapper } from "../models"; /** ENUMS **/ export declare enum ChainType { EVM = "evm", COSMOS = "cosmos", BTC = "bitcoin", SOLANA = "solana" } export declare enum AddressBlacklistType { INTERNAL = "INTERNAL", TRM = "TRM" } export declare enum AddressWhitelistType { INTERNAL = "INTERNAL", TRM = "TRM" } export declare enum PoolType { CURVE_PLAIN = "plain", BASE = "base", META = "meta", CURVE_LENDING = "lending", BALANCER_WEIGHTED = "balancer-weighted", BALANCER_STABLE = "balancer-stable" } export type RawPool = { chainId: string; dexName: string; coinNames: string[]; basePool?: string; underlyingCoinNames?: string[]; coinAddresses: string[]; underlyingCoinAddresses?: string[]; poolId?: string; address: string; type: PoolType; poolFee?: string; }; /** Mongoose Models **/ /** * Interface contract for ANY object that is persisted in the mongodb data storage. * The `id` should be unique, it can be either a domain related object, or if there is no unique business * identifier, delegate this to mongodb to populate it or generate a UUID-4 and fill it with the UUID value. */ export interface SquidMongoItem { id: string; } /** * Interface for SquidChain config object. */ export type SquidChain = Chain; export type SquidToken = Omit & { chain: SquidChain; }; export type SquidWrapper = Omit & { chain: SquidChain; tokens: SquidToken[]; }; export type SquidDex = Omit & { chain: SquidChain; }; export type SquidBridge = Omit & { tokens: SquidToken[]; }; /** * Interface for SquidPool config object. */ export interface SquidPool extends SquidMongoItem { id: string; dexName: DexName; dexType: DexType; chainId: string; address: string; rank: number; enabled?: boolean; includedByDiet: boolean; liquidity: number; originalLiquidity: number; chain: SquidChain; normalizedLiquidity?: number; dex: SquidDex; tokens: SquidToken[]; data: any; } export interface SquidNetworkGas extends SquidMongoItem { value: string; } export interface SquidGasLimit extends SquidMongoItem { value: string; } export interface SquidAddressBlacklist extends SquidMongoItem { address: string; chain: SquidChain; type: AddressBlacklistType; enabled: boolean; description?: string; } export interface SquidAddressWhitelist extends SquidMongoItem { address: string; chain: SquidChain; type: AddressWhitelistType; enabled: boolean; description?: string; } export interface SquidAxelarGas extends SquidMongoItem { value: string; } export interface SquidTokenPrice extends SquidMongoItem { coingeckoId: string; price: number; token: SquidToken; } /** Mongoose Models **/ export interface SquidConfiguration { tokens: SquidToken[]; wrappers: SquidWrapper[]; chains: SquidChain[]; dexes: SquidDex[]; bridges: SquidBridge[]; } export declare enum ConfigChangeEvent { RELOAD_TOKENS = "reloadTokens", RELOAD_CHAINS = "reloadChains", RELOAD_DEXES = "reloadDexes", RELOAD_BRIDGES = "reloadBridges", RELOAD_WRAPPERS = "reloadWrappers", RELOAD_CONFIG = "reloadConfig", RELOAD_RFQ_LIQUIDITY_PROVIDERS = "reloadRfqLiquidityProviders", RELOAD_RFQ_SUBGRAPHS = "reloadRfqSubgraphs", API_ENV_VAR_UPDATE = "apiEnvironmentVariableUpdate", PATH_FINDER_ENV_VAR_UPDATE = "pathFinderEnvironmentVariableUpdate", DATA_SERVICE_ENV_VAR_UPDATE = "dataServiceEnvironmentVariableUpdate", BATCHING_SERVICE_ENV_VAR_UPDATE = "batchingServiceEnvironmentVariableUpdate", GLOBAL_CONFIG = "globalConfig" } /** RFQ Models **/ export interface SquidRFQLiquidityProvider extends SquidMongoItem { id: string; integratorId: string; endpoint: string; intervalInMills: number; enabled: boolean; disabledTokens: SquidToken[]; disabledChains: SquidChain[]; fillerAddress: string; defaultDestinationBatchingTimeInMinutes: number; defaultHubBatchingTimeInMinutes: number; chainDestinationBatchingTimeInMinutes: { chainId: string; timeInMinutes: number; }[]; chainHubBatchingTimeInMinutes: { chainId: string; timeInMinutes: number; }[]; defaultDestinationBatchingMinAmountInUSD: number; defaultHubBatchingMinAmountInUSD: number; chainDestinationBatchingMinAmountInUSD: { chainId: string; amountInUSD: number; }[]; chainHubBatchingMinAmountInUSD: { chainId: string; amountInUSD: number; }[]; directPairOnly: boolean; } export interface SquidRFQEvent extends SquidMongoItem { type: string; orderHash: string; data?: any; blockNumber: string; blockTimestamp: string; transactionHash: string; version?: string; } export interface SquidRFQSubgraph extends SquidMongoItem { chainId: string; type: string; address: string; startBlock: string; subgraphUrl: string; } export interface SquidRFQChainEventLog extends SquidMongoItem { blockNumber: string; } export interface SquidRFQPostHook extends SquidMongoItem { callData: string; calls: SquidCallData[]; gasLimit: string; } export interface SquidRFQOrder extends SquidMongoItem { liquidityProvider?: string; filler?: string; fromAddress?: string; fromChain?: string; fromToken?: string; fromTokenDecimals?: string; fromTokenSymbol?: string; fromAmount?: string; fromAmountUSD?: string; toAddress?: string; toChain?: string; toToken?: string; toTokenDecimals?: string; toTokenSymbol?: string; feeRate: string; fillAmount?: string; postHookHash?: string; fillAmountUSD?: string; earliestBlockTimestamp: number; orderCreatedTxHash?: string; orderCreatedBlockTimestamp?: number; orderRefundedTxHash?: string; orderRefundedBlockTimestamp?: number; tokensReleasedTxHash?: string; tokensReleasedBlockTimestamp?: number; orderFilledTxHash?: string; orderFilledBlockTimestamp?: number; settlementForwardedTxHash?: string; settlementForwardedBlockTimestamp?: number; settlementFilledTxHash?: string; settlementFilledBlockTimestamp?: number; settlementProcessedTxHash?: string; settlementProcessedBlockTimestamp?: number; destinationBatchProcessed: boolean; hubBatchProcessed: boolean; version: string; } export interface SquidRFQBatchingLog extends SquidMongoItem { liquidityProvider: string; type: string; chainId: string; timestamp: number; } export interface SquidFeatureFlag { feature: FeatureFlagType; allowedIntegrators: (string | import("mongoose").Types.ObjectId)[]; enabled: boolean; } export interface SquidBatchingFee extends SquidMongoItem { chainId: string; amountInUSD: number; }