import type { DslEngineEvent } from "./types.js"; import type { DslCreatedTriggerReason, DslTier } from "../../types/dsl/index.js"; export interface MappedBusEvent { eventName: string; payload: Record; } /** * Local monitor state merged into backend `TIER_CHANGED` → `dsl.tier_advanced` payloads. * The engine event alone does not carry ROE / margin; the runtime supplies these from `DslState`. */ export interface TierBusEnrichment { direction: "LONG" | "SHORT"; entryPrice: number; leverage: number; margin: number; currentROE: number; highWaterRoe: number; /** High-water PRICE (DslState.highWaterPrice); the stop-raise "new high" copy input. */ highWaterPrice: number; lastPrice: number; lockedProfitPct: number; } export interface MapperContext { address: string; asset: string; dex: string; tiers: DslTier[]; /** From local {@link DslState.correlationId}; emitted on every mapped DSL bus event. */ correlationId: string; /** Cross-flow position.id (stamped as `__positionId`); falls back to correlationId when absent. */ positionId?: string; /** From local {@link DslState.triggerReason}; emitted on every mapped DSL bus event. */ triggerReason: DslCreatedTriggerReason; /** When set (typical in handoff poll), tier notification lines match locally-sourced tier events. */ tierEnrichment?: TierBusEnrichment | null; } /** Returns null for informational events or when required fields are missing. */ export declare function mapBackendEventToBusEvent(event: DslEngineEvent, context: MapperContext): MappedBusEvent | null; //# sourceMappingURL=event-mapping.d.ts.map