@stxapp/stx-typescript 0.9.0-alpha.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -16
- package/README.md +27 -24
- package/dist/{chunk-33AQCUGM.cjs → chunk-42OCIF3G.cjs} +988 -225
- package/dist/chunk-42OCIF3G.cjs.map +1 -0
- package/dist/{chunk-4CSBA2YV.js → chunk-FTZCBXT7.js} +929 -166
- package/dist/chunk-FTZCBXT7.js.map +1 -0
- package/dist/{client-CNkaTuhG.d.ts → client-DJr0UUvB.d.cts} +671 -148
- package/dist/{client-CNkaTuhG.d.cts → client-DJr0UUvB.d.ts} +671 -148
- package/dist/index.cjs +20 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +23 -5
- package/dist/oauth.cjs +244 -107
- package/dist/oauth.cjs.map +1 -1
- package/dist/oauth.d.cts +115 -15
- package/dist/oauth.d.ts +115 -15
- package/dist/oauth.js +206 -69
- package/dist/oauth.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-33AQCUGM.cjs.map +0 -1
- package/dist/chunk-4CSBA2YV.js.map +0 -1
|
@@ -30,6 +30,46 @@ interface WebSocketAuthContext {
|
|
|
30
30
|
reconnect?: boolean;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/** The features `STX.capabilities()` reports, by stable id. */
|
|
34
|
+
declare const FEATURES: readonly ["oauth", "oauth.member", "oauth.app", "connect", "terms.stx_page", "markets.create", "market_types", "event_players", "leaderboard", "loyalty", "combos"];
|
|
35
|
+
/** A feature id `STX.capabilities()` reports. */
|
|
36
|
+
type Feature = (typeof FEATURES)[number];
|
|
37
|
+
/**
|
|
38
|
+
* Per feature: `true` (the exchange has it), `false` (it does not), or `null`
|
|
39
|
+
* (not known: the check needs credentials this client does not have, or the
|
|
40
|
+
* exchange did not answer).
|
|
41
|
+
*/
|
|
42
|
+
type FeatureMap = Record<Feature, boolean | null>;
|
|
43
|
+
/** What `STX.capabilities()` found on one exchange. */
|
|
44
|
+
declare class Capabilities {
|
|
45
|
+
/** The exchange host, e.g. `"demo.stxapp.io"`. */
|
|
46
|
+
readonly host: string;
|
|
47
|
+
/** `GET /api_version`, e.g. `"3.3.196-rnd.9"`, or null when it did not answer. */
|
|
48
|
+
readonly apiVersion: string | null;
|
|
49
|
+
/** When the checks ran. */
|
|
50
|
+
readonly checkedAt: Date;
|
|
51
|
+
/** The scopes the exchange's OAuth discovery document lists; empty without OAuth. */
|
|
52
|
+
readonly scopesSupported: readonly string[];
|
|
53
|
+
/** Every feature and whether the exchange has it. */
|
|
54
|
+
readonly features: Readonly<FeatureMap>;
|
|
55
|
+
constructor(init: {
|
|
56
|
+
host: string;
|
|
57
|
+
apiVersion: string | null;
|
|
58
|
+
checkedAt: Date;
|
|
59
|
+
scopesSupported: readonly string[];
|
|
60
|
+
features: FeatureMap;
|
|
61
|
+
});
|
|
62
|
+
/** True only when the exchange is known to have `feature`. */
|
|
63
|
+
has(feature: Feature): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Throw `STXNotAvailableException` unless the exchange is known to have
|
|
66
|
+
* `feature`. A feature that could not be checked (`null`) does not throw:
|
|
67
|
+
* the call itself will say.
|
|
68
|
+
*/
|
|
69
|
+
require(feature: Feature): void;
|
|
70
|
+
toJSON(): Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
|
|
33
73
|
declare const Region: {
|
|
34
74
|
readonly US: "us";
|
|
35
75
|
readonly ONTARIO: "ontario";
|
|
@@ -110,36 +150,6 @@ declare function baseUrlFor(region: string | null | undefined, env: string | nul
|
|
|
110
150
|
/** The WebSocket URL for an API base URL: https maps to wss, http to ws. */
|
|
111
151
|
declare function socketUrlFor(baseUrl: string): string;
|
|
112
152
|
|
|
113
|
-
/** Why the exchange's geo-fencing refused a request. */
|
|
114
|
-
interface GeoRejection {
|
|
115
|
-
reason: "ip_not_allowed" | "packet_invalid" | "packet_other_user" | "packet_ip_mismatch" | "location_not_allowed";
|
|
116
|
-
/** The address the exchange saw, when its message names one. */
|
|
117
|
-
ipAddress?: string;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* A geolocation packet, or a function returning one (sync or async). Return
|
|
121
|
-
* `undefined` to send none for that request.
|
|
122
|
-
*/
|
|
123
|
-
type GeoLocationProvider = string | (() => string | undefined | null | Promise<string | undefined | null>);
|
|
124
|
-
/**
|
|
125
|
-
* Classify a 422 message from an order write. Returns undefined for a refusal
|
|
126
|
-
* that is not geo-fencing (funds, market closed, price step).
|
|
127
|
-
*/
|
|
128
|
-
declare function geoRejection(message: string): GeoRejection | undefined;
|
|
129
|
-
/** The outcome of `STX.geoCheck()`. */
|
|
130
|
-
interface GeoCheckResult {
|
|
131
|
-
/** True when the exchange would accept an order write from here now. */
|
|
132
|
-
allowed: boolean;
|
|
133
|
-
/** Set when `allowed` is false. */
|
|
134
|
-
reason?: GeoRejection["reason"];
|
|
135
|
-
/** The exchange's message when `allowed` is false. */
|
|
136
|
-
message?: string;
|
|
137
|
-
/** The address the exchange saw, when its message names one. */
|
|
138
|
-
ipAddress?: string;
|
|
139
|
-
/** Whether a geolocation packet was sent with the check. */
|
|
140
|
-
sentPacket: boolean;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
153
|
/**
|
|
144
154
|
* Player stats by sport, as the exchange names them. Use these for
|
|
145
155
|
* autocomplete; the stats a given event accepts are the ones
|
|
@@ -252,7 +262,7 @@ interface EventPlayers {
|
|
|
252
262
|
stats: EventStat[];
|
|
253
263
|
[key: string]: unknown;
|
|
254
264
|
}
|
|
255
|
-
/**
|
|
265
|
+
/** The stats one event type offers, in `STX.marketTypes()`. */
|
|
256
266
|
interface MarketTypeEventType {
|
|
257
267
|
/** The sport, e.g. `"Football"`. */
|
|
258
268
|
sport: string;
|
|
@@ -292,9 +302,13 @@ type MarketTypes = {
|
|
|
292
302
|
} & {
|
|
293
303
|
[rule: string]: MarketType;
|
|
294
304
|
};
|
|
295
|
-
/**
|
|
296
|
-
interface
|
|
297
|
-
|
|
305
|
+
/** One market to create. */
|
|
306
|
+
interface NewMarketInput {
|
|
307
|
+
/**
|
|
308
|
+
* The market rule. `"player_stat_line"`, the only one today and the default;
|
|
309
|
+
* the exchange answers any other with `unsupported_rule`.
|
|
310
|
+
*/
|
|
311
|
+
rule?: "player_stat_line" | (string & {});
|
|
298
312
|
/** From `eventPlayers()`. */
|
|
299
313
|
playerId: string;
|
|
300
314
|
/** One of the event's stats, e.g. `Stats.Basketball.POINTS`. */
|
|
@@ -305,61 +319,76 @@ interface PlayerStatLineMarket {
|
|
|
305
319
|
* are rejected with `invalid_line`.
|
|
306
320
|
*/
|
|
307
321
|
line: number;
|
|
322
|
+
/**
|
|
323
|
+
* @deprecated Not sent. A player stat line is always over/under.
|
|
324
|
+
*/
|
|
325
|
+
propType?: "ou";
|
|
308
326
|
}
|
|
327
|
+
/** A player stat line: over/under one player's stat in one event. The same shape as `NewMarketInput`. */
|
|
328
|
+
type PlayerStatLineMarket = NewMarketInput;
|
|
309
329
|
/**
|
|
310
330
|
* One market to create. `rule` names the market type and decides the other
|
|
311
331
|
* fields; `STX.marketTypes()` lists the rules an app can create. Player stat
|
|
312
332
|
* lines are the only one today.
|
|
313
333
|
*/
|
|
314
|
-
type NewMarket =
|
|
334
|
+
type NewMarket = NewMarketInput;
|
|
315
335
|
/** A rule `STX.createMarkets()` takes. */
|
|
316
|
-
type MarketRule =
|
|
336
|
+
type MarketRule = NonNullable<NewMarketInput["rule"]>;
|
|
317
337
|
/** Why a market was not created. */
|
|
318
338
|
type MarketRejectionReason = "invalid_market" | "unsupported_rule" | "unsupported_stat" | "invalid_line" | "unknown_player" | "event_not_open" | "not_created" | (string & {});
|
|
339
|
+
/** The market a result is for, as it was requested. */
|
|
340
|
+
interface MarketRequestEcho {
|
|
341
|
+
rule?: string;
|
|
342
|
+
player_id?: string;
|
|
343
|
+
stat?: string;
|
|
344
|
+
line?: number;
|
|
345
|
+
[key: string]: unknown;
|
|
346
|
+
}
|
|
319
347
|
/**
|
|
320
348
|
* The outcome for one requested market. `index` is the market's position in
|
|
321
|
-
* the list given to `createMarkets()
|
|
349
|
+
* the list given to `createMarkets()`, and `market` is that market as
|
|
350
|
+
* requested.
|
|
322
351
|
*/
|
|
323
352
|
type CreateMarketResult = {
|
|
324
353
|
index: number;
|
|
325
354
|
status: "created";
|
|
326
355
|
market_id: string;
|
|
327
356
|
reason: null;
|
|
328
|
-
|
|
357
|
+
market: MarketRequestEcho;
|
|
329
358
|
} | {
|
|
330
359
|
index: number;
|
|
331
360
|
status: "exists";
|
|
332
361
|
market_id: string;
|
|
333
362
|
reason: null;
|
|
334
|
-
|
|
363
|
+
market: MarketRequestEcho;
|
|
335
364
|
} | {
|
|
336
365
|
index: number;
|
|
337
366
|
status: "valid";
|
|
338
367
|
market_id: null;
|
|
339
368
|
reason: null;
|
|
340
|
-
|
|
369
|
+
market: MarketRequestEcho;
|
|
341
370
|
} | {
|
|
342
371
|
index: number;
|
|
343
372
|
status: "rejected";
|
|
344
373
|
market_id: null;
|
|
345
374
|
reason: MarketRejectionReason;
|
|
346
|
-
|
|
375
|
+
market: MarketRequestEcho;
|
|
347
376
|
};
|
|
348
377
|
/** Options for `STX.createMarkets()`. */
|
|
349
378
|
interface CreateMarketsOptions {
|
|
350
379
|
/**
|
|
351
|
-
*
|
|
352
|
-
*
|
|
380
|
+
* Check each market against the event's players and stats, and the line
|
|
381
|
+
* rule, before sending. Failing markets come back `rejected` without a
|
|
382
|
+
* request; the rest are sent with the event's own stat key. The exchange
|
|
383
|
+
* checks every market either way. Reads `eventPlayers()`, so the token also
|
|
384
|
+
* needs the `events` scope.
|
|
353
385
|
*/
|
|
354
|
-
|
|
386
|
+
validate?: boolean;
|
|
355
387
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
* without a request; the rest are sent with the event's own stat key. The
|
|
359
|
-
* exchange checks every market either way. Reads `eventPlayers()`, so the
|
|
360
|
-
* token also needs the `events` scope.
|
|
388
|
+
* Run every check on the exchange and create nothing. A market that would
|
|
389
|
+
* be created, or a repeat of one, comes back `valid`.
|
|
361
390
|
*/
|
|
362
|
-
|
|
391
|
+
dryRun?: boolean;
|
|
363
392
|
}
|
|
364
393
|
/** The most markets one `createMarkets()` call takes. */
|
|
365
394
|
declare const MAX_MARKETS_PER_REQUEST = 25;
|
|
@@ -1859,19 +1888,6 @@ interface NewOrder {
|
|
|
1859
1888
|
* `good_till_time`. UNIX microseconds.
|
|
1860
1889
|
*/
|
|
1861
1890
|
expiration_time?: number | null;
|
|
1862
|
-
/**
|
|
1863
|
-
* Location code from the STX geolocation check, covering this order. Inside a
|
|
1864
|
-
* `POST /api/v1/orders/batched` leg it is ignored; send the batch's top-level
|
|
1865
|
-
* `geo_location` instead. Read only in environments that enforce geo-fencing,
|
|
1866
|
-
* and ignored elsewhere. Where it is read, omitting it is a 422 (`Placing
|
|
1867
|
-
* Order(s) from this IP address … is disallowed.`) unless that environment
|
|
1868
|
-
* accepts the network location the request arrives from in its place, which
|
|
1869
|
-
* it can refuse for an address identified as a VPN, proxy or hosting
|
|
1870
|
-
* provider. Do not rely on omitting it: send the code whenever you have one.
|
|
1871
|
-
* A code that is sent is always checked, so a bad one is a 422 even where
|
|
1872
|
-
* omitting it would have been accepted.
|
|
1873
|
-
*/
|
|
1874
|
-
geo_location?: string | null;
|
|
1875
1891
|
/**
|
|
1876
1892
|
* The market to place the order on.
|
|
1877
1893
|
*/
|
|
@@ -2911,28 +2927,37 @@ declare class STXInvalidTokenException extends STXAuthenticationException {
|
|
|
2911
2927
|
*/
|
|
2912
2928
|
declare class STXInsufficientScopeException extends STXForbiddenException {
|
|
2913
2929
|
}
|
|
2914
|
-
/**
|
|
2915
|
-
|
|
2930
|
+
/**
|
|
2931
|
+
* 403 on an OAuth bearer request: the member has not accepted the current STX
|
|
2932
|
+
* terms, so the exchange places no orders for them through an app
|
|
2933
|
+
* (`{"error": "terms_required", "terms_url": "..."}`). The connection and the
|
|
2934
|
+
* tokens are fine, and reads and cancels keep working. Send the member's
|
|
2935
|
+
* browser to `termsUrl` (see `termsUrlWithReturn()`); once they have agreed on
|
|
2936
|
+
* the STX page, the same call works with the same tokens.
|
|
2937
|
+
*/
|
|
2938
|
+
declare class STXTermsRequiredException extends STXForbiddenException {
|
|
2939
|
+
/** The STX page where the member accepts the terms, when the answer names it. */
|
|
2940
|
+
readonly termsUrl: string | undefined;
|
|
2941
|
+
constructor(message: string, opts?: STXExceptionOptions & {
|
|
2942
|
+
termsUrl?: string;
|
|
2943
|
+
});
|
|
2916
2944
|
}
|
|
2917
2945
|
/**
|
|
2918
|
-
*
|
|
2919
|
-
*
|
|
2946
|
+
* 403 on an OAuth bearer request: the token is fine, but the app's IP
|
|
2947
|
+
* allow-list does not include the address this write came from
|
|
2948
|
+
* (`{"error": "ip_not_allowed"}`). Reads keep working. Send writes from an
|
|
2949
|
+
* address on the allow-list you gave STX for this app. Never retried.
|
|
2920
2950
|
*/
|
|
2921
|
-
declare class
|
|
2951
|
+
declare class STXIPNotAllowedException extends STXForbiddenException {
|
|
2952
|
+
}
|
|
2953
|
+
/** 404: the resource does not exist, or belongs to another account. */
|
|
2954
|
+
declare class STXNotFoundException extends STXAPIException {
|
|
2922
2955
|
}
|
|
2923
2956
|
/**
|
|
2924
|
-
* 422
|
|
2925
|
-
*
|
|
2926
|
-
* invalid, expired or from another user. A subclass of
|
|
2927
|
-
* `STXRejectedException`, so existing `catch` blocks still see it.
|
|
2928
|
-
*
|
|
2929
|
-
* `reason` classifies it; `ipAddress` is the address the exchange saw, when
|
|
2930
|
-
* its message names one. Never retried.
|
|
2957
|
+
* 422: the exchange refused the request, e.g. insufficient funds, a closed
|
|
2958
|
+
* market or an order from outside the region.
|
|
2931
2959
|
*/
|
|
2932
|
-
declare class
|
|
2933
|
-
readonly reason: GeoRejection["reason"];
|
|
2934
|
-
readonly ipAddress: string | undefined;
|
|
2935
|
-
constructor(message: string, rejection: GeoRejection, opts?: STXExceptionOptions);
|
|
2960
|
+
declare class STXRejectedException extends STXAPIException {
|
|
2936
2961
|
}
|
|
2937
2962
|
/** 429: too many requests. `retryAfter` is seconds, when sent. */
|
|
2938
2963
|
declare class STXRateLimitException extends STXAPIException {
|
|
@@ -2970,6 +2995,91 @@ declare class STXChannelException extends STXException {
|
|
|
2970
2995
|
*/
|
|
2971
2996
|
declare class STXTimeoutException extends STXChannelException {
|
|
2972
2997
|
}
|
|
2998
|
+
/** The sentence an `STXNotAvailableException` carries: `Combos are not available on demo.stxapp.ca yet.` */
|
|
2999
|
+
declare function notAvailableMessage(feature: string, host: string): string;
|
|
3000
|
+
/**
|
|
3001
|
+
* This exchange does not have the feature yet: combos on an exchange without
|
|
3002
|
+
* them, OAuth where it is not switched on, a scope the exchange does not offer
|
|
3003
|
+
* in its jurisdiction. Nothing is wrong with the request or the credentials,
|
|
3004
|
+
* and nothing else is affected; the same call works on an exchange that has
|
|
3005
|
+
* the feature. `STX.capabilities()` says up front which features an exchange
|
|
3006
|
+
* has.
|
|
3007
|
+
*
|
|
3008
|
+
* `feature` is a stable id (`oauth`, `oauth.member`, `oauth.app`, `connect`,
|
|
3009
|
+
* `terms.stx_page`, `markets.create`, `market_types`, `event_players`,
|
|
3010
|
+
* `leaderboard`, `loyalty`, `combos`, or `scope:<name>`); `host` is the exchange that answered.
|
|
3011
|
+
* `statusCode` and `body` are the HTTP answer the decision came from, when
|
|
3012
|
+
* there was one.
|
|
3013
|
+
*/
|
|
3014
|
+
declare class STXNotAvailableException extends STXAPIException {
|
|
3015
|
+
/** The feature id, e.g. `"combos"`. */
|
|
3016
|
+
readonly feature: string;
|
|
3017
|
+
/** The exchange host that lacks it, e.g. `"demo.stxapp.ca"`. */
|
|
3018
|
+
readonly host: string;
|
|
3019
|
+
constructor(feature: string, host: string, opts?: STXExceptionOptions & {
|
|
3020
|
+
message?: string;
|
|
3021
|
+
});
|
|
3022
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* Combos are not available on this exchange: it refused the join to the
|
|
3026
|
+
* player or maker topic with `unmatched topic`. Nothing else is affected.
|
|
3027
|
+
*
|
|
3028
|
+
* A channel exception, as before, and also an `STXNotAvailableException`
|
|
3029
|
+
* (`instanceof` is true for both), with `feature` `"combos"` and `host`.
|
|
3030
|
+
*/
|
|
3031
|
+
declare class STXCombosUnavailableException extends STXChannelException {
|
|
3032
|
+
readonly feature = "combos";
|
|
3033
|
+
/** The exchange host that lacks combos. */
|
|
3034
|
+
readonly host: string;
|
|
3035
|
+
constructor(message: string, opts?: {
|
|
3036
|
+
topic?: string;
|
|
3037
|
+
reply?: unknown;
|
|
3038
|
+
host?: string;
|
|
3039
|
+
});
|
|
3040
|
+
}
|
|
3041
|
+
/**
|
|
3042
|
+
* The exchange refused a combo command or join. `code` is the refusal
|
|
3043
|
+
* (`not_found`, `insufficient_assets`, `player_refused`, ...); for
|
|
3044
|
+
* `player_refused:<reason>` the part after the first colon is in `detail`.
|
|
3045
|
+
* `command` is the event that was refused, e.g. `accept`. `reason` (from
|
|
3046
|
+
* `STXChannelException`) is the full string as sent.
|
|
3047
|
+
*/
|
|
3048
|
+
declare class STXComboRefusedException extends STXChannelException {
|
|
3049
|
+
readonly command: string;
|
|
3050
|
+
readonly code: string;
|
|
3051
|
+
readonly detail: string | undefined;
|
|
3052
|
+
constructor(message: string, opts: {
|
|
3053
|
+
topic?: string;
|
|
3054
|
+
reply?: unknown;
|
|
3055
|
+
command: string;
|
|
3056
|
+
code: string;
|
|
3057
|
+
detail?: string;
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
/**
|
|
3061
|
+
* `accept` found nothing live at the accepted amount or better. The request
|
|
3062
|
+
* stays open. `best` is the live best quote now; its fields are null when
|
|
3063
|
+
* nothing is live. Accept again at `best.amount` to take it.
|
|
3064
|
+
*/
|
|
3065
|
+
declare class STXComboPriceMovedException extends STXComboRefusedException {
|
|
3066
|
+
readonly best: {
|
|
3067
|
+
quote_id: string | null;
|
|
3068
|
+
amount: string | null;
|
|
3069
|
+
expires_at: number | null;
|
|
3070
|
+
};
|
|
3071
|
+
constructor(message: string, opts: {
|
|
3072
|
+
topic?: string;
|
|
3073
|
+
reply?: unknown;
|
|
3074
|
+
command: string;
|
|
3075
|
+
code: string;
|
|
3076
|
+
best: {
|
|
3077
|
+
quote_id: string | null;
|
|
3078
|
+
amount: string | null;
|
|
3079
|
+
expires_at: number | null;
|
|
3080
|
+
};
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
2973
3083
|
/** Build the exception for one non-2xx response. */
|
|
2974
3084
|
declare function errorForStatus(statusCode: number, body: unknown, opts: {
|
|
2975
3085
|
method: string;
|
|
@@ -3071,8 +3181,8 @@ declare class ApiKeyCredentials implements AuthProvider {
|
|
|
3071
3181
|
toString(): string;
|
|
3072
3182
|
}
|
|
3073
3183
|
|
|
3074
|
-
declare const VERSION = "0.
|
|
3075
|
-
declare const USER_AGENT = "stx-typescript/0.
|
|
3184
|
+
declare const VERSION = "0.10.0";
|
|
3185
|
+
declare const USER_AGENT = "stx-typescript/0.10.0";
|
|
3076
3186
|
/**
|
|
3077
3187
|
* `Symbol.asyncDispose` where the runtime has it (Node 20+, Bun), so
|
|
3078
3188
|
* `await using client = new STX()` works there; a registered stand-in on
|
|
@@ -3126,8 +3236,10 @@ declare const CHANNELS: readonly ["balances", "orders", "fills", "positions"];
|
|
|
3126
3236
|
*
|
|
3127
3237
|
* const ws = await client.websocket().connect();
|
|
3128
3238
|
* const view = await ws.accountView({ onChange: (c) => render(c.view.state()) });
|
|
3129
|
-
* view.balance?.available_balance; // "
|
|
3130
|
-
* view.openOrders;
|
|
3239
|
+
* view.balance?.available_balance; // "746.8600"
|
|
3240
|
+
* view.openOrders[0]?.id; // "4702e9b6-211a-4805-a605-0eb0817ee9b3"
|
|
3241
|
+
* view.openOrders[0]?.status; // "open"
|
|
3242
|
+
* view.openOrders[0]?.price; // "0.5800"
|
|
3131
3243
|
*/
|
|
3132
3244
|
declare class AccountView {
|
|
3133
3245
|
#private;
|
|
@@ -3169,6 +3281,349 @@ declare class AccountView {
|
|
|
3169
3281
|
close(): Promise<void>;
|
|
3170
3282
|
}
|
|
3171
3283
|
|
|
3284
|
+
/** What the combination needs of a leg. */
|
|
3285
|
+
type ComboOutcome = "won" | "lost";
|
|
3286
|
+
/** One leg of a quote request. */
|
|
3287
|
+
interface ComboLeg {
|
|
3288
|
+
/** An `open`, ordinary (not combination) market. */
|
|
3289
|
+
marketId: string;
|
|
3290
|
+
outcome: ComboOutcome;
|
|
3291
|
+
}
|
|
3292
|
+
/** Options for `STXWebSocket.comboPlayer()` and `STXWebSocket.comboMaker()`. */
|
|
3293
|
+
interface ComboJoinOptions<E> {
|
|
3294
|
+
/** Called for every typed event, as it arrives. */
|
|
3295
|
+
onEvent?: (event: E) => void | Promise<void>;
|
|
3296
|
+
}
|
|
3297
|
+
/** The join reply on either topic. */
|
|
3298
|
+
interface ComboJoinReply {
|
|
3299
|
+
/** Your account's pseudonym for counterparties. Makers see the player's on requests and quotes. */
|
|
3300
|
+
external_id: string;
|
|
3301
|
+
}
|
|
3302
|
+
/** `requestQuote()` reply. */
|
|
3303
|
+
interface ComboRequestReply {
|
|
3304
|
+
rfq_id: string;
|
|
3305
|
+
}
|
|
3306
|
+
/** `cashOut()` reply. */
|
|
3307
|
+
interface ComboCashOutReply {
|
|
3308
|
+
rfq_id: string;
|
|
3309
|
+
/** The combination being sold. */
|
|
3310
|
+
market_id: string;
|
|
3311
|
+
/** Contracts to sell, set by the exchange: what you hold less your resting sells. */
|
|
3312
|
+
quantity: string;
|
|
3313
|
+
}
|
|
3314
|
+
/** `accept()` reply: what was placed for the player, not what filled. */
|
|
3315
|
+
interface ComboPlacement {
|
|
3316
|
+
market_id: string;
|
|
3317
|
+
/** The player's order. Its fills arrive on `fills`. */
|
|
3318
|
+
order_id: string;
|
|
3319
|
+
quantity: string;
|
|
3320
|
+
price: string;
|
|
3321
|
+
}
|
|
3322
|
+
/** `cancel()` reply. */
|
|
3323
|
+
interface ComboCancelReply {
|
|
3324
|
+
/** The `rfq_id` that was cancelled. */
|
|
3325
|
+
cancelled: string;
|
|
3326
|
+
}
|
|
3327
|
+
/** The best live quote. All three fields are null when nothing is live. */
|
|
3328
|
+
interface ComboBestQuote {
|
|
3329
|
+
quote_id: string | null;
|
|
3330
|
+
amount: string | null;
|
|
3331
|
+
/** Microseconds since the Unix epoch. */
|
|
3332
|
+
expires_at: number | null;
|
|
3333
|
+
}
|
|
3334
|
+
/** `snapshot()` reply. */
|
|
3335
|
+
interface ComboSnapshot {
|
|
3336
|
+
rfq_id: string;
|
|
3337
|
+
/** Null on a buy until a bind places; the combination on a cash out. */
|
|
3338
|
+
market_id: string | null;
|
|
3339
|
+
/** `binding` while an acceptance waits for its next bind attempt. */
|
|
3340
|
+
status: "open" | "binding";
|
|
3341
|
+
/** The player's side: `buy` for a request, `sell` for a cash out. */
|
|
3342
|
+
side: "buy" | "sell";
|
|
3343
|
+
/** The stake on a buy; null on a cash out. */
|
|
3344
|
+
amount: string | null;
|
|
3345
|
+
/** The size on a cash out; null on a buy. */
|
|
3346
|
+
quantity: string | null;
|
|
3347
|
+
/** When the request ends, in microseconds since the Unix epoch. */
|
|
3348
|
+
expires_at: number;
|
|
3349
|
+
best_quote: ComboBestQuote;
|
|
3350
|
+
}
|
|
3351
|
+
/** `quote()` reply. It carries no price or size: the bind sets those. */
|
|
3352
|
+
interface ComboQuoteReply {
|
|
3353
|
+
quote_id: string;
|
|
3354
|
+
/** The amount as recorded. */
|
|
3355
|
+
amount: string;
|
|
3356
|
+
/** The player's `external_id`. */
|
|
3357
|
+
external_id: string;
|
|
3358
|
+
}
|
|
3359
|
+
/** `withdrawQuote()` reply. */
|
|
3360
|
+
interface ComboWithdrawReply {
|
|
3361
|
+
/** The `quote_id` that was withdrawn. */
|
|
3362
|
+
withdrawn: string;
|
|
3363
|
+
}
|
|
3364
|
+
/** Why a player's request ended without placing. */
|
|
3365
|
+
type ComboRequestClosedReason = "cancelled" | "expired" | "leg_not_quotable" | "unknown_leg" | "player_refused" | "maker_refused";
|
|
3366
|
+
/** `best_quote`: the best quote changed. */
|
|
3367
|
+
interface ComboBestQuoteEvent extends ComboBestQuote {
|
|
3368
|
+
rfq_id: string;
|
|
3369
|
+
market_id: string | null;
|
|
3370
|
+
}
|
|
3371
|
+
/** `placed`: the bind placed. The `accept()` reply plus `rfq_id`. */
|
|
3372
|
+
interface ComboPlacedEvent extends ComboPlacement {
|
|
3373
|
+
rfq_id: string;
|
|
3374
|
+
}
|
|
3375
|
+
/** `negotiation_closed` to the player: the request ended without placing. */
|
|
3376
|
+
interface ComboRequestClosedEvent {
|
|
3377
|
+
rfq_id: string;
|
|
3378
|
+
market_id: string | null;
|
|
3379
|
+
reason: ComboRequestClosedReason;
|
|
3380
|
+
}
|
|
3381
|
+
/** An event on the player's topic. Narrow on `event`. */
|
|
3382
|
+
type ComboPlayerEvent = {
|
|
3383
|
+
event: "best_quote";
|
|
3384
|
+
payload: ComboBestQuoteEvent;
|
|
3385
|
+
} | {
|
|
3386
|
+
event: "placed";
|
|
3387
|
+
payload: ComboPlacedEvent;
|
|
3388
|
+
} | {
|
|
3389
|
+
event: "negotiation_closed";
|
|
3390
|
+
payload: ComboRequestClosedEvent;
|
|
3391
|
+
};
|
|
3392
|
+
/** One leg as makers see it. */
|
|
3393
|
+
interface ComboRfqLeg {
|
|
3394
|
+
market_id: string;
|
|
3395
|
+
outcome: ComboOutcome;
|
|
3396
|
+
/** Display name of the leg's market. Null when the exchange has no name for it. */
|
|
3397
|
+
short_name: string | null;
|
|
3398
|
+
}
|
|
3399
|
+
/** `rfq_opened`: a player opened a request. */
|
|
3400
|
+
interface ComboRfqOpenedEvent {
|
|
3401
|
+
rfq_id: string;
|
|
3402
|
+
/** Null on a buy; the combination on a cash out. */
|
|
3403
|
+
market_id: string | null;
|
|
3404
|
+
/** The player's pseudonym. */
|
|
3405
|
+
external_id: string;
|
|
3406
|
+
/** The player's side; the maker takes the other. */
|
|
3407
|
+
side: "buy" | "sell";
|
|
3408
|
+
/** The stake on a buy; null on a cash out. */
|
|
3409
|
+
amount: string | null;
|
|
3410
|
+
/** The size on a cash out; null on a buy. */
|
|
3411
|
+
quantity: string | null;
|
|
3412
|
+
/** Price against this, not a constant. */
|
|
3413
|
+
max_price: string;
|
|
3414
|
+
/** Price against this, not a constant. */
|
|
3415
|
+
tick_size: string;
|
|
3416
|
+
expires_at: number;
|
|
3417
|
+
legs: ComboRfqLeg[];
|
|
3418
|
+
}
|
|
3419
|
+
/** Why a request ended, as the feed reports it. */
|
|
3420
|
+
type ComboRfqClosedReason = "placed" | "cancelled" | "expired" | "leg_not_quotable" | "unknown_leg" | "player_refused" | "maker_refused" | "ended";
|
|
3421
|
+
/** `rfq_closed`: a request ended. */
|
|
3422
|
+
interface ComboRfqClosedEvent {
|
|
3423
|
+
rfq_id: string;
|
|
3424
|
+
market_id: string | null;
|
|
3425
|
+
reason: ComboRfqClosedReason;
|
|
3426
|
+
}
|
|
3427
|
+
/** `quote_accepted`: this quote is about to be bound. */
|
|
3428
|
+
interface ComboQuoteAcceptedEvent {
|
|
3429
|
+
rfq_id: string;
|
|
3430
|
+
market_id: string | null;
|
|
3431
|
+
external_id: string;
|
|
3432
|
+
quote_id: string;
|
|
3433
|
+
}
|
|
3434
|
+
/** `placed` to the maker: this quote bound and the maker's order was placed. Both orders share the size and price. */
|
|
3435
|
+
interface ComboMakerPlacedEvent {
|
|
3436
|
+
rfq_id: string;
|
|
3437
|
+
market_id: string;
|
|
3438
|
+
external_id: string;
|
|
3439
|
+
quote_id: string;
|
|
3440
|
+
/** The maker's order. Its fills arrive on `fills`. */
|
|
3441
|
+
order_id: string;
|
|
3442
|
+
quantity: string;
|
|
3443
|
+
price: string;
|
|
3444
|
+
}
|
|
3445
|
+
/** Why one of the maker's quotes stopped standing. */
|
|
3446
|
+
type ComboQuoteClosedReason = "placed_elsewhere" | "maker_refused" | "cancelled" | "expired" | "leg_not_quotable" | "unknown_leg" | "player_refused";
|
|
3447
|
+
/** `negotiation_closed` to the maker: this quote stopped standing. */
|
|
3448
|
+
interface ComboQuoteClosedEvent {
|
|
3449
|
+
rfq_id: string;
|
|
3450
|
+
market_id: string | null;
|
|
3451
|
+
external_id: string;
|
|
3452
|
+
quote_id: string;
|
|
3453
|
+
reason: ComboQuoteClosedReason;
|
|
3454
|
+
}
|
|
3455
|
+
/** An event on the maker's topic. Narrow on `event`. */
|
|
3456
|
+
type ComboMakerEvent = {
|
|
3457
|
+
event: "rfq_opened";
|
|
3458
|
+
payload: ComboRfqOpenedEvent;
|
|
3459
|
+
} | {
|
|
3460
|
+
event: "rfq_closed";
|
|
3461
|
+
payload: ComboRfqClosedEvent;
|
|
3462
|
+
} | {
|
|
3463
|
+
event: "quote_accepted";
|
|
3464
|
+
payload: ComboQuoteAcceptedEvent;
|
|
3465
|
+
} | {
|
|
3466
|
+
event: "placed";
|
|
3467
|
+
payload: ComboMakerPlacedEvent;
|
|
3468
|
+
} | {
|
|
3469
|
+
event: "negotiation_closed";
|
|
3470
|
+
payload: ComboQuoteClosedEvent;
|
|
3471
|
+
};
|
|
3472
|
+
/**
|
|
3473
|
+
* A refusal `reason` the exchange documents for combo commands. The type stays
|
|
3474
|
+
* open (`string`) because a few reasons are sentences passed through verbatim.
|
|
3475
|
+
*/
|
|
3476
|
+
type ComboRefusalReason = "malformed_payload" | "malformed_id" | "malformed_money" | "malformed_leg" | "malformed_client_order_id" | "unknown_command" | "not_found" | "timeout" | "request_unavailable" | "not_the_requester" | "combo_minimum_two_markets_needed" | "combo_maximum_legs_exceeded" | "unknown_outcome" | "non_positive_amount" | "sub_cent_amount" | "insufficient_assets" | "draining" | "account_unreachable" | "unknown_leg" | "leg_not_quotable" | "duplicate_legs" | "request_not_started" | "unknown_combination" | "market_not_quotable" | "combination_unavailable" | "nothing_to_sell" | "price_moved" | "player_refused" | "maker_refused" | "market_not_trading" | "market_unavailable" | "price_out_of_range" | "below_one_contract" | "bind_in_progress" | "cancelled" | "expired" | "expires_at_required" | "cannot_quote_own_request" | "unknown_quote" | "unauthorized" | "insufficient_scope" | (string & {});
|
|
3477
|
+
/** What the player and maker sessions share: the joined channel, typed events and waiting. */
|
|
3478
|
+
declare abstract class ComboSession<E extends {
|
|
3479
|
+
event: string;
|
|
3480
|
+
payload: {
|
|
3481
|
+
rfq_id: string;
|
|
3482
|
+
};
|
|
3483
|
+
}> implements AsyncIterable<E> {
|
|
3484
|
+
#private;
|
|
3485
|
+
/** The underlying channel. Its `reply` is the latest join reply. */
|
|
3486
|
+
readonly channel: Channel;
|
|
3487
|
+
/** @internal */
|
|
3488
|
+
constructor(channel: Channel, events: ReadonlySet<string>, onEvent: ((event: E) => void | Promise<void>) | undefined);
|
|
3489
|
+
/** Your account's pseudonym for counterparties, from the join reply. */
|
|
3490
|
+
get externalId(): string;
|
|
3491
|
+
/** @internal */
|
|
3492
|
+
_typed(msg: ChannelMessage): E | undefined;
|
|
3493
|
+
/** @internal Called for every message on the channel, before it is queued. */
|
|
3494
|
+
_receive(msg: ChannelMessage): Promise<void>;
|
|
3495
|
+
/** The events received so far (the latest 1000), oldest first. */
|
|
3496
|
+
get events(): readonly E[];
|
|
3497
|
+
/**
|
|
3498
|
+
* The next event, in arrival order. Rejects with `STXTimeoutException` when
|
|
3499
|
+
* none arrives within `timeoutMs`, and with `STXChannelException` once the
|
|
3500
|
+
* channel is closed. Use either this or `for await`, not both.
|
|
3501
|
+
*/
|
|
3502
|
+
next(timeoutMs?: number | null): Promise<E>;
|
|
3503
|
+
[Symbol.asyncIterator](): AsyncIterator<E>;
|
|
3504
|
+
/**
|
|
3505
|
+
* Resolve with the first event named `event` (or one of several) for
|
|
3506
|
+
* `rfqId`, looking first at events already received. Unlike `next()`, it
|
|
3507
|
+
* takes nothing from the queue. Rejects with `STXTimeoutException` after
|
|
3508
|
+
* `timeoutMs` (default 10000).
|
|
3509
|
+
*
|
|
3510
|
+
* @param event An event name, or several.
|
|
3511
|
+
* @param opts.rfqId Only events for this request.
|
|
3512
|
+
* @param opts.quoteId Only events for this quote (maker events).
|
|
3513
|
+
* @param opts.timeoutMs Milliseconds to wait. Default 10000.
|
|
3514
|
+
*/
|
|
3515
|
+
waitFor<K extends E["event"]>(event: K | readonly K[], opts?: {
|
|
3516
|
+
rfqId?: string;
|
|
3517
|
+
quoteId?: string;
|
|
3518
|
+
timeoutMs?: number;
|
|
3519
|
+
}): Promise<Extract<E, {
|
|
3520
|
+
event: K;
|
|
3521
|
+
}>>;
|
|
3522
|
+
/**
|
|
3523
|
+
* Leave the topic. Requests opened and quotes placed on this channel end
|
|
3524
|
+
* (`cancelled`), as on any close, and delivery on this channel stops when
|
|
3525
|
+
* `leave()` resolves: the exchange's `negotiation_closed` for those requests
|
|
3526
|
+
* arrives after the channel has closed and is not passed to `onEvent` or to
|
|
3527
|
+
* an iterator. Treat every request still open here as cancelled once
|
|
3528
|
+
* `leave()` resolves. To see each request's own close first, `cancel()` it
|
|
3529
|
+
* and wait for its `negotiation_closed` before leaving. Other connections of
|
|
3530
|
+
* the same member still receive the close.
|
|
3531
|
+
*/
|
|
3532
|
+
leave(): Promise<void>;
|
|
3533
|
+
/** @internal Send a command and map a refusal to the combo exceptions. */
|
|
3534
|
+
_command<T>(command: string, payload: Record<string, unknown>, timeoutMs?: number): Promise<T>;
|
|
3535
|
+
}
|
|
3536
|
+
/**
|
|
3537
|
+
* The player's side of combos, on `rfq:<user_id>`. Get one with
|
|
3538
|
+
* `ws.comboPlayer()`.
|
|
3539
|
+
*
|
|
3540
|
+
* A request belongs to this channel: leaving or a dropped socket ends it
|
|
3541
|
+
* `cancelled`, and the SDK's automatic rejoin does not bring it back.
|
|
3542
|
+
* Every refusal throws `STXComboRefusedException` with the exchange's
|
|
3543
|
+
* `reason` in `code`.
|
|
3544
|
+
*/
|
|
3545
|
+
declare class ComboPlayer extends ComboSession<ComboPlayerEvent> {
|
|
3546
|
+
/** @internal */
|
|
3547
|
+
constructor(channel: Channel, onEvent?: (event: ComboPlayerEvent) => void | Promise<void>);
|
|
3548
|
+
/**
|
|
3549
|
+
* `request_quote`: ask makers to quote on these legs for a stake. `amount`
|
|
3550
|
+
* is the stake as a decimal string in whole cents, e.g. `"250.00"`. Makers
|
|
3551
|
+
* quote what you win; quotes arrive as `best_quote` events.
|
|
3552
|
+
*
|
|
3553
|
+
* @param legs Two or more `open` markets and the outcome the combination needs of each.
|
|
3554
|
+
* @param amount The stake in dollars, e.g. `"250.00"`.
|
|
3555
|
+
*/
|
|
3556
|
+
requestQuote(legs: readonly ComboLeg[], amount: string): Promise<ComboRequestReply>;
|
|
3557
|
+
/**
|
|
3558
|
+
* `cash_out`: ask makers to quote for what you hold of a combination, by the
|
|
3559
|
+
* `market_id` from `placed`. The exchange sets the size.
|
|
3560
|
+
*
|
|
3561
|
+
* @param marketId The combination's market id.
|
|
3562
|
+
*/
|
|
3563
|
+
cashOut(marketId: string): Promise<ComboCashOutReply>;
|
|
3564
|
+
/**
|
|
3565
|
+
* `accept`: bind the request at `amount` or more, normally the amount
|
|
3566
|
+
* `best_quote` showed. The best live quote binds whoever made it, so the
|
|
3567
|
+
* placement can be better than `amount`. Waits up to 35 s.
|
|
3568
|
+
*
|
|
3569
|
+
* Throws `STXComboPriceMovedException` (with the live `best`) when nothing
|
|
3570
|
+
* at least as good is live; the request stays open and you can accept again.
|
|
3571
|
+
* The reply says what was placed; fills arrive on `fills`.
|
|
3572
|
+
*
|
|
3573
|
+
* @param rfqId The request.
|
|
3574
|
+
* @param quoteId The quote you saw, normally from `best_quote`.
|
|
3575
|
+
* @param amount The least amount you take, e.g. `"1750.00"`.
|
|
3576
|
+
*/
|
|
3577
|
+
accept(rfqId: string, quoteId: string, amount: string): Promise<ComboPlacement>;
|
|
3578
|
+
/**
|
|
3579
|
+
* `cancel`: end the request and drop every quote on it.
|
|
3580
|
+
*
|
|
3581
|
+
* @param rfqId The request.
|
|
3582
|
+
*/
|
|
3583
|
+
cancel(rfqId: string): Promise<ComboCancelReply>;
|
|
3584
|
+
/**
|
|
3585
|
+
* `snapshot`: the request now, with the live best quote. Not delayed like `best_quote` events.
|
|
3586
|
+
*
|
|
3587
|
+
* @param rfqId The request.
|
|
3588
|
+
*/
|
|
3589
|
+
snapshot(rfqId: string): Promise<ComboSnapshot>;
|
|
3590
|
+
}
|
|
3591
|
+
/**
|
|
3592
|
+
* The maker's side of combos, on `combo_quote:<user_id>`. Get one with
|
|
3593
|
+
* `ws.comboMaker()`. Joining subscribes to every request opened after the
|
|
3594
|
+
* join (`rfq_opened`); earlier requests are not replayed.
|
|
3595
|
+
*
|
|
3596
|
+
* A quote belongs to this channel: leaving or a dropped socket withdraws it.
|
|
3597
|
+
* Every refusal throws `STXComboRefusedException` with the exchange's
|
|
3598
|
+
* `reason` in `code`.
|
|
3599
|
+
*/
|
|
3600
|
+
declare class ComboMaker extends ComboSession<ComboMakerEvent> {
|
|
3601
|
+
/** @internal */
|
|
3602
|
+
constructor(channel: Channel, onEvent?: (event: ComboMakerEvent) => void | Promise<void>);
|
|
3603
|
+
/**
|
|
3604
|
+
* `quote`: offer `amount` on a request. On a buy it is what the player wins;
|
|
3605
|
+
* on a cash out, what you pay for the whole size. Price it against the
|
|
3606
|
+
* request's `max_price` and `tick_size`. `expiresInMs` (a positive integer)
|
|
3607
|
+
* counts from receipt; the quote ends no later than its request.
|
|
3608
|
+
* `clientOrderId` (at most 255 bytes) is copied onto your order if it binds.
|
|
3609
|
+
*
|
|
3610
|
+
* @param rfqId The request, from `rfq_opened`.
|
|
3611
|
+
* @param amount In dollars, e.g. `"1750.00"`.
|
|
3612
|
+
* @param expiresInMs How long the quote stands, in milliseconds.
|
|
3613
|
+
* @param opts.clientOrderId Copied onto your order if the quote binds.
|
|
3614
|
+
*/
|
|
3615
|
+
quote(rfqId: string, amount: string, expiresInMs: number, opts?: {
|
|
3616
|
+
clientOrderId?: string | null;
|
|
3617
|
+
}): Promise<ComboQuoteReply>;
|
|
3618
|
+
/**
|
|
3619
|
+
* `withdraw_quote`: remove one of your quotes.
|
|
3620
|
+
*
|
|
3621
|
+
* @param rfqId The request.
|
|
3622
|
+
* @param quoteId Your quote, from the `quote()` reply.
|
|
3623
|
+
*/
|
|
3624
|
+
withdrawQuote(rfqId: string, quoteId: string): Promise<ComboWithdrawReply>;
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3172
3627
|
/** Events that carry state on join, by channel name (topic prefix). */
|
|
3173
3628
|
declare const SNAPSHOT_EVENTS: Readonly<Record<string, readonly string[]>>;
|
|
3174
3629
|
/** One pushed frame. */
|
|
@@ -3207,7 +3662,6 @@ declare class ReconnectPolicy {
|
|
|
3207
3662
|
constructor(opts?: ReconnectPolicyOptions);
|
|
3208
3663
|
delayMs(attempt: number): number;
|
|
3209
3664
|
}
|
|
3210
|
-
/** One joined topic. */
|
|
3211
3665
|
declare class Channel implements AsyncIterable<ChannelMessage> {
|
|
3212
3666
|
#private;
|
|
3213
3667
|
/** The wire topic, e.g. `orders:<user_id>`. */
|
|
@@ -3227,6 +3681,19 @@ declare class Channel implements AsyncIterable<ChannelMessage> {
|
|
|
3227
3681
|
joinRef: string | null;
|
|
3228
3682
|
joined: boolean;
|
|
3229
3683
|
closed: boolean;
|
|
3684
|
+
/** @internal Milliseconds between pings while joined; null when none are sent. */
|
|
3685
|
+
_pingEveryMs: number | null;
|
|
3686
|
+
/** @internal */
|
|
3687
|
+
_joinTail: Promise<unknown>;
|
|
3688
|
+
/** @internal */
|
|
3689
|
+
_joinedConnection: number;
|
|
3690
|
+
/** @internal The connection whose join also restored watches and the pinger. */
|
|
3691
|
+
_restoredConnection: number;
|
|
3692
|
+
/** @internal A phx_close/phx_error for the join in flight. */
|
|
3693
|
+
_endedJoin: {
|
|
3694
|
+
joinRef: string;
|
|
3695
|
+
event: string;
|
|
3696
|
+
} | null;
|
|
3230
3697
|
constructor(ws: STXWebSocket, topic: string, joinPayload: Record<string, unknown>, onMessage: MessageHandler | undefined, opts: {
|
|
3231
3698
|
pingIntervalMs: number | null;
|
|
3232
3699
|
queueSize: number;
|
|
@@ -3287,6 +3754,8 @@ declare class Channel implements AsyncIterable<ChannelMessage> {
|
|
|
3287
3754
|
_stopPinger(): void;
|
|
3288
3755
|
/** @internal */
|
|
3289
3756
|
_resetForRejoin(): void;
|
|
3757
|
+
/** @internal End the channel after every queued message is read. */
|
|
3758
|
+
_finish(): void;
|
|
3290
3759
|
/** @internal */
|
|
3291
3760
|
_close(): void;
|
|
3292
3761
|
}
|
|
@@ -3305,15 +3774,21 @@ interface STXWebSocketOptions extends Pick<STXOptions, "environment" | "region"
|
|
|
3305
3774
|
/** Milliseconds between socket heartbeats. The server closes a socket silent for 60 s. Default 25000. */
|
|
3306
3775
|
heartbeatIntervalMs?: number;
|
|
3307
3776
|
/**
|
|
3308
|
-
* Milliseconds between channel `ping` frames on every joined topic
|
|
3309
|
-
* disables them. `orders` with cancel-on-disconnect
|
|
3310
|
-
* granted timeout. Default 30000.
|
|
3777
|
+
* Milliseconds between channel `ping` frames on every joined topic that
|
|
3778
|
+
* answers them; `null` disables them. `orders` with cancel-on-disconnect
|
|
3779
|
+
* pings faster, from the granted timeout. Default 30000. The `market:<id>`,
|
|
3780
|
+
* `rfq:` and `combo_quote:` topics have no `ping` command and are never
|
|
3781
|
+
* pinged; the socket heartbeat keeps them alive.
|
|
3311
3782
|
*/
|
|
3312
3783
|
channelPingIntervalMs?: number | null;
|
|
3313
3784
|
/** Reconnect after a drop. Default true. */
|
|
3314
3785
|
reconnect?: boolean;
|
|
3315
3786
|
reconnectPolicy?: ReconnectPolicy;
|
|
3316
|
-
/**
|
|
3787
|
+
/**
|
|
3788
|
+
* Called after every successful reconnect and rejoin, and after rejoining a
|
|
3789
|
+
* channel the server closed or errored while the socket stayed up: the
|
|
3790
|
+
* moment to read open orders and anything else you loaded with `STX` again.
|
|
3791
|
+
*/
|
|
3317
3792
|
onReconnect?: () => void | Promise<void>;
|
|
3318
3793
|
/**
|
|
3319
3794
|
* Called when the socket gives up because its credentials are dead: an OAuth
|
|
@@ -3336,7 +3811,7 @@ interface STXWebSocketOptions extends Pick<STXOptions, "environment" | "region"
|
|
|
3336
3811
|
*
|
|
3337
3812
|
* const client = new STX();
|
|
3338
3813
|
* const ws = await client.websocket().connect();
|
|
3339
|
-
* const book = await ws.orderbook(["
|
|
3814
|
+
* const book = await ws.orderbook(["e00651a3-10cb-4bc1-9e1f-c5ea1796c83b"], { onMessage: console.log });
|
|
3340
3815
|
* const orders = await ws.orders();
|
|
3341
3816
|
* console.log(await orders.waitSnapshot());
|
|
3342
3817
|
* await ws.runForever();
|
|
@@ -3362,6 +3837,8 @@ declare class STXWebSocket {
|
|
|
3362
3837
|
readonly channels: Map<string, Channel>;
|
|
3363
3838
|
/** Successful reconnects so far. */
|
|
3364
3839
|
reconnects: number;
|
|
3840
|
+
/** Channels rejoined after the server closed or errored them while the socket stayed up. */
|
|
3841
|
+
channelRejoins: number;
|
|
3365
3842
|
constructor(opts?: STXWebSocketOptions);
|
|
3366
3843
|
toString(): string;
|
|
3367
3844
|
get connected(): boolean;
|
|
@@ -3445,7 +3922,7 @@ declare class STXWebSocket {
|
|
|
3445
3922
|
* `cancelOnDisconnect: true` arms cancel-on-disconnect for orders placed
|
|
3446
3923
|
* with `cancelOnDisconnect: true`. `pingTimeout` is in milliseconds,
|
|
3447
3924
|
* clamped by the server to 5000 to 20000; the granted value is in
|
|
3448
|
-
* `channel.reply.ping_timeout` and the SDK pings at
|
|
3925
|
+
* `channel.reply.ping_timeout` and the SDK pings at a third of it for as long
|
|
3449
3926
|
* as the channel is joined.
|
|
3450
3927
|
*/
|
|
3451
3928
|
orders(opts?: {
|
|
@@ -3494,6 +3971,23 @@ declare class STXWebSocket {
|
|
|
3494
3971
|
userInfo(opts?: {
|
|
3495
3972
|
onMessage?: MessageHandler;
|
|
3496
3973
|
}): Promise<Channel>;
|
|
3974
|
+
/**
|
|
3975
|
+
* Join `rfq:{user_id}` and return a `ComboPlayer`: request quotes on a
|
|
3976
|
+
* combination, cash one out, accept, cancel and read a request.
|
|
3977
|
+
*
|
|
3978
|
+
* Where combos are not available, rejects with
|
|
3979
|
+
* `STXCombosUnavailableException`. Other join refusals (a read-only key, an
|
|
3980
|
+
* account that may not trade) reject with `STXComboRefusedException`.
|
|
3981
|
+
*/
|
|
3982
|
+
comboPlayer(opts?: ComboJoinOptions<ComboPlayerEvent>): Promise<ComboPlayer>;
|
|
3983
|
+
/**
|
|
3984
|
+
* Join `combo_quote:{user_id}` and return a `ComboMaker`: receive every
|
|
3985
|
+
* request opened from now on (`rfq_opened`), quote and withdraw quotes.
|
|
3986
|
+
*
|
|
3987
|
+
* Where combos are not available, rejects with
|
|
3988
|
+
* `STXCombosUnavailableException`.
|
|
3989
|
+
*/
|
|
3990
|
+
comboMaker(opts?: ComboJoinOptions<ComboMakerEvent>): Promise<ComboMaker>;
|
|
3497
3991
|
/**
|
|
3498
3992
|
* Join `topic` with `payload` and wait for the reply. Rejects with
|
|
3499
3993
|
* `STXChannelException` carrying the server's reason (for example
|
|
@@ -3547,12 +4041,6 @@ interface STXOptions {
|
|
|
3547
4041
|
retry?: RetryPolicy;
|
|
3548
4042
|
/** Milliseconds per HTTP request. Default 30000. */
|
|
3549
4043
|
timeoutMs?: number;
|
|
3550
|
-
/**
|
|
3551
|
-
* A geolocation packet, or a function returning one, sent as `geo_location`
|
|
3552
|
-
* with every order write. Only needed where the exchange is geo-fenced and
|
|
3553
|
-
* this machine's IP address is not whitelisted for the account.
|
|
3554
|
-
*/
|
|
3555
|
-
geoLocation?: GeoLocationProvider;
|
|
3556
4044
|
/** Inject a fetch implementation (tests, proxies). */
|
|
3557
4045
|
fetch?: FetchLike;
|
|
3558
4046
|
/**
|
|
@@ -3589,11 +4077,6 @@ interface ResponseEvent {
|
|
|
3589
4077
|
*/
|
|
3590
4078
|
responseBody?: string | null;
|
|
3591
4079
|
}
|
|
3592
|
-
/** The per-call geolocation override accepted by every order write. */
|
|
3593
|
-
interface GeoOption {
|
|
3594
|
-
/** Overrides the client's `geoLocation` for this call; `null` sends none. */
|
|
3595
|
-
geoLocation?: string | null;
|
|
3596
|
-
}
|
|
3597
4080
|
interface MarketsQuery {
|
|
3598
4081
|
marketIds?: StrList;
|
|
3599
4082
|
eventIds?: StrList;
|
|
@@ -3629,7 +4112,7 @@ interface OrdersQuery {
|
|
|
3629
4112
|
orderIds?: StrList;
|
|
3630
4113
|
clientOrderIds?: StrList;
|
|
3631
4114
|
marketIds?: StrList;
|
|
3632
|
-
/** One status or a list, e.g. `["
|
|
4115
|
+
/** One status or a list, e.g. `["accepted", "delayed", "open"]`. */
|
|
3633
4116
|
status?: StrList;
|
|
3634
4117
|
limit?: number;
|
|
3635
4118
|
cursor?: string;
|
|
@@ -3660,16 +4143,25 @@ interface SettlementsQuery {
|
|
|
3660
4143
|
limit?: number;
|
|
3661
4144
|
cursor?: string;
|
|
3662
4145
|
}
|
|
4146
|
+
interface LeaderboardQuery {
|
|
4147
|
+
/** `daily`, `weekly`, `monthly`, `yearly` or `all`. */
|
|
4148
|
+
period?: "daily" | "weekly" | "monthly" | "yearly" | "all" | (string & {});
|
|
4149
|
+
/** `all` or a sport key. */
|
|
4150
|
+
category?: string;
|
|
4151
|
+
/** `volume`, `profit`, `predictions`, `markets`, `win_rate`, `biggest_win`, `return` or `streak`. */
|
|
4152
|
+
metric?: string;
|
|
4153
|
+
limit?: number;
|
|
4154
|
+
}
|
|
3663
4155
|
interface PageQuery {
|
|
3664
4156
|
limit?: number;
|
|
3665
4157
|
cursor?: string;
|
|
3666
4158
|
}
|
|
3667
4159
|
type WithoutCursor<T> = Omit<T, "cursor">;
|
|
3668
4160
|
/** The optional fields of one new order. */
|
|
3669
|
-
interface OrderOptions
|
|
3670
|
-
/** Dollars, as a decimal string: `"0.
|
|
4161
|
+
interface OrderOptions {
|
|
4162
|
+
/** Dollars, as a decimal string: `"0.58"`. Required for a limit order. */
|
|
3671
4163
|
price?: string;
|
|
3672
|
-
/** Contracts, as a decimal string: `"
|
|
4164
|
+
/** Contracts, as a decimal string: `"100"`. */
|
|
3673
4165
|
quantity: string;
|
|
3674
4166
|
clientOrderId?: string;
|
|
3675
4167
|
/** `"good_till_start"` or `"good_till_time"`. */
|
|
@@ -3680,7 +4172,7 @@ interface OrderOptions extends GeoOption {
|
|
|
3680
4172
|
deviceId?: string;
|
|
3681
4173
|
}
|
|
3682
4174
|
/** One order in a `placeOrders` batch. */
|
|
3683
|
-
interface NewOrderInput extends
|
|
4175
|
+
interface NewOrderInput extends OrderOptions {
|
|
3684
4176
|
marketId: string;
|
|
3685
4177
|
/** `"buy"` or `"sell"`. */
|
|
3686
4178
|
action: string;
|
|
@@ -3693,14 +4185,16 @@ interface AcceptTermsOptions {
|
|
|
3693
4185
|
acceptHouseRules?: boolean;
|
|
3694
4186
|
}
|
|
3695
4187
|
/** The JSON body for one new order. Fields left undefined are omitted. */
|
|
3696
|
-
declare function orderBody(marketId: string, action: string, orderType: string, opts:
|
|
4188
|
+
declare function orderBody(marketId: string, action: string, orderType: string, opts: OrderOptions): Record<string, unknown>;
|
|
3697
4189
|
/**
|
|
3698
4190
|
* The STX client. Configuration comes from the options, then
|
|
3699
4191
|
* environment variables, then a profile in ~/.stx/credentials:
|
|
3700
4192
|
*
|
|
3701
4193
|
* const client = new STX();
|
|
3702
4194
|
* const me = await client.me();
|
|
4195
|
+
* me.user_id; // "e6528824-b4e0-4ff8-bd70-36e5904738d1"
|
|
3703
4196
|
* const page = await client.markets({ status: "open", limit: 10 });
|
|
4197
|
+
* page.items[0]?.symbol; // "STXNHL-26OCT101600EDMSJ-GAMEEDM"
|
|
3704
4198
|
*/
|
|
3705
4199
|
declare class STX {
|
|
3706
4200
|
#private;
|
|
@@ -3715,12 +4209,31 @@ declare class STX {
|
|
|
3715
4209
|
readonly verifyTls: boolean;
|
|
3716
4210
|
readonly retry: RetryPolicy;
|
|
3717
4211
|
readonly timeoutMs: number;
|
|
3718
|
-
geoLocation: GeoLocationProvider | undefined;
|
|
3719
4212
|
onResponse: ((event: ResponseEvent) => void) | undefined;
|
|
3720
4213
|
/** Test hook: how retries wait. */
|
|
3721
4214
|
_sleep: (ms: number) => Promise<void>;
|
|
3722
4215
|
constructor(opts?: STXOptions);
|
|
3723
4216
|
toString(): string;
|
|
4217
|
+
/** The exchange host, e.g. `"demo.stxapp.io"`: the name `STXNotAvailableException` and `capabilities()` report. */
|
|
4218
|
+
get host(): string;
|
|
4219
|
+
/**
|
|
4220
|
+
* Which features this exchange has, from what it publishes: its OAuth
|
|
4221
|
+
* discovery document, `/api_version`, a signed GET of the routes that not
|
|
4222
|
+
* every exchange has yet, and a join of a combos topic nobody owns. Nothing
|
|
4223
|
+
* is created or changed. Checked once per client and cached; pass
|
|
4224
|
+
* `{ refresh: true }` to check again.
|
|
4225
|
+
*
|
|
4226
|
+
* const caps = await stx.capabilities();
|
|
4227
|
+
* caps.features.combos; // false on demo.stxapp.ca
|
|
4228
|
+
* caps.require("combos"); // throws STXNotAvailableException there
|
|
4229
|
+
*
|
|
4230
|
+
* Each feature is `true`, `false`, or `null` when it could not be checked
|
|
4231
|
+
* (no credentials for a signed check, or no answer). A missing feature never
|
|
4232
|
+
* throws here; the call that needs it throws `STXNotAvailableException`.
|
|
4233
|
+
*/
|
|
4234
|
+
capabilities(opts?: {
|
|
4235
|
+
refresh?: boolean;
|
|
4236
|
+
}): Promise<Capabilities>;
|
|
3724
4237
|
/** Nothing to release (fetch pools connections itself); present so `await using` and explicit cleanup work. */
|
|
3725
4238
|
close(): Promise<void>;
|
|
3726
4239
|
/**
|
|
@@ -3773,16 +4286,18 @@ declare class STX {
|
|
|
3773
4286
|
* which STX grants, from an address on the client's IP allow-list (it
|
|
3774
4287
|
* applies to every call that client makes).
|
|
3775
4288
|
*
|
|
3776
|
-
* Returns one result per market, in
|
|
3777
|
-
* `
|
|
3778
|
-
*
|
|
3779
|
-
*
|
|
3780
|
-
*
|
|
3781
|
-
*
|
|
4289
|
+
* Returns one result per market, in order: `created` or `exists` (both with
|
|
4290
|
+
* `market_id`), `valid` with `dryRun`, or `rejected` with a `reason`. Each
|
|
4291
|
+
* result's `index` is its position in `markets`, and `market` is that market
|
|
4292
|
+
* as requested. A rejected market is a
|
|
4293
|
+
* result, not an error, and resending is safe: a market that is already
|
|
4294
|
+
* listed comes back `exists`. A refused request throws (`403` without
|
|
4295
|
+
* `markets.write`, `404` unknown event, `422` event not open).
|
|
3782
4296
|
*
|
|
3783
|
-
* `
|
|
3784
|
-
* `MAX_MARKETS_PER_REQUEST` markets throws `TypeError` before any
|
|
3785
|
-
* `
|
|
4297
|
+
* Each `line` must be a positive number ending in `.5`, e.g. `18.5`. More
|
|
4298
|
+
* than `MAX_MARKETS_PER_REQUEST` markets throws `TypeError` before any
|
|
4299
|
+
* request. `dryRun` runs every check and creates nothing. `validate` also
|
|
4300
|
+
* needs the `events` scope.
|
|
3786
4301
|
*/
|
|
3787
4302
|
createMarkets(eventId: string, markets: readonly NewMarket[], opts?: CreateMarketsOptions): Promise<CreateMarketResult[]>;
|
|
3788
4303
|
/** `GET /api/v1/orders`: one page of your orders, newest first. */
|
|
@@ -3796,50 +4311,33 @@ declare class STX {
|
|
|
3796
4311
|
*
|
|
3797
4312
|
* `action` is `"buy"` or `"sell"`; `orderType` is `"limit"` or `"market"`.
|
|
3798
4313
|
* `price` (dollars, required for a limit order) and `quantity` (contracts)
|
|
3799
|
-
* are decimal strings, e.g. `{ price: "0.
|
|
4314
|
+
* are decimal strings, e.g. `{ price: "0.58", quantity: "100" }`. Numbers are
|
|
3800
4315
|
* refused client-side.
|
|
3801
4316
|
*
|
|
3802
4317
|
* The exchange validates the order: a bad price step or a fractional
|
|
3803
4318
|
* quantity throws `STXValidationException` (400) or `STXRejectedException`
|
|
3804
|
-
* (422) with the API's message
|
|
3805
|
-
* `
|
|
4319
|
+
* (422) with the API's message. An order from outside the region is also
|
|
4320
|
+
* an `STXRejectedException`.
|
|
3806
4321
|
*
|
|
3807
4322
|
* A POST is never retried after a 5xx or a dropped connection; pass
|
|
3808
4323
|
* `clientOrderId` so you can look the order up if that happens.
|
|
3809
4324
|
*/
|
|
3810
4325
|
placeOrder(marketId: string, action: string, orderType: string, opts: OrderOptions): Promise<Order>;
|
|
3811
4326
|
/**
|
|
3812
|
-
* `POST /api/v1/orders/batched`: place several orders in one call.
|
|
3813
|
-
*
|
|
3814
|
-
*
|
|
3815
|
-
* others.
|
|
4327
|
+
* `POST /api/v1/orders/batched`: place several orders in one call. Returns
|
|
4328
|
+
* one result per order, in order; a rejected order has `errors` instead of
|
|
4329
|
+
* `order` and does not stop the others.
|
|
3816
4330
|
*/
|
|
3817
|
-
placeOrders(orders: readonly NewOrderInput[]
|
|
4331
|
+
placeOrders(orders: readonly NewOrderInput[]): Promise<BatchOrderResult[]>;
|
|
3818
4332
|
/**
|
|
3819
4333
|
* `DELETE /api/v1/orders/{order_id}`: request a cancel. A cancel is a
|
|
3820
4334
|
* request: a fill already in flight can still land.
|
|
3821
4335
|
*/
|
|
3822
|
-
cancelOrder(orderId: string
|
|
4336
|
+
cancelOrder(orderId: string): Promise<Cancellation>;
|
|
3823
4337
|
/** `DELETE /api/v1/orders/batched`: cancel the named orders. */
|
|
3824
|
-
cancelOrders(orderIds: readonly string[]
|
|
4338
|
+
cancelOrders(orderIds: readonly string[]): Promise<Cancellation[]>;
|
|
3825
4339
|
/** `DELETE /api/v1/orders/all`: cancel everything resting on the account. */
|
|
3826
|
-
cancelAllOrders(
|
|
3827
|
-
/**
|
|
3828
|
-
* Ask the exchange whether this machine may trade right now, without
|
|
3829
|
-
* placing or cancelling anything.
|
|
3830
|
-
*
|
|
3831
|
-
* Sends `DELETE /api/v1/orders/00000000-0000-0000-0000-000000000000` (an
|
|
3832
|
-
* order id that cannot exist) with the geolocation packet, if one is
|
|
3833
|
-
* configured. The exchange runs its geo check before it looks the order
|
|
3834
|
-
* up, so a 404 means the check passed, and a geo 422 means it did not. On
|
|
3835
|
-
* an exchange without geo-fencing it always passes.
|
|
3836
|
-
*
|
|
3837
|
-
* Needs a `read_write` key (the probe is a write route). The exchange
|
|
3838
|
-
* records a failed check in its geolocation log exactly as it would a real
|
|
3839
|
-
* order from the same place, and may raise a compliance alert, so call it
|
|
3840
|
-
* once at start-up, not in a loop.
|
|
3841
|
-
*/
|
|
3842
|
-
geoCheck(opts?: GeoOption): Promise<GeoCheckResult>;
|
|
4340
|
+
cancelAllOrders(): Promise<Cancellation[]>;
|
|
3843
4341
|
/** `GET /api/v1/fills`: one page of your executions. */
|
|
3844
4342
|
fills(query?: FillsQuery): Promise<Page<Fill>>;
|
|
3845
4343
|
/** Every fill matching the filters, following the cursor. */
|
|
@@ -3892,13 +4390,38 @@ declare class STX {
|
|
|
3892
4390
|
iterFees(query?: {
|
|
3893
4391
|
limit?: number;
|
|
3894
4392
|
}): AsyncGenerator<FeeTransaction, void, undefined>;
|
|
3895
|
-
/**
|
|
4393
|
+
/**
|
|
4394
|
+
* `GET /api/v1/portfolio/loyalty`: loyalty entries. Throws
|
|
4395
|
+
* `STXNotAvailableException` (feature `loyalty`) where the exchange has the
|
|
4396
|
+
* loyalty program switched off.
|
|
4397
|
+
*/
|
|
3896
4398
|
loyalty(query?: PageQuery): Promise<Page<Transaction>>;
|
|
3897
|
-
/** Every loyalty entry, following the cursor. */
|
|
4399
|
+
/** Every loyalty entry, following the cursor. Throws like `loyalty()`. */
|
|
3898
4400
|
iterLoyalty(query?: {
|
|
3899
4401
|
limit?: number;
|
|
3900
4402
|
}): AsyncGenerator<Transaction, void, undefined>;
|
|
3901
|
-
/**
|
|
4403
|
+
/**
|
|
4404
|
+
* `GET /api/v1/leaderboard`: ranked members for a period, sport and metric.
|
|
4405
|
+
* Rows carry a public handle and avatar, never an account id. Throws
|
|
4406
|
+
* `STXNotAvailableException` (feature `leaderboard`) where the exchange does
|
|
4407
|
+
* not have the leaderboard.
|
|
4408
|
+
*/
|
|
4409
|
+
leaderboard(query?: LeaderboardQuery): Promise<Leaderboard>;
|
|
4410
|
+
/** `GET /api/v1/leaderboard/me`: your own standing, including your rank outside the list. */
|
|
4411
|
+
leaderboardMe(query?: Pick<LeaderboardQuery, "period" | "category">): Promise<LeaderboardStanding>;
|
|
4412
|
+
/**
|
|
4413
|
+
* `PATCH /api/v1/me/profile`: change your public handle, avatar or
|
|
4414
|
+
* leaderboard opt-in. Resolves to the updated `me`.
|
|
4415
|
+
*/
|
|
4416
|
+
updateProfile(update: ProfileUpdate): Promise<Me>;
|
|
4417
|
+
/**
|
|
4418
|
+
* `POST /api/v1/tnc/accept`: accept the current terms for your own account,
|
|
4419
|
+
* with your own API key. Resolves to the server's message.
|
|
4420
|
+
*
|
|
4421
|
+
* An app cannot accept the terms for a member: called with a member's OAuth
|
|
4422
|
+
* access token, the exchange answers 403 `terms_not_delegable`
|
|
4423
|
+
* (`STXForbiddenException`). The member accepts on an STX page instead.
|
|
4424
|
+
*/
|
|
3902
4425
|
acceptTerms(deviceId: string, opts?: AcceptTermsOptions): Promise<string>;
|
|
3903
4426
|
/**
|
|
3904
4427
|
* An `STXWebSocket` using this client's host and key. Account channels
|
|
@@ -3907,4 +4430,4 @@ declare class STX {
|
|
|
3907
4430
|
websocket(opts?: Omit<STXWebSocketOptions, "rest">): STXWebSocket;
|
|
3908
4431
|
}
|
|
3909
4432
|
|
|
3910
|
-
export { type
|
|
4433
|
+
export { type EventPlayers as $, type AcceptTermsOptions as A, type Balance as B, type Cancellation as C, ComboPlayer as D, type ComboPlayerEvent as E, type ComboQuoteAcceptedEvent as F, type ComboQuoteClosedEvent as G, type ComboQuoteClosedReason as H, type ComboQuoteReply as I, type ComboRefusalReason as J, type ComboRequestClosedEvent as K, type ComboRequestClosedReason as L, type ComboRequestReply as M, type ComboRfqClosedEvent as N, type ComboRfqClosedReason as O, type ComboRfqLeg as P, type ComboRfqOpenedEvent as Q, type ComboSnapshot as R, type ComboWithdrawReply as S, type CreatableMarketType as T, type CreateMarketResult as U, type CreateMarketsOptions as V, Environment as W, Environments as X, type Error$1 as Y, type Event as Z, type EventPlayer as _, type AccountChange as a, STXAuthenticationException as a$, type EventStat as a0, type EventTeam as a1, type EventsQuery as a2, FEATURES as a3, type Feature as a4, type FeatureMap as a5, type FeeTransaction as a6, type FetchLike as a7, type Fill as a8, type FillsQuery as a9, type NewMarketInput as aA, type NewOrder as aB, type NewOrderInput as aC, OPERATIONS as aD, type Operation as aE, type OperationId as aF, type Order as aG, type OrderOptions as aH, type OrdersQuery as aI, Page as aJ, type PageQuery as aK, type PaymentTransaction as aL, type PlayerStatLineMarket as aM, type Position as aN, type PrivateKeyInput as aO, type ProfileUpdate as aP, type RecentTrade as aQ, ReconnectPolicy as aR, type ReconnectPolicyOptions as aS, Region as aT, type ResponseEvent as aU, RetryPolicy as aV, type RetryPolicyOptions as aW, SIGNATURE_HEADER as aX, SNAPSHOT_EVENTS as aY, STX as aZ, STXAPIException as a_, HOSTS as aa, KEY_HEADER as ab, type KnownStat as ac, type Leaderboard as ad, type LeaderboardEntry as ae, type LeaderboardQuery as af, type LeaderboardStanding as ag, type ListedMarketType as ah, type Logger as ai, MAX_MARKETS_PER_REQUEST as aj, type Market as ak, type MarketFilter as al, type MarketRejectionReason as am, type MarketRequestEcho as an, type MarketRule as ao, type MarketStat as ap, type MarketStatsQuery as aq, type MarketType as ar, type MarketTypeEventType as as, type MarketTypeField as at, type MarketTypes as au, type MarketsQuery as av, type Me as aw, type MessageHandler as ax, NO_RETRY as ay, type NewMarket as az, type AccountChangeKind as b, STXChannelException as b0, STXComboPriceMovedException as b1, STXComboRefusedException as b2, STXCombosUnavailableException as b3, STXConfigException as b4, type STXEnvironment as b5, STXException as b6, STXForbiddenException as b7, STXIPNotAllowedException as b8, STXInsufficientScopeException as b9, baseUrlFor as bA, buildMessage as bB, environmentNamed as bC, errorForStatus as bD, handshakePath as bE, isValidLine as bF, loadPrivateKey as bG, models as bH, notAvailableMessage as bI, orderBody as bJ, requestPath as bK, resolveHost as bL, signerFromPrivateKey as bM, socketUrlFor as bN, STXInvalidTokenException as ba, STXNotAvailableException as bb, STXNotFoundException as bc, type STXOptions as bd, STXRateLimitException as be, STXRejectedException as bf, STXServerException as bg, STXTermsRequiredException as bh, STXTimeoutException as bi, STXTransportException as bj, STXValidationException as bk, STXWebSocket as bl, type STXWebSocketOptions as bm, type Settlement as bn, type SettlementsQuery as bo, type Signer as bp, type Stat as bq, type StatDetail as br, Stats as bs, type StrList as bt, TERMINAL_ORDER_STATUSES as bu, TIMESTAMP_HEADER as bv, type Transaction as bw, USER_AGENT as bx, VERSION as by, type WebSocketAuthContext as bz, type AccountState as c, AccountView as d, type AccountViewOptions as e, ApiKeyCredentials as f, type AuthProvider as g, type AuthRequest as h, type BatchOrderResult as i, type BookLevel as j, Capabilities as k, Channel as l, ChannelMessage as m, type ComboBestQuote as n, type ComboBestQuoteEvent as o, type ComboCancelReply as p, type ComboCashOutReply as q, type ComboJoinOptions as r, type ComboJoinReply as s, type ComboLeg as t, ComboMaker as u, type ComboMakerEvent as v, type ComboMakerPlacedEvent as w, type ComboOutcome as x, type ComboPlacedEvent as y, type ComboPlacement as z };
|