67 production .py modules that the running PINK service imports but which were never committed: prod/bingx/ (HTTP client, market/user streams, journal, config), prod/clean_arch/ adapters/persistence/runtime/dita/dita_v2 production modules and their co-located tests. Rule going forward: every module imported by launch_dolphin_pink.py / pink_direct.py must appear in git ls-files. Excludes _backup dirs, __pycache__, and non-code files. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
from __future__ import annotations
|
|
|
|
import asyncio
|
|
|
|
from nautilus_trader.cache.cache import Cache
|
|
from nautilus_trader.common.component import LiveClock
|
|
from nautilus_trader.common.component import MessageBus
|
|
from nautilus_trader.live.factories import LiveDataClientFactory
|
|
|
|
from .config import BingxExecClientConfig
|
|
from .data_client import BingxMarketDataClient
|
|
from .data_config import BingxDataClientConfig
|
|
from .http import BingxHttpClient
|
|
from .instrument_provider import BingxInstrumentProvider
|
|
|
|
|
|
class BingxLiveDataClientFactory(LiveDataClientFactory):
|
|
@staticmethod
|
|
def create( # type: ignore[override]
|
|
loop: asyncio.AbstractEventLoop,
|
|
name: str,
|
|
config: BingxDataClientConfig,
|
|
msgbus: MessageBus,
|
|
cache: Cache,
|
|
clock: LiveClock,
|
|
) -> BingxMarketDataClient:
|
|
config.validate_mainnet_opt_in()
|
|
exec_cfg = BingxExecClientConfig(
|
|
api_key=None,
|
|
secret_key=None,
|
|
environment=config.environment,
|
|
allow_mainnet=config.allow_mainnet,
|
|
http_timeout_secs=config.http_timeout_secs,
|
|
instrument_provider=config.instrument_provider,
|
|
)
|
|
client = BingxHttpClient(exec_cfg)
|
|
provider = BingxInstrumentProvider(client=client, config=config.instrument_provider)
|
|
return BingxMarketDataClient(
|
|
loop=loop,
|
|
client=client,
|
|
msgbus=msgbus,
|
|
cache=cache,
|
|
clock=clock,
|
|
instrument_provider=provider,
|
|
config=config,
|
|
name=name,
|
|
)
|