commit 2 refactor
This commit is contained in:
parent
588f666943
commit
32e43c9243
310 changed files with 33318 additions and 31189 deletions
33
apps/stock/orchestrator/examples/example-runtime.ts
Normal file
33
apps/stock/orchestrator/examples/example-runtime.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { ServiceContainerBuilder } from '@stock-bot/di';
|
||||
import { defined } from '@stock-bot/invariants';
|
||||
import { registerOrchestratorServices } from '../src/container';
|
||||
import type { OrchestratorServices } from '../src/types';
|
||||
|
||||
/** Offline examples explicitly opt into seeded synthetic data. No provider credentials are used. */
|
||||
export async function createExampleRuntime() {
|
||||
const di = await new ServiceContainerBuilder()
|
||||
.withOptions({
|
||||
enableCache: false,
|
||||
enableQueue: false,
|
||||
enableMongoDB: false,
|
||||
enablePostgres: false,
|
||||
enableQuestDB: false,
|
||||
enableBrowser: false,
|
||||
enableProxy: false,
|
||||
})
|
||||
.build();
|
||||
await registerOrchestratorServices(di, {
|
||||
initializeMode: false,
|
||||
allowSyntheticData: true,
|
||||
syntheticSeed: 42,
|
||||
});
|
||||
const container = di.resolve('serviceContainer') as OrchestratorServices;
|
||||
return {
|
||||
container,
|
||||
storageService: defined(container.custom?.StorageService),
|
||||
marketDataService: defined(container.custom?.MarketDataService),
|
||||
executionService: defined(container.custom?.ExecutionService),
|
||||
modeManager: defined(container.custom?.ModeManager),
|
||||
strategyManager: defined(container.custom?.StrategyManager),
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue