优化相关设备的格式显示
This commit is contained in:
parent
b18805aa26
commit
4a3eaf87e8
6 changed files with 67 additions and 142 deletions
|
|
@ -2,6 +2,7 @@ from typing import Dict, Any, Optional
|
|||
import logging
|
||||
from okx import OkxRestClient
|
||||
from .base_service import BaseService
|
||||
from config import Config # 导入配置
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -13,7 +14,7 @@ class CryptoService(BaseService):
|
|||
# 对于公共数据,不需要API密钥
|
||||
self.client = OkxRestClient(api_key, secret_key, passphrase) if api_key else OkxRestClient()
|
||||
|
||||
def get_data(self, pair: str = "ETH-USDT") -> Optional[Dict[str, Any]]:
|
||||
def get_data(self, pair: str = Config.DEFAULT_CRYPTO_PAIR) -> Optional[Dict[str, Any]]:
|
||||
"""获取指定交易对的价格数据"""
|
||||
try:
|
||||
# 使用正确的marketdata属性获取ticker数据
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue