@barfinex/types
Version:
Core TypeScript type definitions and shared interfaces for the Barfinex ecosystem. Provides strongly-typed contracts for modules, services, and plugins.
77 lines • 2.77 kB
TypeScript
import { ConnectorType, MarketType } from './connector.interface';
export declare enum ExchangeSegment {
CRYPTO_MAJOR = "crypto_major",
CRYPTO_DERIVATIVES = "crypto_derivatives",
CRYPTO_OTHER = "crypto_other",
US_BROKER = "us_broker",
EU_BROKER = "eu_broker",
APAC_BROKER = "apac_broker",
CIS_BROKER = "cis_broker",
KZ_BROKER = "kz_broker",
FOREX = "forex",
FUTURES_DERIVATIVES = "futures_derivatives",
OTC_INSTITUTIONAL = "otc_institutional",
MARKET_DATA = "market_data",
DEX = "dex"
}
export declare const EXCHANGE_SEGMENT_LABELS: Record<ExchangeSegment, string>;
export interface ExchangeCredentialField {
key: string;
label: string;
type: 'text' | 'password' | 'select';
required: boolean;
placeholder?: string;
options?: string[];
}
export interface ExchangeCatalogEntry {
connectorType: ConnectorType;
displayName: string;
segment: ExchangeSegment;
supportedMarkets: MarketType[];
credentials: ExchangeCredentialField[];
website?: string;
description?: string;
logoSlug?: string;
}
export declare enum ExchangeConnectorStatus {
/** Connector is running and streaming data */
ACTIVE = "active",
/** Connector is registered but not started (no credentials or user-paused) */
INACTIVE = "inactive",
/** Connector is currently initializing (loading pairs, opening WS) */
CONNECTING = "connecting",
/** Connector lost connection, will auto-retry */
RECONNECTING = "reconnecting",
/** Connector encountered a fatal error (bad credentials, banned IP, etc.) */
ERROR = "error",
/** Connector is gracefully shutting down */
STOPPING = "stopping"
}
export declare const EXCHANGE_STATUS_LABELS: Record<ExchangeConnectorStatus, string>;
export interface ActiveExchangeInstance {
connectorType: ConnectorType;
marketType: MarketType;
status: ExchangeConnectorStatus;
activatedAt?: number;
hasCredentials: boolean;
subscriptionCount: number;
instrumentCount: number;
error?: string;
lastHeartbeat?: number;
}
export interface ActivateExchangeDto {
connectorType: ConnectorType;
marketTypes: MarketType[];
credentials?: Record<string, string>;
}
export interface DeactivateExchangeDto {
connectorType: ConnectorType;
marketTypes?: MarketType[];
}
export interface UpdateExchangeCredentialsDto {
credentials: Record<string, string>;
}
export declare const EXCHANGE_CATALOG: ExchangeCatalogEntry[];
export declare function getExchangeCatalogEntry(connectorType: ConnectorType): ExchangeCatalogEntry | undefined;
export declare function getExchangesBySegment(): Record<ExchangeSegment, ExchangeCatalogEntry[]>;
//# sourceMappingURL=exchange-catalog.interface.d.ts.map