@mcpfun/mcp-server-ccxt
Version:
High-performance CCXT MCP server for cryptocurrency exchange integration
79 lines (78 loc) • 2.37 kB
TypeScript
/**
* Exchange Manager
* Manages cryptocurrency exchange instances and provides utility functions
*
* 交易所管理器
* 管理加密货币交易所实例并提供实用函数
*/
import * as ccxt from 'ccxt';
export declare const SUPPORTED_EXCHANGES: string[];
/**
* Clear exchange instance cache
* This is useful when proxy or other configurations change
*/
export declare function clearExchangeCache(): void;
export declare const DEFAULT_EXCHANGE: string;
export declare const DEFAULT_MARKET_TYPE: string;
export declare enum MarketType {
SPOT = "spot",
FUTURE = "future",
SWAP = "swap",
OPTION = "option",
MARGIN = "margin"
}
/**
* Get exchange instance
* @param exchangeId Exchange ID
* @returns Exchange instance
*
* 获取交易所实例
* @param exchangeId 交易所ID
* @returns 交易所实例
*/
/**
* Get proxy configuration from environment
* @returns Proxy configuration or null if proxy is disabled
*/
export declare function getProxyConfig(): {
url: string;
username?: string;
password?: string;
} | null;
/**
* Get exchange instance with the default market type
* @param exchangeId Exchange ID
* @returns Exchange instance
*/
export declare function getExchange(exchangeId?: string): ccxt.Exchange;
/**
* Get exchange instance with specific market type
* @param exchangeId Exchange ID
* @param marketType Market type (spot, future, etc.)
* @returns Exchange instance
*/
export declare function getExchangeWithMarketType(exchangeId?: string, marketType?: MarketType | string): ccxt.Exchange;
/**
* Get exchange instance with specific credentials
* @param exchangeId Exchange ID
* @param apiKey API key
* @param secret API secret
* @returns Exchange instance
*
* 使用特定凭据获取交易所实例
* @param exchangeId 交易所ID
* @param apiKey API密钥
* @param secret API密钥秘密
* @returns 交易所实例
*/
export declare function getExchangeWithCredentials(exchangeId: string, apiKey: string, secret: string, marketType?: MarketType | string): ccxt.Exchange;
/**
* Validate and format trading pair symbol
* @param symbol Trading pair symbol
* @returns Formatted trading pair symbol
*
* 验证和格式化交易对符号
* @param symbol 交易对符号
* @returns 格式化的交易对符号
*/
export declare function validateSymbol(symbol: string): string;