RawTpSlNotification
The raw wire shape of one report frame from the TP/SL notifications WebSocket, after the defilytics envelope is unwrapped. Retained on TpSlNotification.raw for advanced use; the runtime only trusts the outer envelope and walks the data payload through its union type.
Fields
app_namestringoptionalChannel / app name the frame came in on.
primary_identifiernumberoptionalOn-chain quote id when anchored, else 0.
secondary_identifiernumberoptionalTemp id pre-anchor, else 0.
addressstringoptionalSubAccount address the frame belongs to.
type"report" | "alarm"optionalFrame kind. Only report frames are parsed.
timestampnumberoptionalFrame timestamp (seconds).
dataRawTpSlNotificationDataoptionalThe report payload — see below.
RawTpSlNotificationData
A discriminated union on successful. The successful branch carries fill details; the failure branch carries error info.
successfulbooleanDiscriminant. true → details branch, false → error branch.
conditional_order_type"take_profit" | "stop_loss"Which side (required on success; optional on failure).
stateRawTpSlNotificationStateThe lifecycle state (see below).
coh_quote_idstringoptionalHandler-issued conditional-order id.
detailsRawTpSlNotificationDetailsoptionalFill details (success branch only).
error_codenumberoptionalFailure branch only.
status_codenumberoptionalFailure branch only.
error_messagestringoptionalFailure branch only.
RawTpSlNotificationDetails
trigger_pricenumberoptionalThe trigger price on the order.
open_pricenumberoptionalThe order’s stamped open price.
close_pricenumberoptionalFill price when the order closes.
quantity_to_closenumberoptionalQuantity closed by the order.
RawTpSlNotificationState
The wire state union: "new" | "edit" | "pending" | "cancelled" | "canceled" | "cancel" | "triggered" | "trigger" | "close".
Related
TpSlNotification— the normalized shape built from this frame.parseTpSlFrame— parses this into aTpSlNotification.