buildSubscribeMessage
Build the subscribe frame to send on (re)connect for a notifications endpoint.
For defilytics, this is a channel_patterns frame scoped to the account with wildcard identifiers (every quote id for the account). The frame is returned as a JSON string, ready to send.
import { buildSubscribeMessage } from "@symmio/trading-core";
const frame = buildSubscribeMessage({
account: "0xaccount...",
channel: "Hyper-EVM_Solver-Low-Cap_Production",
protocol: "defilytics",
});Parameters
The single argument is a BuildSubscribeMessageParameters object:
accountAddressrequiredSubAccount address to subscribe for.
channelstringrequiredChannel / app_name configured for the endpoint.
protocolSymmioNotificationsProtocolrequiredWire protocol the endpoint speaks.
Returns
stringThe frame serialized as a JSON string, ready to send. Throws a SymmError for an unsupported protocol.
Related
- parseNotificationFrame — the inbound counterpart.
- watchNotifications — sends this frame on every (re)connect.
Last updated on