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>
39 lines
1.2 KiB
Python
39 lines
1.2 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 LiveExecClientFactory
|
|
|
|
from .config import BingxExecClientConfig
|
|
from .http import BingxHttpClient
|
|
from .instrument_provider import BingxInstrumentProvider
|
|
from .execution import BingxExecutionClient
|
|
|
|
|
|
class BingxLiveExecClientFactory(LiveExecClientFactory):
|
|
@staticmethod
|
|
def create( # type: ignore[override]
|
|
loop: asyncio.AbstractEventLoop,
|
|
name: str,
|
|
config: BingxExecClientConfig,
|
|
msgbus: MessageBus,
|
|
cache: Cache,
|
|
clock: LiveClock,
|
|
) -> BingxExecutionClient:
|
|
config.validate_mainnet_opt_in()
|
|
client = BingxHttpClient(config)
|
|
provider = BingxInstrumentProvider(client=client, config=config.instrument_provider)
|
|
return BingxExecutionClient(
|
|
loop=loop,
|
|
client=client,
|
|
msgbus=msgbus,
|
|
cache=cache,
|
|
clock=clock,
|
|
instrument_provider=provider,
|
|
config=config,
|
|
name=name,
|
|
)
|