import { ErrorCode } from "../../orders/v1/orders_pb.js"; import { CancelReason, Order } from "../../orders/v1/orders_read_pb.js"; import { Message } from "@bufbuild/protobuf"; import { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; declare namespace private_ws_pb_d_exports { export { Auth, AuthSchema, Authenticated, AuthenticatedSchema, Available, AvailableSchema, Channel, ChannelSchema, ClientMessage, ClientMessageSchema, CommandOutcome, CommandOutcomeSchema, CommandOutcome_Kind, CommandOutcome_KindSchema, Covered, CoveredSchema, Fill, FillSchema, Fill_Role, Fill_RoleSchema, Heartbeat, HeartbeatSchema, OrderEvent, OrderEventSchema, OrderEvent_Kind, OrderEvent_KindSchema, Ping, PingSchema, Pong, PongSchema, Ready, ReadySchema, RequestError, RequestErrorSchema, RequestError_Code, RequestError_CodeSchema, ResyncRequired, ResyncRequiredSchema, ResyncRequired_Reason, ResyncRequired_ReasonSchema, ServerMessage, ServerMessageSchema, SnapshotBegin, SnapshotBeginSchema, SnapshotEnd, SnapshotEndSchema, SnapshotPage, SnapshotPageSchema, Subscribe, SubscribeExpiring, SubscribeExpiringSchema, SubscribeRefresh, SubscribeRefreshSchema, SubscribeRefreshed, SubscribeRefreshedSchema, SubscribeSchema, Subscribed, SubscribedSchema, Sync, SyncSchema, Synced, SyncedSchema, TokenExpiring, TokenExpiringSchema, Unavailable, UnavailableReason, UnavailableReasonSchema, UnavailableSchema, Unit, UnitEvent, UnitEventSchema, UnitSchema, Unsubscribe, UnsubscribeSchema, Unsubscribed, UnsubscribedSchema, Unsubscribed_Reason, Unsubscribed_ReasonSchema, file_privatews_v1_private_ws }; } /** * Describes the file privatews/v1/private_ws.proto. */ declare const file_privatews_v1_private_ws: GenFile; /** * ClientMessage is one frame a client sends on the private WebSocket, * `GET /v1/ws/private`, which streams the client's own orders. * * Encoding: the client offers one WebSocket subprotocol. * `polyester.v1.proto` (the default when none is offered) sends one binary * protobuf message per frame. `polyester.v1.json` sends one text frame of * the message's canonical JSON form, with lowerCamelCase field names and * 64-bit integers as strings. A frame of the other encoding closes the * connection with code 4400. * * Authentication: the first frame is an Auth with the connect token from * `GET /v1/rt/token`, within 5 seconds. Each account subscription carries a * subscribe token from * `GET /v1/rt/subscribe?channel=private:spot:orders:`, where access * to the account is checked. `` is the account's public ID written * in base58: its integer value in the Bitcoin alphabet * (`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`), most * significant digit first, with no padding; the same string the REST API * shows for the account. * * @generated from message privatews.v1.ClientMessage */ type ClientMessage = Message<"privatews.v1.ClientMessage"> & { /** * Exactly one operation. * * @generated from oneof privatews.v1.ClientMessage.op */ op: { /** * Authenticates the connection, or refreshes its token. * * @generated from field: privatews.v1.Auth auth = 1; */ value: Auth; case: "auth"; } | { /** * Subscribes one account's orders. * * @generated from field: privatews.v1.Subscribe subscribe = 2; */ value: Subscribe; case: "subscribe"; } | { /** * Renews a subscription's authorization before its token expires. * * @generated from field: privatews.v1.SubscribeRefresh subscribe_refresh = 3; */ value: SubscribeRefresh; case: "subscribeRefresh"; } | { /** * Ends a subscription. * * @generated from field: privatews.v1.Unsubscribe unsubscribe = 4; */ value: Unsubscribe; case: "unsubscribe"; } | { /** * Asks a subscription to confirm it reflects every acknowledgement given * before the request. * * @generated from field: privatews.v1.Sync sync = 5; */ value: Sync; case: "sync"; } | { /** * Liveness request, answered with Pong. * * @generated from field: privatews.v1.Ping ping = 6; */ value: Ping; case: "ping"; } | { case: undefined; value?: undefined; }; }; /** * Describes the message privatews.v1.ClientMessage. * Use `create(ClientMessageSchema)` to create a new message. */ declare const ClientMessageSchema: GenMessage; /** * Auth carries a realtime connect token. * * @generated from message privatews.v1.Auth */ type Auth = Message<"privatews.v1.Auth"> & { /** * The connect token from `GET /v1/rt/token`, valid for 5 minutes. Send a * new one for the same user before it expires to keep the connection open. * * @generated from field: string token = 1; */ token: string; }; /** * Describes the message privatews.v1.Auth. * Use `create(AuthSchema)` to create a new message. */ declare const AuthSchema: GenMessage; /** * Subscribe subscribes one account's orders. * * @generated from message privatews.v1.Subscribe */ type Subscribe = Message<"privatews.v1.Subscribe"> & { /** * Client request ID, echoed in Subscribed or RequestError. * * @generated from field: string id = 1; */ id: string; /** * What to stream; required. * * @generated from field: privatews.v1.Channel channel = 2; */ channel: Channel; /** * The sub-account's public ID, or the root account's. The subscribe token * must be for exactly this account's channel, * `private:spot:orders:`, with the ID in base58 as ClientMessage * describes. * * @generated from field: fixed64 account = 3; */ account: bigint; /** * The subscribe token from * `GET /v1/rt/subscribe?channel=private:spot:orders:`, valid for * 1 minute. * * @generated from field: string token = 4; */ token: string; /** * Optional resume position: the last cursor the client applied, from * SnapshotEnd, Unit or Covered. Empty for a fresh snapshot. * * @generated from field: string cursor = 5; */ cursor: string; }; /** * Describes the message privatews.v1.Subscribe. * Use `create(SubscribeSchema)` to create a new message. */ declare const SubscribeSchema: GenMessage; /** * SubscribeRefresh renews a subscription's authorization. * * @generated from message privatews.v1.SubscribeRefresh */ type SubscribeRefresh = Message<"privatews.v1.SubscribeRefresh"> & { /** * Client request ID, echoed in SubscribeRefreshed or RequestError. * * @generated from field: string id = 1; */ id: string; /** * The subscription. * * @generated from field: string sub = 2; */ sub: string; /** * A fresh subscribe token for the same account. * * @generated from field: string token = 3; */ token: string; }; /** * Describes the message privatews.v1.SubscribeRefresh. * Use `create(SubscribeRefreshSchema)` to create a new message. */ declare const SubscribeRefreshSchema: GenMessage; /** * Unsubscribe ends a subscription. * * @generated from message privatews.v1.Unsubscribe */ type Unsubscribe = Message<"privatews.v1.Unsubscribe"> & { /** * Client request ID, echoed in Unsubscribed or RequestError. * * @generated from field: string id = 1; */ id: string; /** * The subscription. * * @generated from field: string sub = 2; */ sub: string; }; /** * Describes the message privatews.v1.Unsubscribe. * Use `create(UnsubscribeSchema)` to create a new message. */ declare const UnsubscribeSchema: GenMessage; /** * Sync asks a subscription to catch up with every acknowledgement given * before the request. * * @generated from message privatews.v1.Sync */ type Sync = Message<"privatews.v1.Sync"> & { /** * Client request ID, echoed in Synced or RequestError. * * @generated from field: string id = 1; */ id: string; /** * The subscription. * * @generated from field: string sub = 2; */ sub: string; }; /** * Describes the message privatews.v1.Sync. * Use `create(SyncSchema)` to create a new message. */ declare const SyncSchema: GenMessage; /** * Ping is a liveness request. * * @generated from message privatews.v1.Ping */ type Ping = Message<"privatews.v1.Ping"> & { /** * Client request ID, echoed in Pong. * * @generated from field: string id = 1; */ id: string; }; /** * Describes the message privatews.v1.Ping. * Use `create(PingSchema)` to create a new message. */ declare const PingSchema: GenMessage; /** * ServerMessage is one frame the server sends. * * Sequence: each frame of a subscription's stream (SnapshotBegin, * SnapshotPage, SnapshotEnd, Unit, Covered, Ready, Synced, ResyncRequired, * Unavailable, Available) carries the subscription's `sub` and a `seq` that * starts at 1 and increases by exactly 1 per such frame. On a gap or a * repeat, drop the subscription and subscribe again. Subscribed, * SubscribeRefreshed, Unsubscribed, SubscribeExpiring, and a RequestError * about a subscription carry its `sub` with `seq` 0. Authenticated, * TokenExpiring, Heartbeat, Pong, and a RequestError about no subscription * carry neither. * * Compatibility: skip a frame kind you do not know, but still count its * `seq`. JSON clients ignore unknown fields and enum names. * * Close codes: 1001 the server is draining (reconnect, then resubscribe * with cursors); 4400 a malformed frame, an unknown operation, or a frame * of the other encoding; 4401 the connect token expired without a refresh; * 4403 a bad connect token, another user's, or none within 5 seconds; 4408 * the client did not read its frames fast enough (reconnect, then * resubscribe with cursors). Reconnects should back off from 0.5 seconds, * doubling to 10 seconds, with jitter. * * @generated from message privatews.v1.ServerMessage */ type ServerMessage = Message<"privatews.v1.ServerMessage"> & { /** * The subscription the frame concerns; empty for a connection-wide frame. * * @generated from field: string sub = 1; */ sub: string; /** * The frame's position in the subscription's stream; 0 for a frame * outside it. * * @generated from field: uint64 seq = 2; */ seq: bigint; /** * Exactly one frame. * * @generated from oneof privatews.v1.ServerMessage.frame */ frame: { /** * An Auth was accepted. * * @generated from field: privatews.v1.Authenticated authenticated = 10; */ value: Authenticated; case: "authenticated"; } | { /** * The connect token expires in 30 seconds. * * @generated from field: privatews.v1.TokenExpiring token_expiring = 11; */ value: TokenExpiring; case: "tokenExpiring"; } | { /** * A Subscribe was accepted. * * @generated from field: privatews.v1.Subscribed subscribed = 12; */ value: Subscribed; case: "subscribed"; } | { /** * A SubscribeRefresh was accepted. * * @generated from field: privatews.v1.SubscribeRefreshed subscribe_refreshed = 13; */ value: SubscribeRefreshed; case: "subscribeRefreshed"; } | { /** * A subscription ended. * * @generated from field: privatews.v1.Unsubscribed unsubscribed = 14; */ value: Unsubscribed; case: "unsubscribed"; } | { /** * A subscription's token expires in 15 seconds. * * @generated from field: privatews.v1.SubscribeExpiring subscribe_expiring = 15; */ value: SubscribeExpiring; case: "subscribeExpiring"; } | { /** * A snapshot begins. * * @generated from field: privatews.v1.SnapshotBegin snapshot_begin = 16; */ value: SnapshotBegin; case: "snapshotBegin"; } | { /** * A page of a snapshot. * * @generated from field: privatews.v1.SnapshotPage snapshot_page = 17; */ value: SnapshotPage; case: "snapshotPage"; } | { /** * A snapshot ends; install it. * * @generated from field: privatews.v1.SnapshotEnd snapshot_end = 18; */ value: SnapshotEnd; case: "snapshotEnd"; } | { /** * One change to the account. * * @generated from field: privatews.v1.Unit unit = 19; */ value: Unit; case: "unit"; } | { /** * The account moved on with no change. * * @generated from field: privatews.v1.Covered covered = 20; */ value: Covered; case: "covered"; } | { /** * The subscription reflects every acknowledgement given before it * subscribed. * * @generated from field: privatews.v1.Ready ready = 21; */ value: Ready; case: "ready"; } | { /** * A Sync was satisfied. * * @generated from field: privatews.v1.Synced synced = 22; */ value: Synced; case: "synced"; } | { /** * The subscription's state is replaced by the snapshot that follows. * * @generated from field: privatews.v1.ResyncRequired resync_required = 23; */ value: ResyncRequired; case: "resyncRequired"; } | { /** * The account's live view, or some of its orders, is not current for * now. * * @generated from field: privatews.v1.Unavailable unavailable = 24; */ value: Unavailable; case: "unavailable"; } | { /** * The account's live view is current again after Unavailable. * * @generated from field: privatews.v1.Available available = 25; */ value: Available; case: "available"; } | { /** * A request failed. * * @generated from field: privatews.v1.RequestError error = 26; */ value: RequestError; case: "error"; } | { /** * Liveness signal, sent every second. * * @generated from field: privatews.v1.Heartbeat heartbeat = 27; */ value: Heartbeat; case: "heartbeat"; } | { /** * Answer to Ping. * * @generated from field: privatews.v1.Pong pong = 28; */ value: Pong; case: "pong"; } | { case: undefined; value?: undefined; }; }; /** * Describes the message privatews.v1.ServerMessage. * Use `create(ServerMessageSchema)` to create a new message. */ declare const ServerMessageSchema: GenMessage; /** * Authenticated confirms an Auth. * * @generated from message privatews.v1.Authenticated */ type Authenticated = Message<"privatews.v1.Authenticated"> & { /** * When the connect token expires, seconds since epoch (UTC). * * @generated from field: int64 expires_ts_sec = 1; */ expiresTsSec: bigint; }; /** * Describes the message privatews.v1.Authenticated. * Use `create(AuthenticatedSchema)` to create a new message. */ declare const AuthenticatedSchema: GenMessage; /** * TokenExpiring warns that the connect token expires soon. Without a new * Auth by then, the connection closes with code 4401. * * @generated from message privatews.v1.TokenExpiring */ type TokenExpiring = Message<"privatews.v1.TokenExpiring"> & { /** * When the connect token expires, seconds since epoch (UTC). * * @generated from field: int64 expires_ts_sec = 1; */ expiresTsSec: bigint; }; /** * Describes the message privatews.v1.TokenExpiring. * Use `create(TokenExpiringSchema)` to create a new message. */ declare const TokenExpiringSchema: GenMessage; /** * Subscribed confirms a Subscribe; the frame's `sub` names the new * subscription. A snapshot, or the units after the resume cursor, follow. * * @generated from message privatews.v1.Subscribed */ type Subscribed = Message<"privatews.v1.Subscribed"> & { /** * The request ID. * * @generated from field: string id = 1; */ id: string; /** * The account's public ID. * * @generated from field: fixed64 account = 2; */ account: bigint; /** * When the subscribe token expires, seconds since epoch (UTC). Send a * SubscribeRefresh before then. * * @generated from field: int64 expires_ts_sec = 3; */ expiresTsSec: bigint; }; /** * Describes the message privatews.v1.Subscribed. * Use `create(SubscribedSchema)` to create a new message. */ declare const SubscribedSchema: GenMessage; /** * SubscribeRefreshed confirms a SubscribeRefresh; the frame's `sub` names * the subscription. A refused refresh is a RequestError FORBIDDEN with the * refresh's `id`, and the subscription keeps its current expiry. * * @generated from message privatews.v1.SubscribeRefreshed */ type SubscribeRefreshed = Message<"privatews.v1.SubscribeRefreshed"> & { /** * The request ID. * * @generated from field: string id = 1; */ id: string; /** * When the new subscribe token expires, seconds since epoch (UTC). * * @generated from field: int64 expires_ts_sec = 2; */ expiresTsSec: bigint; }; /** * Describes the message privatews.v1.SubscribeRefreshed. * Use `create(SubscribeRefreshedSchema)` to create a new message. */ declare const SubscribeRefreshedSchema: GenMessage; /** * Unsubscribed says a subscription ended. The connection stays open. * * @generated from message privatews.v1.Unsubscribed */ type Unsubscribed = Message<"privatews.v1.Unsubscribed"> & { /** * The request ID, when the client asked. * * @generated from field: string id = 1; */ id: string; /** * Why it ended. * * @generated from field: privatews.v1.Unsubscribed.Reason reason = 2; */ reason: Unsubscribed_Reason; }; /** * Describes the message privatews.v1.Unsubscribed. * Use `create(UnsubscribedSchema)` to create a new message. */ declare const UnsubscribedSchema: GenMessage; /** * Why a subscription ended. * * @generated from enum privatews.v1.Unsubscribed.Reason */ declare enum Unsubscribed_Reason { /** * Not set. * * @generated from enum value: REASON_UNSPECIFIED = 0; */ REASON_UNSPECIFIED = 0, /** * The client asked with Unsubscribe. * * @generated from enum value: REQUESTED = 1; */ REQUESTED = 1, /** * Its token expired without a SubscribeRefresh. Subscribe again with a * fresh token. * * @generated from enum value: TOKEN_EXPIRED = 2; */ TOKEN_EXPIRED = 2 } /** * Describes the enum privatews.v1.Unsubscribed.Reason. */ declare const Unsubscribed_ReasonSchema: GenEnum; /** * SubscribeExpiring warns that a subscription's token expires soon. * * @generated from message privatews.v1.SubscribeExpiring */ type SubscribeExpiring = Message<"privatews.v1.SubscribeExpiring"> & { /** * When its token expires, seconds since epoch (UTC). * * @generated from field: int64 expires_ts_sec = 1; */ expiresTsSec: bigint; }; /** * Describes the message privatews.v1.SubscribeExpiring. * Use `create(SubscribeExpiringSchema)` to create a new message. */ declare const SubscribeExpiringSchema: GenMessage; /** * SnapshotBegin starts a snapshot. Stage its pages and install them * atomically at SnapshotEnd. * * @generated from message privatews.v1.SnapshotBegin */ type SnapshotBegin = Message<"privatews.v1.SnapshotBegin"> & { /** * The account history's generation. A new value means the account's * history restarted. * * @generated from field: uint64 epoch = 1; */ epoch: bigint; }; /** * Describes the message privatews.v1.SnapshotBegin. * Use `create(SnapshotBeginSchema)` to create a new message. */ declare const SnapshotBeginSchema: GenMessage; /** * SnapshotPage carries up to 256 of a snapshot's orders, ascending by * order ID across pages. * * @generated from message privatews.v1.SnapshotPage */ type SnapshotPage = Message<"privatews.v1.SnapshotPage"> & { /** * Every order the live view holds for the account: open orders, orders * accepted but not yet on the book, and recently ended orders still * retained. Each is complete, with its attached risk in full. * * @generated from field: repeated orders.v1.Order orders = 1; */ orders: Order[]; }; /** * Describes the message privatews.v1.SnapshotPage. * Use `create(SnapshotPageSchema)` to create a new message. */ declare const SnapshotPageSchema: GenMessage; /** * SnapshotEnd ends a snapshot. * * @generated from message privatews.v1.SnapshotEnd */ type SnapshotEnd = Message<"privatews.v1.SnapshotEnd"> & { /** * Opaque resume cursor at the snapshot's position. * * @generated from field: string cursor = 1; */ cursor: string; /** * The number of orders in the snapshot's pages. * * @generated from field: uint32 count = 2; */ count: number; /** * A checksum of the snapshot, for diagnostics. * * @generated from field: fixed64 digest = 3; */ digest: bigint; }; /** * Describes the message privatews.v1.SnapshotEnd. * Use `create(SnapshotEndSchema)` to create a new message. */ declare const SnapshotEndSchema: GenMessage; /** * Unit is one change to the account, applied whole. * * @generated from message privatews.v1.Unit */ type Unit = Message<"privatews.v1.Unit"> & { /** * The cursor the client held before this unit. * * @generated from field: string prev_cursor = 1; */ prevCursor: string; /** * The resume cursor after this unit. * * @generated from field: string next_cursor = 2; */ nextCursor: string; /** * Each changed order, complete, as it now is, with its attached risk in * full (every leg's policy and state). A higher `version` is newer, and an * equal `version` is the identical order, also across the Orders API's * reads; version 0 is an order accepted but not yet on the book. The reads * omit attached risk unless asked for it: an omission on request, never a * removal. * * @generated from field: repeated orders.v1.Order orders = 3; */ orders: Order[]; /** * Public IDs of orders that left the live view: ended orders now kept in * history, or orders that never got past admission. Not a cancellation. * An order that ends in this unit and leaves with it is also in `orders`, * with its final revision: apply `orders` first, then these removals. * * @generated from field: repeated fixed64 removed_order_ids = 4; */ removedOrderIds: bigint[]; /** * What caused the change, in order. Never coalesced. * * @generated from field: repeated privatews.v1.UnitEvent events = 5; */ events: UnitEvent[]; }; /** * Describes the message privatews.v1.Unit. * Use `create(UnitSchema)` to create a new message. */ declare const UnitSchema: GenMessage; /** * Covered says the account moved on with no change. * * @generated from message privatews.v1.Covered */ type Covered = Message<"privatews.v1.Covered"> & { /** * The resume cursor at the new position. * * @generated from field: string cursor = 1; */ cursor: string; }; /** * Describes the message privatews.v1.Covered. * Use `create(CoveredSchema)` to create a new message. */ declare const CoveredSchema: GenMessage; /** * Ready says the subscription reflects every acknowledgement given before * it subscribed, including every order read made before it. * * @generated from message privatews.v1.Ready */ type Ready = Message<"privatews.v1.Ready"> & {}; /** * Describes the message privatews.v1.Ready. * Use `create(ReadySchema)` to create a new message. */ declare const ReadySchema: GenMessage; /** * Synced answers a Sync. * * @generated from message privatews.v1.Synced */ type Synced = Message<"privatews.v1.Synced"> & { /** * The request ID. * * @generated from field: string id = 1; */ id: string; }; /** * Describes the message privatews.v1.Synced. * Use `create(SyncedSchema)` to create a new message. */ declare const SyncedSchema: GenMessage; /** * ResyncRequired replaces the subscription's state with the snapshot that * follows it. * * @generated from message privatews.v1.ResyncRequired */ type ResyncRequired = Message<"privatews.v1.ResyncRequired"> & { /** * Why. The events between the old state and the snapshot are not * delivered: amend, cancel and rejection outcomes in between are lost, and * fills stay available from trade history. * * @generated from field: privatews.v1.ResyncRequired.Reason reason = 1; */ reason: ResyncRequired_Reason; }; /** * Describes the message privatews.v1.ResyncRequired. * Use `create(ResyncRequiredSchema)` to create a new message. */ declare const ResyncRequiredSchema: GenMessage; /** * Why the state is replaced. * * @generated from enum privatews.v1.ResyncRequired.Reason */ declare enum ResyncRequired_Reason { /** * Not set. * * @generated from enum value: REASON_UNSPECIFIED = 0; */ REASON_UNSPECIFIED = 0, /** * The resume cursor is not from this connection's server or history. * * @generated from enum value: CURSOR_UNKNOWN = 1; */ CURSOR_UNKNOWN = 1, /** * The resume cursor is older than the server's replay window (about the * last 1,024 changes or 30 seconds). * * @generated from enum value: CURSOR_EXPIRED = 2; */ CURSOR_EXPIRED = 2, /** * The account's history restarted. * * @generated from enum value: HISTORY_RESET = 3; */ HISTORY_RESET = 3 } /** * Describes the enum privatews.v1.ResyncRequired.Reason. */ declare const ResyncRequired_ReasonSchema: GenEnum; /** * Unavailable says the account's live view, or some of its orders, is not * current for now. Show what it names as stale until Available. A later * Unavailable replaces this one's reason and `order_ids`. The subscription * stays and always recovers by itself; the client does nothing. * Ready and Synced may still arrive meanwhile: they describe the position * already delivered, which is unchanged. * * @generated from message privatews.v1.Unavailable */ type Unavailable = Message<"privatews.v1.Unavailable"> & { /** * Why. * * @generated from field: privatews.v1.UnavailableReason reason = 1; */ reason: UnavailableReason; /** * For ORDER_UNAVAILABLE: the public IDs of the orders whose current state * is unknown, ascending. Empty for every other reason, which covers the * whole view. * * @generated from field: repeated fixed64 order_ids = 2; */ orderIds: bigint[]; }; /** * Describes the message privatews.v1.Unavailable. * Use `create(UnavailableSchema)` to create a new message. */ declare const UnavailableSchema: GenMessage; /** * Available says the account's live view is current again after * Unavailable: every order it holds shows its current state. * * @generated from message privatews.v1.Available */ type Available = Message<"privatews.v1.Available"> & {}; /** * Describes the message privatews.v1.Available. * Use `create(AvailableSchema)` to create a new message. */ declare const AvailableSchema: GenMessage; /** * RequestError answers a failed request. It does not close the connection. * * @generated from message privatews.v1.RequestError */ type RequestError = Message<"privatews.v1.RequestError"> & { /** * The request ID, when the error answers a request. * * @generated from field: string id = 1; */ id: string; /** * The failure. * * @generated from field: privatews.v1.RequestError.Code code = 2; */ code: RequestError_Code; /** * A human-readable explanation. * * @generated from field: string message = 3; */ message: string; }; /** * Describes the message privatews.v1.RequestError. * Use `create(RequestErrorSchema)` to create a new message. */ declare const RequestErrorSchema: GenMessage; /** * A request failure. * * @generated from enum privatews.v1.RequestError.Code */ declare enum RequestError_Code { /** * Not set. * * @generated from enum value: CODE_UNSPECIFIED = 0; */ CODE_UNSPECIFIED = 0, /** * The subscribe token does not authorize this account for this * connection. * * @generated from enum value: FORBIDDEN = 1; */ FORBIDDEN = 1, /** * A field is missing or malformed. * * @generated from enum value: INVALID_REQUEST = 2; */ INVALID_REQUEST = 2, /** * No such subscription. * * @generated from enum value: SUBSCRIPTION_UNKNOWN = 3; */ SUBSCRIPTION_UNKNOWN = 3, /** * The resume cursor cannot be read. * * @generated from enum value: CURSOR_INVALID = 4; */ CURSOR_INVALID = 4, /** * The connection already holds 64 subscriptions. * * @generated from enum value: TOO_MANY_SUBSCRIPTIONS = 5; */ TOO_MANY_SUBSCRIPTIONS = 5, /** * The account's live view did not catch up in time (Sync: 10 seconds). * * @generated from enum value: BEHIND = 6; */ BEHIND = 6 } /** * Describes the enum privatews.v1.RequestError.Code. */ declare const RequestError_CodeSchema: GenEnum; /** * Heartbeat is sent every second. Treat the connection as stale after 3 * seconds without one. * * @generated from message privatews.v1.Heartbeat */ type Heartbeat = Message<"privatews.v1.Heartbeat"> & { /** * Server time, nanoseconds since epoch (UTC). * * @generated from field: int64 server_ts_ns = 1; */ serverTsNs: bigint; }; /** * Describes the message privatews.v1.Heartbeat. * Use `create(HeartbeatSchema)` to create a new message. */ declare const HeartbeatSchema: GenMessage; /** * Pong answers a Ping. * * @generated from message privatews.v1.Pong */ type Pong = Message<"privatews.v1.Pong"> & { /** * The request ID. * * @generated from field: string id = 1; */ id: string; }; /** * Describes the message privatews.v1.Pong. * Use `create(PongSchema)` to create a new message. */ declare const PongSchema: GenMessage; /** * UnitEvent is what caused a change. * * @generated from message privatews.v1.UnitEvent */ type UnitEvent = Message<"privatews.v1.UnitEvent"> & { /** * Exactly one kind. * * @generated from oneof privatews.v1.UnitEvent.kind */ kind: { /** * Something happened to an order. * * @generated from field: privatews.v1.OrderEvent order = 1; */ value: OrderEvent; case: "order"; } | { /** * A command was answered without changing any order. * * @generated from field: privatews.v1.CommandOutcome outcome = 2; */ value: CommandOutcome; case: "outcome"; } | { case: undefined; value?: undefined; }; }; /** * Describes the message privatews.v1.UnitEvent. * Use `create(UnitEventSchema)` to create a new message. */ declare const UnitEventSchema: GenMessage; /** * OrderEvent is something that happened to an order. * * @generated from message privatews.v1.OrderEvent */ type OrderEvent = Message<"privatews.v1.OrderEvent"> & { /** * The order's public ID. * * @generated from field: fixed64 order_id = 1; */ orderId: bigint; /** * The order's version after the event. * * @generated from field: uint32 version = 2; */ version: number; /** * What happened. * * @generated from field: privatews.v1.OrderEvent.Kind kind = 3; */ kind: OrderEvent_Kind; /** * For REJECTED: why the order was refused, as the order's reject_reason and * the Orders API's error for the same refusal. Not set otherwise; the JSON * encoding then omits it. * * @generated from field: orders.v1.ErrorCode reject_reason = 7; */ rejectReason: ErrorCode; /** * For CANCELED, and for the REPLACED of the order a replace ended: why the * order ended, as the order's cancel_reason. Not set otherwise, including * the REPLACED that installs the successor; the JSON encoding then omits it. * * @generated from field: orders.v1.CancelReason cancel_reason = 8; */ cancelReason: CancelReason; /** * For REPLACED: the successor's public ID; 0 otherwise. * * @generated from field: fixed64 replacement_order_id = 5; */ replacementOrderId: bigint; /** * For FILLED: the fill. * * @generated from field: privatews.v1.Fill fill = 6; */ fill?: Fill | undefined; }; /** * Describes the message privatews.v1.OrderEvent. * Use `create(OrderEventSchema)` to create a new message. */ declare const OrderEventSchema: GenMessage; /** * What happened. * * @generated from enum privatews.v1.OrderEvent.Kind */ declare enum OrderEvent_Kind { /** * Not set. * * @generated from enum value: KIND_UNSPECIFIED = 0; */ KIND_UNSPECIFIED = 0, /** * The order, or an amend of it, was accepted. * * @generated from enum value: ACCEPTED = 1; */ ACCEPTED = 1, /** * The order filled, partly or fully. * * @generated from enum value: FILLED = 2; */ FILLED = 2, /** * The order ended without filling its remainder. * * @generated from enum value: CANCELED = 3; */ CANCELED = 3, /** * The order was refused. * * @generated from enum value: REJECTED = 4; */ REJECTED = 4, /** * A replace ended the order, or created it as the successor. * * @generated from enum value: REPLACED = 5; */ REPLACED = 5, /** * One of the order's attached take-profit, stop-loss or trailing-stop * legs changed. * * @generated from enum value: ATTACHED_RISK = 6; */ ATTACHED_RISK = 6 } /** * Describes the enum privatews.v1.OrderEvent.Kind. */ declare const OrderEvent_KindSchema: GenEnum; /** * Fill is one fill of an order. * * @generated from message privatews.v1.Fill */ type Fill = Message<"privatews.v1.Fill"> & { /** * The match's identifier, equal to the trade's match_id in the Orders * API's user trades. * * @generated from field: uint64 match_id = 1; */ matchId: bigint; /** * The fill's ordinal among this order's fills, from 1. * * @generated from field: uint32 ordinal = 2; */ ordinal: number; /** * Maker or taker. * * @generated from field: privatews.v1.Fill.Role role = 3; */ role: Fill_Role; /** * Filled quantity, scaled by the pair's base_quantity_scale from * GetSpotConfig for the order's symbol_id. * * @generated from field: int64 qty_scaled = 4; */ qtyScaled: bigint; /** * Fill price, in quote units scaled by 1e9. * * @generated from field: int64 price_ticks = 5; */ priceTicks: bigint; }; /** * Describes the message privatews.v1.Fill. * Use `create(FillSchema)` to create a new message. */ declare const FillSchema: GenMessage; /** * Whether the order provided or took liquidity. * * @generated from enum privatews.v1.Fill.Role */ declare enum Fill_Role { /** * Not set. * * @generated from enum value: ROLE_UNSPECIFIED = 0; */ ROLE_UNSPECIFIED = 0, /** * The order was resting. * * @generated from enum value: MAKER = 1; */ MAKER = 1, /** * The order took resting liquidity. * * @generated from enum value: TAKER = 2; */ TAKER = 2 } /** * Describes the enum privatews.v1.Fill.Role. */ declare const Fill_RoleSchema: GenEnum; /** * CommandOutcome answers a command that changed no order. * * @generated from message privatews.v1.CommandOutcome */ type CommandOutcome = Message<"privatews.v1.CommandOutcome"> & { /** * The answer. * * @generated from field: privatews.v1.CommandOutcome.Kind kind = 1; */ kind: CommandOutcome_Kind; /** * The command's order public ID; 0 for a cancel by criteria. * * @generated from field: fixed64 order_id = 2; */ orderId: bigint; /** * A replace's successor public ID; 0 otherwise. * * @generated from field: fixed64 new_order_id = 3; */ newOrderId: bigint; /** * The command's client order ID; empty when none. * * @generated from field: string client_order_id = 4; */ clientOrderId: string; /** * The refusal, as the Orders API names the same refusal in its errors; * ERROR_CODE_UNSPECIFIED for CANCEL_ALL_DONE. * * @generated from field: orders.v1.ErrorCode reason = 5; */ reason: ErrorCode; }; /** * Describes the message privatews.v1.CommandOutcome. * Use `create(CommandOutcomeSchema)` to create a new message. */ declare const CommandOutcomeSchema: GenMessage; /** * The answer. * * @generated from enum privatews.v1.CommandOutcome.Kind */ declare enum CommandOutcome_Kind { /** * Not set. * * @generated from enum value: KIND_UNSPECIFIED = 0; */ KIND_UNSPECIFIED = 0, /** * An amend was refused; the order is unchanged. * * @generated from enum value: AMEND_REJECTED = 1; */ AMEND_REJECTED = 1, /** * A cancel was refused. * * @generated from enum value: CANCEL_REJECTED = 2; */ CANCEL_REJECTED = 2, /** * A replace's successor was refused; the original order is unchanged. * * @generated from enum value: REPLACE_REJECTED = 3; */ REPLACE_REJECTED = 3, /** * An order was refused before it existed, such as a duplicate. * * @generated from enum value: REJECTED = 4; */ REJECTED = 4, /** * A cancel by criteria completed; its cancels came earlier as order * events. It names no request: with several cancels by criteria in * flight, a client cannot tell which one completed. * * @generated from enum value: CANCEL_ALL_DONE = 5; */ CANCEL_ALL_DONE = 5 } /** * Describes the enum privatews.v1.CommandOutcome.Kind. */ declare const CommandOutcome_KindSchema: GenEnum; /** * Channel names what a subscription streams. * * @generated from enum privatews.v1.Channel */ declare enum Channel { /** * Not set; refused. * * @generated from enum value: CHANNEL_UNSPECIFIED = 0; */ CHANNEL_UNSPECIFIED = 0, /** * The account's orders. * * @generated from enum value: ORDERS = 1; */ ORDERS = 1 } /** * Describes the enum privatews.v1.Channel. */ declare const ChannelSchema: GenEnum; /** * UnavailableReason names why an account's live view is not current. * * @generated from enum privatews.v1.UnavailableReason */ declare enum UnavailableReason { /** * Not set. * * @generated from enum value: UNAVAILABLE_REASON_UNSPECIFIED = 0; */ UNAVAILABLE_REASON_UNSPECIFIED = 0, /** * The view is catching up with recent activity. * * @generated from enum value: VIEW_BEHIND = 1; */ VIEW_BEHIND = 1, /** * The account's view is still loading. * * @generated from enum value: NOT_READY = 2; */ NOT_READY = 2, /** * The service is failing over; the view resumes after it. * * @generated from enum value: FAILOVER = 3; */ FAILOVER = 3, /** * The read fence could not be established for now. * * @generated from enum value: BOUNDARY_UNAVAILABLE = 4; */ BOUNDARY_UNAVAILABLE = 4, /** * The current state of the orders that `order_ids` names is temporarily * unknown. Their rows, when the snapshot or a unit carried one, show an * earlier state; an order may have no row yet. The rest of the account's * view is current, and units keep arriving. * * @generated from enum value: ORDER_UNAVAILABLE = 5; */ ORDER_UNAVAILABLE = 5 } /** * Describes the enum privatews.v1.UnavailableReason. */ declare const UnavailableReasonSchema: GenEnum; //#endregion export { Auth, AuthSchema, Authenticated, AuthenticatedSchema, Available, AvailableSchema, Channel, ChannelSchema, ClientMessage, ClientMessageSchema, CommandOutcome, CommandOutcomeSchema, CommandOutcome_Kind, CommandOutcome_KindSchema, Covered, CoveredSchema, Fill, FillSchema, Fill_Role, Fill_RoleSchema, Heartbeat, HeartbeatSchema, OrderEvent, OrderEventSchema, OrderEvent_Kind, OrderEvent_KindSchema, Ping, PingSchema, Pong, PongSchema, Ready, ReadySchema, RequestError, RequestErrorSchema, RequestError_Code, RequestError_CodeSchema, ResyncRequired, ResyncRequiredSchema, ResyncRequired_Reason, ResyncRequired_ReasonSchema, ServerMessage, ServerMessageSchema, SnapshotBegin, SnapshotBeginSchema, SnapshotEnd, SnapshotEndSchema, SnapshotPage, SnapshotPageSchema, Subscribe, SubscribeExpiring, SubscribeExpiringSchema, SubscribeRefresh, SubscribeRefreshSchema, SubscribeRefreshed, SubscribeRefreshedSchema, SubscribeSchema, Subscribed, SubscribedSchema, Sync, SyncSchema, Synced, SyncedSchema, TokenExpiring, TokenExpiringSchema, Unavailable, UnavailableReason, UnavailableReasonSchema, UnavailableSchema, Unit, UnitEvent, UnitEventSchema, UnitSchema, Unsubscribe, UnsubscribeSchema, Unsubscribed, UnsubscribedSchema, Unsubscribed_Reason, Unsubscribed_ReasonSchema, file_privatews_v1_private_ws, private_ws_pb_d_exports }; //# sourceMappingURL=private_ws_pb.d.ts.map