Skip to Content
Symmio Frontier — the SDK surface for builders on HyperEVM
ReactNotifications hooks

Notifications hooks

React hooks over the solver Notifications channel — live WS stream + REST search over history. Both return normalized Notification frames, so UI code consumes them with one shape.

Read-only page. useNotifications is a WebSocket subscription (still a “read” — no state mutation on-chain); useSearchNotifications is a REST-backed read.

TP/SL has its own separate WebSocket over the same underlying Defilytics service (different appName). See TP/SL.

Import

import { useNotifications, useSearchNotifications, type Notification, type NotificationType, } from "@symmio/trading-react";

useNotifications

Subscribe to the live solver notifications WebSocket for one SubAccount. Returns the live socket status + delegates each parsed frame to your onNotification callback.

const { status } = useNotifications({ account: subAccount, enabled: true, onNotification: (notification) => { console.log(notification.type, notification.quoteId, notification.lastSeenAction); }, });

Parameters

NameTypeDefaultNotes
accountAddress?undefinedSubAccount. When unset, the subscription is idle.
enabledboolean?trueGate the subscription behind a flag (e.g. live toggle).
chainIdnumber?config defaultOptional chain override.
onNotification(n: Notification) => void?undefinedFires per parsed frame.
onStatusChange(s: SocketStatus) => void?undefinedConnection status transitions.
onError(e: SymmError) => void?undefinedTransport / parse errors; does not stop the subscription.

Return type

{ status: SocketStatus; error: SymmioRequestError | null; }

Consumers reading the raw frames typically pass them into applyNotificationToQuotes (via useManagedQuotes) or into their own local reducer.

Connection pooling

Every subscriber on the same (wsUrl, appName, account) triple shares one connection. See Core WebSocket.

useSearchNotifications

REST-backed paginated search for historical frames.

const page = useSearchNotifications({ account: subAccount, filter: { quoteId: "42" }, page: 0, size: 20, }); page.data?.data.map((notification) => ...);

Parameters

NameTypeNotes
accountAddressSubAccount to scope the search to.
filterNotificationSearchFilter?quoteId / tempQuoteId / lastSeenAction / date.
pagenumber0-indexed.
sizenumberRows per page.
chainIdnumber?Optional chain override.
queryobject?TanStack overrides.

Return type

UseQueryResult<{ data: Notification[]; total: number }, SymmioRequestError>.

  • Core Notifications — shape + wire protocol.
  • Unified QuotesuseManagedQuotes composes useNotifications under the hood.
  • TP/SL — separate WS + REST for conditional-order reports.
Last updated on