import { Order } from "../gen/orders/v1/orders_read_pb.js"; import { Unit } from "../gen/privatews/v1/private_ws_pb.js"; import { SdkSubscriptionErrorContext } from "../shared/subscription-errors.js"; //#region src/realtime/private-orders.d.ts /** One delivery of an account's order stream. */ type PrivateOrdersEvent = /** The account's full live view; replace local state with it. */ { type: "snapshot"; orders: Order[]; } | /** One change, applied whole. */ { type: "unit"; unit: Unit; } | /** * The account's live view is temporarily behind (`true`) or caught up (`false`). * `orderIds`, when set, names the only orders behind; the rest of the view is current. */ { type: "stale"; stale: boolean; orderIds?: bigint[]; }; interface ConnectPrivateOrdersParams { /** The account's base58 public ID. */ accountId: string; onEvent: (event: PrivateOrdersEvent) => void; /** Called when the server confirms the subscription, again after each reconnect. */ onConnected?: () => void; /** Called when the connection carrying the subscription drops. */ onDisconnected?: () => void; onError?: (ctx: SdkSubscriptionErrorContext) => void; } //#endregion export { ConnectPrivateOrdersParams, PrivateOrdersEvent }; //# sourceMappingURL=private-orders.d.ts.map