@stxapp/stx-typescript 0.7.0 → 0.9.0-alpha.1
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 +29 -0
- package/README.md +42 -0
- package/dist/{chunk-ASOLCDBG.cjs → chunk-33AQCUGM.cjs} +245 -6
- package/dist/chunk-33AQCUGM.cjs.map +1 -0
- package/dist/{chunk-CDXZOW53.js → chunk-4CSBA2YV.js} +244 -5
- package/dist/chunk-4CSBA2YV.js.map +1 -0
- package/dist/{client-CA1d-osT.d.cts → client-CNkaTuhG.d.cts} +665 -110
- package/dist/{client-CA1d-osT.d.ts → client-CNkaTuhG.d.ts} +665 -110
- package/dist/index.cjs +8 -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 +7 -1
- package/dist/oauth.cjs +378 -41
- package/dist/oauth.cjs.map +1 -1
- package/dist/oauth.d.cts +162 -13
- package/dist/oauth.d.ts +162 -13
- package/dist/oauth.js +353 -16
- package/dist/oauth.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-ASOLCDBG.cjs.map +0 -1
- package/dist/chunk-CDXZOW53.js.map +0 -1
|
@@ -140,13 +140,239 @@ interface GeoCheckResult {
|
|
|
140
140
|
sentPacket: boolean;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Player stats by sport, as the exchange names them. Use these for
|
|
145
|
+
* autocomplete; the stats a given event accepts are the ones
|
|
146
|
+
* `STX.statsFor()` returns for it.
|
|
147
|
+
*/
|
|
148
|
+
declare const Stats: {
|
|
149
|
+
readonly Baseball: {
|
|
150
|
+
readonly BASES: "BASES";
|
|
151
|
+
readonly BK: "BK";
|
|
152
|
+
readonly DOUBLES: "DOUBLES";
|
|
153
|
+
readonly HITS: "HITS";
|
|
154
|
+
readonly HIT_RUN_RBI: "HIT_RUN_RBI";
|
|
155
|
+
readonly HOMERUN: "HOMERUN";
|
|
156
|
+
readonly PERA: "PERA";
|
|
157
|
+
readonly PHITA: "PHITA";
|
|
158
|
+
readonly PK: "PK";
|
|
159
|
+
readonly POUTS: "POUTS";
|
|
160
|
+
readonly PRUNSALOWED: "PRUNSALOWED";
|
|
161
|
+
readonly PWALKSA: "PWALKSA";
|
|
162
|
+
readonly RBI: "RBI";
|
|
163
|
+
readonly RUNS: "RUNS";
|
|
164
|
+
readonly SINGLES: "SINGLES";
|
|
165
|
+
readonly STOLENBASES: "STOLENBASES";
|
|
166
|
+
readonly TRIPLES: "TRIPLES";
|
|
167
|
+
readonly WALKS: "WALKS";
|
|
168
|
+
};
|
|
169
|
+
readonly Basketball: {
|
|
170
|
+
readonly ASSISTS: "ASSISTS";
|
|
171
|
+
readonly BLOCKS: "BLOCKS";
|
|
172
|
+
readonly POINTS: "POINTS";
|
|
173
|
+
readonly POINTS_ASSISTS: "POINTS_ASSISTS";
|
|
174
|
+
readonly POINTS_REBOUNDS: "POINTS_REBOUNDS";
|
|
175
|
+
readonly POINTS_REBOUNDS_ASSISTS: "POINTS_REBOUNDS_ASSISTS";
|
|
176
|
+
readonly REBOUNDS: "REBOUNDS";
|
|
177
|
+
readonly REBOUNDS_ASSISTS: "REBOUNDS_ASSISTS";
|
|
178
|
+
readonly STEALS: "STEALS";
|
|
179
|
+
readonly STEALS_BLOCKS: "STEALS_BLOCKS";
|
|
180
|
+
readonly THREE_POINTS: "THREE_POINTS";
|
|
181
|
+
readonly TURNOVERS: "TURNOVERS";
|
|
182
|
+
};
|
|
183
|
+
readonly Football: {
|
|
184
|
+
readonly DEF_INTERCEPT: "DEF_INTERCEPT";
|
|
185
|
+
readonly DEF_TD: "DEF_TD";
|
|
186
|
+
readonly FG_MADE: "FG_MADE";
|
|
187
|
+
readonly INTERCEPT: "INTERCEPT";
|
|
188
|
+
readonly PASS_ATT: "PASS_ATT";
|
|
189
|
+
readonly PASS_CMP: "PASS_CMP";
|
|
190
|
+
readonly PASS_RUSH_YDS: "PASS_RUSH_YDS";
|
|
191
|
+
readonly PASS_SACKS: "PASS_SACKS";
|
|
192
|
+
readonly PASS_TD: "PASS_TD";
|
|
193
|
+
readonly PASS_YDS: "PASS_YDS";
|
|
194
|
+
readonly REC: "REC";
|
|
195
|
+
readonly RECV_LONG: "RECV_LONG";
|
|
196
|
+
readonly RECV_TD: "RECV_TD";
|
|
197
|
+
readonly RECV_YDS: "RECV_YDS";
|
|
198
|
+
readonly RUSH_ATT: "RUSH_ATT";
|
|
199
|
+
readonly RUSH_LONG: "RUSH_LONG";
|
|
200
|
+
readonly RUSH_REC_YDS: "RUSH_REC_YDS";
|
|
201
|
+
readonly RUSH_TD: "RUSH_TD";
|
|
202
|
+
readonly RUSH_YDS: "RUSH_YDS";
|
|
203
|
+
readonly SACKS: "SACKS";
|
|
204
|
+
readonly TACKLES_ASSIST: "TACKLES_ASSIST";
|
|
205
|
+
readonly TACKLES_SOLO: "TACKLES_SOLO";
|
|
206
|
+
readonly TACKLES_TOTAL: "TACKLES_TOTAL";
|
|
207
|
+
readonly TD_SCORE: "TD_SCORE";
|
|
208
|
+
};
|
|
209
|
+
readonly Hockey: {
|
|
210
|
+
readonly ASSISTS: "ASSISTS";
|
|
211
|
+
readonly GOALS: "GOALS";
|
|
212
|
+
readonly GOAL_AG: "GOAL_AG";
|
|
213
|
+
readonly GOAL_SO: "GOAL_SO";
|
|
214
|
+
readonly POINTS: "POINTS";
|
|
215
|
+
readonly SAVES: "SAVES";
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
type StatValues<T> = T extends Record<string, infer V> ? V : never;
|
|
219
|
+
/** A stat named in `Stats`. */
|
|
220
|
+
type KnownStat = StatValues<(typeof Stats)[keyof typeof Stats]>;
|
|
221
|
+
/** A stat key. Autocompletes the known ones and still takes a stat added later. */
|
|
222
|
+
type Stat = KnownStat | (string & {});
|
|
223
|
+
/** One player on an event's roster. */
|
|
224
|
+
interface EventPlayer {
|
|
225
|
+
/** Send this back as `playerId` when creating a market. */
|
|
226
|
+
player_id: string;
|
|
227
|
+
name: string;
|
|
228
|
+
jersey?: string | null;
|
|
229
|
+
position?: string | null;
|
|
230
|
+
[key: string]: unknown;
|
|
231
|
+
}
|
|
232
|
+
/** One team's roster, sorted by player name. */
|
|
233
|
+
interface EventTeam {
|
|
234
|
+
team: string;
|
|
235
|
+
players: EventPlayer[];
|
|
236
|
+
[key: string]: unknown;
|
|
237
|
+
}
|
|
238
|
+
/** A stat a market on the event can be created on. */
|
|
239
|
+
interface EventStat {
|
|
240
|
+
/** The key to send, e.g. `"POINTS"`. */
|
|
241
|
+
stat: Stat;
|
|
242
|
+
/** Display name, e.g. `"Points"`. */
|
|
243
|
+
name: string;
|
|
244
|
+
[key: string]: unknown;
|
|
245
|
+
}
|
|
246
|
+
/** `GET /api/v1/events/{event_id}/players`. */
|
|
247
|
+
interface EventPlayers {
|
|
248
|
+
event_id: string;
|
|
249
|
+
/** Empty until the teams' rosters are published. */
|
|
250
|
+
teams: EventTeam[];
|
|
251
|
+
/** The stats this event accepts. */
|
|
252
|
+
stats: EventStat[];
|
|
253
|
+
[key: string]: unknown;
|
|
254
|
+
}
|
|
255
|
+
/** One stat an event type offers, in `STX.marketTypes()`. */
|
|
256
|
+
interface MarketTypeEventType {
|
|
257
|
+
/** The sport, e.g. `"Football"`. */
|
|
258
|
+
sport: string;
|
|
259
|
+
/** The stats on offer, sorted by `stat`. */
|
|
260
|
+
stats: EventStat[];
|
|
261
|
+
[key: string]: unknown;
|
|
262
|
+
}
|
|
263
|
+
/** One field a market entry takes besides `rule`. */
|
|
264
|
+
interface MarketTypeField {
|
|
265
|
+
/** Its JSON type, e.g. `"string"`. */
|
|
266
|
+
type: string;
|
|
267
|
+
/** What it takes. */
|
|
268
|
+
description: string;
|
|
269
|
+
[key: string]: unknown;
|
|
270
|
+
}
|
|
271
|
+
/** A market type `STX.createMarkets()` can create. */
|
|
272
|
+
interface CreatableMarketType {
|
|
273
|
+
partner_create: true;
|
|
274
|
+
/** The fields an entry takes besides `rule`, by wire name. */
|
|
275
|
+
fields: Record<string, MarketTypeField>;
|
|
276
|
+
/** The event types it runs on, keyed by event type, e.g. `"NFL"`. */
|
|
277
|
+
event_types: Record<string, MarketTypeEventType>;
|
|
278
|
+
[key: string]: unknown;
|
|
279
|
+
}
|
|
280
|
+
/** A market type STX lists but an app cannot create. */
|
|
281
|
+
interface ListedMarketType {
|
|
282
|
+
partner_create: false;
|
|
283
|
+
/** The event types it runs on. */
|
|
284
|
+
event_types: string[];
|
|
285
|
+
[key: string]: unknown;
|
|
286
|
+
}
|
|
287
|
+
/** One market type. `partner_create` says whether `STX.createMarkets()` takes it. */
|
|
288
|
+
type MarketType = CreatableMarketType | ListedMarketType;
|
|
289
|
+
/** `GET /api/v1/types`: the market types, keyed by rule. */
|
|
290
|
+
type MarketTypes = {
|
|
291
|
+
player_stat_line: CreatableMarketType;
|
|
292
|
+
} & {
|
|
293
|
+
[rule: string]: MarketType;
|
|
294
|
+
};
|
|
295
|
+
/** A player stat line: over/under one player's stat in one event. */
|
|
296
|
+
interface PlayerStatLineMarket {
|
|
297
|
+
rule: "player_stat_line";
|
|
298
|
+
/** From `eventPlayers()`. */
|
|
299
|
+
playerId: string;
|
|
300
|
+
/** One of the event's stats, e.g. `Stats.Basketball.POINTS`. */
|
|
301
|
+
stat: Stat;
|
|
302
|
+
/**
|
|
303
|
+
* The line. A positive number ending in `.5`, e.g. `18.5`. Whole numbers
|
|
304
|
+
* (`18`), quarter lines (`18.25`), zero, negatives and strings (`"18.5"`)
|
|
305
|
+
* are rejected with `invalid_line`.
|
|
306
|
+
*/
|
|
307
|
+
line: number;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* One market to create. `rule` names the market type and decides the other
|
|
311
|
+
* fields; `STX.marketTypes()` lists the rules an app can create. Player stat
|
|
312
|
+
* lines are the only one today.
|
|
313
|
+
*/
|
|
314
|
+
type NewMarket = PlayerStatLineMarket;
|
|
315
|
+
/** A rule `STX.createMarkets()` takes. */
|
|
316
|
+
type MarketRule = NewMarket["rule"];
|
|
317
|
+
/** Why a market was not created. */
|
|
318
|
+
type MarketRejectionReason = "invalid_market" | "unsupported_rule" | "unsupported_stat" | "invalid_line" | "unknown_player" | "event_not_open" | "not_created" | (string & {});
|
|
319
|
+
/**
|
|
320
|
+
* The outcome for one requested market. `index` is the market's position in
|
|
321
|
+
* the list given to `createMarkets()`.
|
|
322
|
+
*/
|
|
323
|
+
type CreateMarketResult = {
|
|
324
|
+
index: number;
|
|
325
|
+
status: "created";
|
|
326
|
+
market_id: string;
|
|
327
|
+
reason: null;
|
|
328
|
+
[key: string]: unknown;
|
|
329
|
+
} | {
|
|
330
|
+
index: number;
|
|
331
|
+
status: "exists";
|
|
332
|
+
market_id: string;
|
|
333
|
+
reason: null;
|
|
334
|
+
[key: string]: unknown;
|
|
335
|
+
} | {
|
|
336
|
+
index: number;
|
|
337
|
+
status: "valid";
|
|
338
|
+
market_id: null;
|
|
339
|
+
reason: null;
|
|
340
|
+
[key: string]: unknown;
|
|
341
|
+
} | {
|
|
342
|
+
index: number;
|
|
343
|
+
status: "rejected";
|
|
344
|
+
market_id: null;
|
|
345
|
+
reason: MarketRejectionReason;
|
|
346
|
+
[key: string]: unknown;
|
|
347
|
+
};
|
|
348
|
+
/** Options for `STX.createMarkets()`. */
|
|
349
|
+
interface CreateMarketsOptions {
|
|
350
|
+
/**
|
|
351
|
+
* Run every check and create nothing. A market that would be created comes
|
|
352
|
+
* back `valid`; one that is already listed comes back `exists`.
|
|
353
|
+
*/
|
|
354
|
+
dryRun?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Check each player stat line against the event's players and stats, and
|
|
357
|
+
* the line rule, before sending. Failing markets come back `rejected`
|
|
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.
|
|
361
|
+
*/
|
|
362
|
+
validate?: boolean;
|
|
363
|
+
}
|
|
364
|
+
/** The most markets one `createMarkets()` call takes. */
|
|
365
|
+
declare const MAX_MARKETS_PER_REQUEST = 25;
|
|
366
|
+
/** Whether `line` is a valid line: positive and ending in `.5`. */
|
|
367
|
+
declare function isValidLine(line: unknown): boolean;
|
|
368
|
+
|
|
143
369
|
/**
|
|
144
370
|
* One account's balance and fee summary, in the dollar wire format.
|
|
145
371
|
*/
|
|
146
372
|
interface Balance {
|
|
147
373
|
/**
|
|
148
|
-
* The account's cash balance. Unaffected by placing an order
|
|
149
|
-
* may be available. In dollars. Money as a decimal string, as sent by the
|
|
374
|
+
* The account's cash balance. Unaffected by placing an order, but not all of
|
|
375
|
+
* it may be available. In dollars. Money as a decimal string, as sent by the
|
|
150
376
|
* API.
|
|
151
377
|
*/
|
|
152
378
|
account_balance?: string | null;
|
|
@@ -283,8 +509,8 @@ interface Cancellation {
|
|
|
283
509
|
*/
|
|
284
510
|
order_id?: string | null;
|
|
285
511
|
/**
|
|
286
|
-
* The order status after cancelling, or a reason it was not cancelled
|
|
287
|
-
* "Order not found" for an unknown id.
|
|
512
|
+
* The order status after cancelling, or a reason it was not cancelled, such
|
|
513
|
+
* as "Order not found" for an unknown id.
|
|
288
514
|
*/
|
|
289
515
|
status?: string | null;
|
|
290
516
|
/** Fields the server added after this SDK was generated. */
|
|
@@ -307,7 +533,7 @@ interface Error$1 {
|
|
|
307
533
|
*/
|
|
308
534
|
interface Event {
|
|
309
535
|
/**
|
|
310
|
-
*
|
|
536
|
+
* Whether this event is archived.
|
|
311
537
|
*/
|
|
312
538
|
archived?: boolean | null;
|
|
313
539
|
/**
|
|
@@ -319,15 +545,16 @@ interface Event {
|
|
|
319
545
|
*/
|
|
320
546
|
event_id?: string | null;
|
|
321
547
|
/**
|
|
322
|
-
* The
|
|
548
|
+
* The type of this event, e.g. `ad_hoc`, `baseball_game`, `basketball_game`.
|
|
323
549
|
*/
|
|
324
550
|
event_type?: string | null;
|
|
325
551
|
/**
|
|
326
|
-
* The
|
|
552
|
+
* The event's participants, as an array of `{name, role, short_name,
|
|
553
|
+
* abbreviation}`.
|
|
327
554
|
*/
|
|
328
555
|
participants?: Array<Record<string, unknown>> | null;
|
|
329
556
|
/**
|
|
330
|
-
*
|
|
557
|
+
* Whether this event is promoted.
|
|
331
558
|
*/
|
|
332
559
|
promoted?: boolean | null;
|
|
333
560
|
/**
|
|
@@ -412,7 +639,7 @@ interface FeeTransaction {
|
|
|
412
639
|
*/
|
|
413
640
|
time?: string | null;
|
|
414
641
|
/**
|
|
415
|
-
* What moved the money or the points
|
|
642
|
+
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
416
643
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
417
644
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
418
645
|
* `fee_refund`, `casino`, `adjustment`, `loyalty`, `loyalty_points_rollup`,
|
|
@@ -435,13 +662,13 @@ interface Fill {
|
|
|
435
662
|
*/
|
|
436
663
|
action?: string | null;
|
|
437
664
|
/**
|
|
438
|
-
* Internal. Operator audit trail, not part of the supported contract
|
|
665
|
+
* Internal. Operator audit trail, not part of the supported contract; do not
|
|
439
666
|
* depend on it.
|
|
440
667
|
*/
|
|
441
668
|
admin_log?: Record<string, unknown> | null;
|
|
442
669
|
/**
|
|
443
|
-
* True if
|
|
444
|
-
* `
|
|
670
|
+
* True if STX has amended this trade. When true, compare `original_price` and
|
|
671
|
+
* `original_filled` against the current values.
|
|
445
672
|
*/
|
|
446
673
|
amended?: boolean | null;
|
|
447
674
|
/**
|
|
@@ -460,7 +687,7 @@ interface Fill {
|
|
|
460
687
|
*/
|
|
461
688
|
closed_fee?: string | null;
|
|
462
689
|
/**
|
|
463
|
-
*
|
|
690
|
+
* Realized profit or loss on the closed portion. Negative for a loss. In
|
|
464
691
|
* dollars. Money as a decimal string, as sent by the API.
|
|
465
692
|
*/
|
|
466
693
|
closed_net_pnl?: string | null;
|
|
@@ -475,7 +702,7 @@ interface Fill {
|
|
|
475
702
|
*/
|
|
476
703
|
closing?: string | null;
|
|
477
704
|
/**
|
|
478
|
-
* The
|
|
705
|
+
* The device associated with this trade.
|
|
479
706
|
*/
|
|
480
707
|
device_id?: string | null;
|
|
481
708
|
/**
|
|
@@ -489,13 +716,13 @@ interface Fill {
|
|
|
489
716
|
*/
|
|
490
717
|
expired_fee?: string | null;
|
|
491
718
|
/**
|
|
492
|
-
*
|
|
719
|
+
* Realized profit or loss on the expired portion. In dollars. Money as a
|
|
493
720
|
* decimal string, as sent by the API.
|
|
494
721
|
*/
|
|
495
722
|
expired_net_pnl?: string | null;
|
|
496
723
|
/**
|
|
497
|
-
* The profit or loss
|
|
498
|
-
*
|
|
724
|
+
* The profit or loss on the trade when the market expired. In dollars. Money
|
|
725
|
+
* as a decimal string, as sent by the API.
|
|
499
726
|
*/
|
|
500
727
|
expired_pnl?: string | null;
|
|
501
728
|
/**
|
|
@@ -521,12 +748,12 @@ interface Fill {
|
|
|
521
748
|
*/
|
|
522
749
|
ip_address?: string | null;
|
|
523
750
|
/**
|
|
524
|
-
* When
|
|
751
|
+
* When STX last amended this trade, as UNIX microseconds. Null unless
|
|
525
752
|
* `amended` is true.
|
|
526
753
|
*/
|
|
527
754
|
last_modified_at?: number | null;
|
|
528
755
|
/**
|
|
529
|
-
* Internal. Operator audit field, not part of the supported contract
|
|
756
|
+
* Internal. Operator audit field, not part of the supported contract; do not
|
|
530
757
|
* depend on it.
|
|
531
758
|
*/
|
|
532
759
|
last_modified_by_admin_id?: string | null;
|
|
@@ -568,7 +795,7 @@ interface Fill {
|
|
|
568
795
|
*/
|
|
569
796
|
original_risk?: string | null;
|
|
570
797
|
/**
|
|
571
|
-
* The original
|
|
798
|
+
* The original gain if the position wins, for the trade excluding `closed`.
|
|
572
799
|
* In dollars. Money as a decimal string, as sent by the API.
|
|
573
800
|
*/
|
|
574
801
|
original_to_win?: string | null;
|
|
@@ -583,8 +810,9 @@ interface Fill {
|
|
|
583
810
|
*/
|
|
584
811
|
pc_risk?: string | null;
|
|
585
812
|
/**
|
|
586
|
-
*
|
|
587
|
-
*
|
|
813
|
+
* What each contract gains if the position wins: `max_price - price` on a
|
|
814
|
+
* buy, `price` on a sell. In dollars. Money as a decimal string, as sent by
|
|
815
|
+
* the API.
|
|
588
816
|
*/
|
|
589
817
|
pc_to_win?: string | null;
|
|
590
818
|
/**
|
|
@@ -625,8 +853,8 @@ interface Fill {
|
|
|
625
853
|
*/
|
|
626
854
|
remaining_risk?: string | null;
|
|
627
855
|
/**
|
|
628
|
-
*
|
|
629
|
-
* string, as sent by the API.
|
|
856
|
+
* What the unsettled contracts gain if the position wins. In dollars. Money
|
|
857
|
+
* as a decimal string, as sent by the API.
|
|
630
858
|
*/
|
|
631
859
|
remaining_to_win?: string | null;
|
|
632
860
|
/**
|
|
@@ -639,14 +867,14 @@ interface Fill {
|
|
|
639
867
|
*/
|
|
640
868
|
settled_contracts?: string | null;
|
|
641
869
|
/**
|
|
642
|
-
* The number of settlements where this
|
|
870
|
+
* The number of settlements where this trade is the opening trade.
|
|
643
871
|
*/
|
|
644
872
|
settlements_count?: number | null;
|
|
645
873
|
/**
|
|
646
874
|
* Fill state. `created` once the matching engine has written the fill, `open`
|
|
647
875
|
* while the position is live, `settled` once it no longer contributes to a
|
|
648
|
-
* position, and `cancelled` if
|
|
649
|
-
* `
|
|
876
|
+
* position, and `cancelled` if STX reversed it. One of: `created`, `open`,
|
|
877
|
+
* `settled`, `cancelled`.
|
|
650
878
|
*/
|
|
651
879
|
status?: string | null;
|
|
652
880
|
/**
|
|
@@ -674,7 +902,7 @@ interface Fill {
|
|
|
674
902
|
traded_contracts?: string | null;
|
|
675
903
|
/**
|
|
676
904
|
* Fee before rounding. Use the rounded fee for reconciliation. In dollars.
|
|
677
|
-
* Carries up to 9 decimal places
|
|
905
|
+
* Carries up to 9 decimal places; parse money with a variable-scale decimal
|
|
678
906
|
* type, not a fixed-width one. Money as a decimal string, as sent by the API.
|
|
679
907
|
*/
|
|
680
908
|
unrounded_trade_fee?: string | null;
|
|
@@ -690,16 +918,162 @@ interface Fill {
|
|
|
690
918
|
/** Fields the server added after this SDK was generated. */
|
|
691
919
|
[key: string]: unknown;
|
|
692
920
|
}
|
|
921
|
+
/**
|
|
922
|
+
* One ranked board.
|
|
923
|
+
*/
|
|
924
|
+
interface Leaderboard {
|
|
925
|
+
/**
|
|
926
|
+
* `all` or a sport key.
|
|
927
|
+
*/
|
|
928
|
+
category?: string | null;
|
|
929
|
+
/**
|
|
930
|
+
* Ranked rows, best first, at most the number of members STX shows per board
|
|
931
|
+
* (never more than 100). Empty for a board STX hides.
|
|
932
|
+
*/
|
|
933
|
+
leaderboard?: LeaderboardEntry[] | null;
|
|
934
|
+
/**
|
|
935
|
+
* The metric the rows are ranked on. One of: `volume`, `profit`,
|
|
936
|
+
* `predictions`, `markets`, `win_rate`, `biggest_win`, `return`, `streak`.
|
|
937
|
+
*/
|
|
938
|
+
metric?: string | null;
|
|
939
|
+
/**
|
|
940
|
+
* When this period's board resets: local midnight in America/New_York on the
|
|
941
|
+
* next boundary, as UTC. `null` for `all`, which never resets, and before the
|
|
942
|
+
* first snapshot.
|
|
943
|
+
*/
|
|
944
|
+
next_reset_at?: string | null;
|
|
945
|
+
/**
|
|
946
|
+
* The period the board covers. One of: `daily`, `weekly`, `monthly`,
|
|
947
|
+
* `yearly`, `all`.
|
|
948
|
+
*/
|
|
949
|
+
period?: string | null;
|
|
950
|
+
/**
|
|
951
|
+
* When this snapshot was built. `null` before the first snapshot is
|
|
952
|
+
* published.
|
|
953
|
+
*/
|
|
954
|
+
refreshed_at?: string | null;
|
|
955
|
+
/**
|
|
956
|
+
* Whether STX shows this board to members. `false` means the board is hidden
|
|
957
|
+
* and `leaderboard` is empty, not that nobody has ranked yet.
|
|
958
|
+
*/
|
|
959
|
+
shown?: boolean | null;
|
|
960
|
+
/** Fields the server added after this SDK was generated. */
|
|
961
|
+
[key: string]: unknown;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* One ranked member.
|
|
965
|
+
*/
|
|
966
|
+
interface LeaderboardEntry {
|
|
967
|
+
/**
|
|
968
|
+
* Path of the member's avatar, `/avatars/{handle}.svg`, relative to the API
|
|
969
|
+
* host. `null` when `handle` is `null`.
|
|
970
|
+
*/
|
|
971
|
+
avatar_url?: string | null;
|
|
972
|
+
/**
|
|
973
|
+
* The member's public handle. `null` for a member who has not set one.
|
|
974
|
+
*/
|
|
975
|
+
handle?: string | null;
|
|
976
|
+
/**
|
|
977
|
+
* Dense rank, 1-based. Tied values share a rank.
|
|
978
|
+
*/
|
|
979
|
+
rank?: number | null;
|
|
980
|
+
/**
|
|
981
|
+
* The sport the member traded most in the period, as a category key. On a
|
|
982
|
+
* sport board it is that sport. `null` when unknown.
|
|
983
|
+
*/
|
|
984
|
+
top_sport?: string | null;
|
|
985
|
+
/**
|
|
986
|
+
* Path of the sport's icon, the same category icon the apps use, relative to
|
|
987
|
+
* the API host. `null` when `top_sport` is `null`.
|
|
988
|
+
*/
|
|
989
|
+
top_sport_icon_url?: string | null;
|
|
990
|
+
/**
|
|
991
|
+
* The ranked value. A dollar string on money boards, an integer on count
|
|
992
|
+
* boards and a number from 0 to 1 on ratio boards.
|
|
993
|
+
*/
|
|
994
|
+
value?: unknown | null;
|
|
995
|
+
/** Fields the server added after this SDK was generated. */
|
|
996
|
+
[key: string]: unknown;
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Your standing in one period and category.
|
|
1000
|
+
*/
|
|
1001
|
+
interface LeaderboardStanding {
|
|
1002
|
+
/**
|
|
1003
|
+
* Your rank and biggest single-market win; `null` when unranked or the board
|
|
1004
|
+
* is hidden.
|
|
1005
|
+
*/
|
|
1006
|
+
biggest_win?: Record<string, unknown> | null;
|
|
1007
|
+
/**
|
|
1008
|
+
* The category asked for.
|
|
1009
|
+
*/
|
|
1010
|
+
category?: string | null;
|
|
1011
|
+
/**
|
|
1012
|
+
* Your rank and markets settled; `null` when unranked or the board is hidden.
|
|
1013
|
+
*/
|
|
1014
|
+
markets?: Record<string, unknown> | null;
|
|
1015
|
+
/**
|
|
1016
|
+
* Whether you appear on public boards. `false` is why every rank is `null`
|
|
1017
|
+
* for an opted-out member.
|
|
1018
|
+
*/
|
|
1019
|
+
opted_in?: boolean | null;
|
|
1020
|
+
/**
|
|
1021
|
+
* The period asked for. One of: `daily`, `weekly`, `monthly`, `yearly`,
|
|
1022
|
+
* `all`.
|
|
1023
|
+
*/
|
|
1024
|
+
period?: string | null;
|
|
1025
|
+
/**
|
|
1026
|
+
* Your rank and contracts settled; `null` when unranked or the board is
|
|
1027
|
+
* hidden.
|
|
1028
|
+
*/
|
|
1029
|
+
predictions?: Record<string, unknown> | null;
|
|
1030
|
+
/**
|
|
1031
|
+
* Your rank and net profit; `null` when unranked or the board is hidden.
|
|
1032
|
+
*/
|
|
1033
|
+
profit?: Record<string, unknown> | null;
|
|
1034
|
+
/**
|
|
1035
|
+
* Your rank and return (profit ÷ volume), `0.0`-`1.0`; needs $500 of volume;
|
|
1036
|
+
* `null` when unranked or the board is hidden.
|
|
1037
|
+
*/
|
|
1038
|
+
return?: Record<string, unknown> | null;
|
|
1039
|
+
/**
|
|
1040
|
+
* Markets decided (won or lost) in the period. `0` when unranked.
|
|
1041
|
+
*/
|
|
1042
|
+
settled_markets?: number | null;
|
|
1043
|
+
/**
|
|
1044
|
+
* Your rank and longest winning streak; `null` when unranked or the board is
|
|
1045
|
+
* hidden.
|
|
1046
|
+
*/
|
|
1047
|
+
streak?: Record<string, unknown> | null;
|
|
1048
|
+
/**
|
|
1049
|
+
* Your rank and notional traded; `null` when unranked or the board is hidden.
|
|
1050
|
+
*/
|
|
1051
|
+
volume?: Record<string, unknown> | null;
|
|
1052
|
+
/**
|
|
1053
|
+
* Share of decided markets you won, `0.0`-`1.0`. `null` until at least 10
|
|
1054
|
+
* markets have been decided in the period; a market settled at zero profit is
|
|
1055
|
+
* neither a win nor a loss.
|
|
1056
|
+
*/
|
|
1057
|
+
win_rate?: number | null;
|
|
1058
|
+
/**
|
|
1059
|
+
* Your rank and win rate, `0.0`-`1.0`; needs 10 decided markets to rank;
|
|
1060
|
+
* `null` when unranked or the board is hidden.
|
|
1061
|
+
*/
|
|
1062
|
+
win_rate_rank?: Record<string, unknown> | null;
|
|
1063
|
+
/** Fields the server added after this SDK was generated. */
|
|
1064
|
+
[key: string]: unknown;
|
|
1065
|
+
}
|
|
693
1066
|
/**
|
|
694
1067
|
* A market you can trade, with its book and event context.
|
|
695
1068
|
*/
|
|
696
1069
|
interface Market {
|
|
697
1070
|
/**
|
|
698
|
-
*
|
|
1071
|
+
* Whether the market is archived.
|
|
699
1072
|
*/
|
|
700
1073
|
archived?: boolean | null;
|
|
701
1074
|
/**
|
|
702
|
-
* The
|
|
1075
|
+
* The top bids on the market, sorted by price descending, so the best
|
|
1076
|
+
* (highest) bid is first.
|
|
703
1077
|
*/
|
|
704
1078
|
bids?: BookLevel[] | null;
|
|
705
1079
|
/**
|
|
@@ -735,15 +1109,15 @@ interface Market {
|
|
|
735
1109
|
*/
|
|
736
1110
|
event_type?: string | null;
|
|
737
1111
|
/**
|
|
738
|
-
*
|
|
1112
|
+
* Whether the market is featured.
|
|
739
1113
|
*/
|
|
740
1114
|
featured?: boolean | null;
|
|
741
1115
|
/**
|
|
742
|
-
*
|
|
1116
|
+
* Whether the market is featured on the home page.
|
|
743
1117
|
*/
|
|
744
1118
|
featured_home?: boolean | null;
|
|
745
1119
|
/**
|
|
746
|
-
* The
|
|
1120
|
+
* The categorizations under which the market appears. A list, not an object.
|
|
747
1121
|
*/
|
|
748
1122
|
filters?: MarketFilter[] | null;
|
|
749
1123
|
/**
|
|
@@ -752,7 +1126,7 @@ interface Market {
|
|
|
752
1126
|
group_title?: string | null;
|
|
753
1127
|
/**
|
|
754
1128
|
* Identity of the set of mutually exclusive outcomes this market prices
|
|
755
|
-
* against
|
|
1129
|
+
* against: the 30 World Series contracts, the 4 AFC East contracts, one
|
|
756
1130
|
* fixture's moneyline pair. Opaque: compare for equality, never parse. Stable
|
|
757
1131
|
* for the life of the market, and present in every status, so it is the field
|
|
758
1132
|
* to map market data on. Unlike `symbol`, it does not move when a fixture is
|
|
@@ -761,12 +1135,12 @@ interface Market {
|
|
|
761
1135
|
grouping_id?: string | null;
|
|
762
1136
|
/**
|
|
763
1137
|
* The grouping in words, e.g. `AL East Division`, `Spread - 1st Quarter`.
|
|
764
|
-
* Descriptive rather than stable
|
|
1138
|
+
* Descriptive rather than stable: for a tournament it is the event title,
|
|
765
1139
|
* which can be renamed. Display it; join on `grouping_id`.
|
|
766
1140
|
*/
|
|
767
1141
|
grouping_name?: string | null;
|
|
768
1142
|
/**
|
|
769
|
-
* The category in which the market appears: `Upcoming`, `Live` or `
|
|
1143
|
+
* The category in which the market appears: `Upcoming`, `Live` or `null`.
|
|
770
1144
|
*/
|
|
771
1145
|
home_category?: string | null;
|
|
772
1146
|
/**
|
|
@@ -789,7 +1163,7 @@ interface Market {
|
|
|
789
1163
|
last_traded_price?: string | null;
|
|
790
1164
|
/**
|
|
791
1165
|
* `true` when the probability was set by hand, `false` when it came from the
|
|
792
|
-
*
|
|
1166
|
+
* pricing feed. A flag, not a probability figure.
|
|
793
1167
|
*/
|
|
794
1168
|
manual_probability?: boolean | null;
|
|
795
1169
|
/**
|
|
@@ -797,13 +1171,14 @@ interface Market {
|
|
|
797
1171
|
*/
|
|
798
1172
|
market_id?: string | null;
|
|
799
1173
|
/**
|
|
800
|
-
* The
|
|
801
|
-
*
|
|
1174
|
+
* The settlement value of one winning contract, and the ceiling on order
|
|
1175
|
+
* prices: an order must price strictly below it. Read it per market. In
|
|
802
1176
|
* dollars. Money as a decimal string, as sent by the API.
|
|
803
1177
|
*/
|
|
804
1178
|
max_price?: string | null;
|
|
805
1179
|
/**
|
|
806
|
-
* The
|
|
1180
|
+
* The top offers on the market, sorted by price descending, so the best
|
|
1181
|
+
* (lowest) offer is last.
|
|
807
1182
|
*/
|
|
808
1183
|
offers?: BookLevel[] | null;
|
|
809
1184
|
/**
|
|
@@ -812,7 +1187,7 @@ interface Market {
|
|
|
812
1187
|
*/
|
|
813
1188
|
open_interest?: string | null;
|
|
814
1189
|
/**
|
|
815
|
-
* The
|
|
1190
|
+
* The participants of the market's event, as an array.
|
|
816
1191
|
*/
|
|
817
1192
|
participants?: Array<Record<string, unknown>> | null;
|
|
818
1193
|
/**
|
|
@@ -825,7 +1200,7 @@ interface Market {
|
|
|
825
1200
|
*/
|
|
826
1201
|
position?: string | null;
|
|
827
1202
|
/**
|
|
828
|
-
*
|
|
1203
|
+
* The provider used to result this market.
|
|
829
1204
|
*/
|
|
830
1205
|
powered_by?: Record<string, unknown> | null;
|
|
831
1206
|
/**
|
|
@@ -834,12 +1209,12 @@ interface Market {
|
|
|
834
1209
|
*/
|
|
835
1210
|
price?: string | null;
|
|
836
1211
|
/**
|
|
837
|
-
* The change in price over the last 24 hours, as a percentage. Not money
|
|
1212
|
+
* The change in price over the last 24 hours, as a percentage. Not money: it
|
|
838
1213
|
* stays a number and must not be divided by 100.
|
|
839
1214
|
*/
|
|
840
1215
|
price_change24h?: number | null;
|
|
841
1216
|
/**
|
|
842
|
-
*
|
|
1217
|
+
* The market's probability of the outcome, between 0 and 1.
|
|
843
1218
|
*/
|
|
844
1219
|
probability?: number | null;
|
|
845
1220
|
/**
|
|
@@ -881,8 +1256,8 @@ interface Market {
|
|
|
881
1256
|
*/
|
|
882
1257
|
stat_detail?: StatDetail | null;
|
|
883
1258
|
/**
|
|
884
|
-
* Market state. See [Market and order status](/concepts/market-status/)
|
|
885
|
-
*
|
|
1259
|
+
* Market state. See [Market and order status](/concepts/market-status/). Note
|
|
1260
|
+
* that a market with `status: open` may still report as suspended when
|
|
886
1261
|
* trading is halted. One of: `scheduled`, `pre_open`, `open`, `suspended`,
|
|
887
1262
|
* `closed`, `resulted`, `cancelled`, `voided`.
|
|
888
1263
|
*/
|
|
@@ -910,11 +1285,11 @@ interface Market {
|
|
|
910
1285
|
*/
|
|
911
1286
|
total_volume?: string | null;
|
|
912
1287
|
/**
|
|
913
|
-
*
|
|
1288
|
+
* Whether the market is accepting orders right now.
|
|
914
1289
|
*/
|
|
915
1290
|
trading?: boolean | null;
|
|
916
1291
|
/**
|
|
917
|
-
* The
|
|
1292
|
+
* The categorizations used for organizing trades, settlements and related
|
|
918
1293
|
* items. A list, not an object.
|
|
919
1294
|
*/
|
|
920
1295
|
trading_filters?: MarketFilter[] | null;
|
|
@@ -927,7 +1302,7 @@ interface Market {
|
|
|
927
1302
|
[key: string]: unknown;
|
|
928
1303
|
}
|
|
929
1304
|
/**
|
|
930
|
-
* One
|
|
1305
|
+
* One categorization this market appears under.
|
|
931
1306
|
*/
|
|
932
1307
|
interface MarketFilter {
|
|
933
1308
|
/**
|
|
@@ -939,7 +1314,7 @@ interface MarketFilter {
|
|
|
939
1314
|
*/
|
|
940
1315
|
grouping?: string | null;
|
|
941
1316
|
/**
|
|
942
|
-
* Whether the
|
|
1317
|
+
* Whether the categorization was assigned by hand.
|
|
943
1318
|
*/
|
|
944
1319
|
manual?: boolean | null;
|
|
945
1320
|
/**
|
|
@@ -958,7 +1333,7 @@ interface MarketFilter {
|
|
|
958
1333
|
[key: string]: unknown;
|
|
959
1334
|
}
|
|
960
1335
|
/**
|
|
961
|
-
* Your exposure and
|
|
1336
|
+
* Your exposure and realized result in one market.
|
|
962
1337
|
*/
|
|
963
1338
|
interface MarketStat {
|
|
964
1339
|
/**
|
|
@@ -966,8 +1341,8 @@ interface MarketStat {
|
|
|
966
1341
|
*/
|
|
967
1342
|
account_id?: string | null;
|
|
968
1343
|
/**
|
|
969
|
-
*
|
|
970
|
-
*
|
|
1344
|
+
* When the record was marked as archived. `null` until the market is
|
|
1345
|
+
* archived. UNIX microseconds.
|
|
971
1346
|
*/
|
|
972
1347
|
archived_at?: number | null;
|
|
973
1348
|
/**
|
|
@@ -1100,8 +1475,8 @@ interface MarketStat {
|
|
|
1100
1475
|
*/
|
|
1101
1476
|
contracts_in_buy_orders?: string | null;
|
|
1102
1477
|
/**
|
|
1103
|
-
* Sum of all
|
|
1104
|
-
*
|
|
1478
|
+
* Sum of all unmatched contracts in all orders: each order's `quantity` minus
|
|
1479
|
+
* its `filled`. Quantity as a decimal string, as sent by the API.
|
|
1105
1480
|
*/
|
|
1106
1481
|
contracts_in_orders?: string | null;
|
|
1107
1482
|
/**
|
|
@@ -1115,9 +1490,9 @@ interface MarketStat {
|
|
|
1115
1490
|
*/
|
|
1116
1491
|
contracts_settled?: string | null;
|
|
1117
1492
|
/**
|
|
1118
|
-
* The total number of
|
|
1119
|
-
* contracts are counted
|
|
1120
|
-
* Quantity as a decimal string, as sent by the API.
|
|
1493
|
+
* The total number of contracts traded (the sum of each fill's `filled`).
|
|
1494
|
+
* Only opening trades' contracts are counted, not contracts closing other
|
|
1495
|
+
* trades. Quantity as a decimal string, as sent by the API.
|
|
1121
1496
|
*/
|
|
1122
1497
|
contracts_traded?: string | null;
|
|
1123
1498
|
/**
|
|
@@ -1168,7 +1543,7 @@ interface MarketStat {
|
|
|
1168
1543
|
*/
|
|
1169
1544
|
inserted_at?: number | null;
|
|
1170
1545
|
/**
|
|
1171
|
-
*
|
|
1546
|
+
* When the last settlement was created. UNIX microseconds.
|
|
1172
1547
|
*/
|
|
1173
1548
|
last_settled_at?: number | null;
|
|
1174
1549
|
/**
|
|
@@ -1176,7 +1551,7 @@ interface MarketStat {
|
|
|
1176
1551
|
*/
|
|
1177
1552
|
market_id?: string | null;
|
|
1178
1553
|
/**
|
|
1179
|
-
* The market's maximum price
|
|
1554
|
+
* The market's maximum price: the settlement value of one winning contract.
|
|
1180
1555
|
* In dollars. Money as a decimal string, as sent by the API.
|
|
1181
1556
|
*/
|
|
1182
1557
|
market_max_price?: string | null;
|
|
@@ -1186,7 +1561,7 @@ interface MarketStat {
|
|
|
1186
1561
|
*/
|
|
1187
1562
|
max_liability_loss?: string | null;
|
|
1188
1563
|
/**
|
|
1189
|
-
* Worst-case loss if this market settles in
|
|
1564
|
+
* Worst-case loss if this market settles in favor of the position you hold.
|
|
1190
1565
|
* In dollars. Money as a decimal string, as sent by the API.
|
|
1191
1566
|
*/
|
|
1192
1567
|
max_liability_win?: string | null;
|
|
@@ -1258,7 +1633,7 @@ interface MarketStat {
|
|
|
1258
1633
|
*/
|
|
1259
1634
|
pending_close_fee?: string | null;
|
|
1260
1635
|
/**
|
|
1261
|
-
* Profit or loss that would be
|
|
1636
|
+
* Profit or loss that would be realized if the resting close orders all
|
|
1262
1637
|
* filled. In dollars. Money as a decimal string, as sent by the API.
|
|
1263
1638
|
*/
|
|
1264
1639
|
pending_close_pnl?: string | null;
|
|
@@ -1295,7 +1670,7 @@ interface MarketStat {
|
|
|
1295
1670
|
*/
|
|
1296
1671
|
rejected_sell_orders?: number | null;
|
|
1297
1672
|
/**
|
|
1298
|
-
* The total number of
|
|
1673
|
+
* The total number of sell contracts that were closed. Quantity as a decimal
|
|
1299
1674
|
* string, as sent by the API.
|
|
1300
1675
|
*/
|
|
1301
1676
|
sell_contracts_closed?: string | null;
|
|
@@ -1338,8 +1713,8 @@ interface MarketStat {
|
|
|
1338
1713
|
*/
|
|
1339
1714
|
sell_trade_count?: number | null;
|
|
1340
1715
|
/**
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1716
|
+
* When the expired settlements were recorded. `null` if the market has not
|
|
1717
|
+
* resulted or voided yet. UNIX microseconds.
|
|
1343
1718
|
*/
|
|
1344
1719
|
settled_at?: number | null;
|
|
1345
1720
|
/**
|
|
@@ -1366,7 +1741,7 @@ interface MarketStat {
|
|
|
1366
1741
|
*/
|
|
1367
1742
|
total_fees?: string | null;
|
|
1368
1743
|
/**
|
|
1369
|
-
* The liability affecting
|
|
1744
|
+
* The liability affecting available balance from open orders and position. In
|
|
1370
1745
|
* dollars. Money as a decimal string, as sent by the API.
|
|
1371
1746
|
*/
|
|
1372
1747
|
total_liability?: string | null;
|
|
@@ -1376,7 +1751,7 @@ interface MarketStat {
|
|
|
1376
1751
|
*/
|
|
1377
1752
|
total_net_pnl?: string | null;
|
|
1378
1753
|
/**
|
|
1379
|
-
* The total
|
|
1754
|
+
* The total profit or loss on all settlements. In dollars. Money as a decimal
|
|
1380
1755
|
* string, as sent by the API.
|
|
1381
1756
|
*/
|
|
1382
1757
|
total_settlement_pnl?: string | null;
|
|
@@ -1392,20 +1767,35 @@ interface MarketStat {
|
|
|
1392
1767
|
[key: string]: unknown;
|
|
1393
1768
|
}
|
|
1394
1769
|
/**
|
|
1395
|
-
* The account behind the
|
|
1770
|
+
* The account behind the credential.
|
|
1396
1771
|
*/
|
|
1397
1772
|
interface Me {
|
|
1398
1773
|
/**
|
|
1399
1774
|
* Your account id. Trades, settlements and balances are scoped to it.
|
|
1400
1775
|
*/
|
|
1401
1776
|
account_id?: string | null;
|
|
1777
|
+
/**
|
|
1778
|
+
* Path of your avatar, `/avatars/{handle}.svg`, relative to the API host.
|
|
1779
|
+
* `null` when `handle` is `null`.
|
|
1780
|
+
*/
|
|
1781
|
+
avatar_url?: string | null;
|
|
1402
1782
|
/**
|
|
1403
1783
|
* First name on the account, or `null` if no profile is loaded.
|
|
1404
1784
|
*/
|
|
1405
1785
|
first_name?: string | null;
|
|
1406
1786
|
/**
|
|
1407
|
-
*
|
|
1408
|
-
*
|
|
1787
|
+
* Your public handle, shown on the leaderboard in place of your name. `null`
|
|
1788
|
+
* until one is set.
|
|
1789
|
+
*/
|
|
1790
|
+
handle?: string | null;
|
|
1791
|
+
/**
|
|
1792
|
+
* When you may next change your handle. `null` means now; otherwise the end
|
|
1793
|
+
* of the 30-day window since the last change.
|
|
1794
|
+
*/
|
|
1795
|
+
handle_changeable_at?: string | null;
|
|
1796
|
+
/**
|
|
1797
|
+
* The id of the API key that signed this request: the value sent in the
|
|
1798
|
+
* access-key header. `null` on a bearer request.
|
|
1409
1799
|
*/
|
|
1410
1800
|
key_id?: string | null;
|
|
1411
1801
|
/**
|
|
@@ -1413,16 +1803,24 @@ interface Me {
|
|
|
1413
1803
|
*/
|
|
1414
1804
|
last_name?: string | null;
|
|
1415
1805
|
/**
|
|
1416
|
-
*
|
|
1806
|
+
* Whether you have consented to appear on public leaderboards. New accounts
|
|
1807
|
+
* start with the jurisdiction's default; accounts from before the leaderboard
|
|
1808
|
+
* start at `false`. Change it with `PATCH /api/v1/me/profile`.
|
|
1809
|
+
*/
|
|
1810
|
+
leaderboard_opt_in?: boolean | null;
|
|
1811
|
+
/**
|
|
1812
|
+
* How this request authenticated: `api_key` for a signed request, `bearer`
|
|
1813
|
+
* for a session token. One of: `api_key`, `bearer`.
|
|
1417
1814
|
*/
|
|
1418
1815
|
method?: string | null;
|
|
1419
1816
|
/**
|
|
1420
1817
|
* Access level granted to this key: `read_only`, or `read_write` for keys
|
|
1421
|
-
* that may place and cancel orders. One of:
|
|
1818
|
+
* that may place and cancel orders. `null` on a bearer request. One of:
|
|
1819
|
+
* `read_only`, `read_write`.
|
|
1422
1820
|
*/
|
|
1423
1821
|
scope?: string | null;
|
|
1424
1822
|
/**
|
|
1425
|
-
* Your user id. Substitute this into
|
|
1823
|
+
* Your user id. Substitute this into account channel topics such as
|
|
1426
1824
|
* `orders:{user_id}`.
|
|
1427
1825
|
*/
|
|
1428
1826
|
user_id?: string | null;
|
|
@@ -1443,7 +1841,7 @@ interface NewOrder {
|
|
|
1443
1841
|
*/
|
|
1444
1842
|
cancel_on_disconnect?: boolean | null;
|
|
1445
1843
|
/**
|
|
1446
|
-
* Your own reference, echoed back unchanged. A free-form string, not a UUID
|
|
1844
|
+
* Your own reference, echoed back unchanged. A free-form string, not a UUID;
|
|
1447
1845
|
* FIX clients routinely send ids like `my-order-001`.
|
|
1448
1846
|
*/
|
|
1449
1847
|
client_order_id?: string | null;
|
|
@@ -1461,6 +1859,19 @@ interface NewOrder {
|
|
|
1461
1859
|
* `good_till_time`. UNIX microseconds.
|
|
1462
1860
|
*/
|
|
1463
1861
|
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;
|
|
1464
1875
|
/**
|
|
1465
1876
|
* The market to place the order on.
|
|
1466
1877
|
*/
|
|
@@ -1471,16 +1882,15 @@ interface NewOrder {
|
|
|
1471
1882
|
*/
|
|
1472
1883
|
order_type?: string | null;
|
|
1473
1884
|
/**
|
|
1474
|
-
* Limit price in dollars, as a string
|
|
1475
|
-
*
|
|
1476
|
-
*
|
|
1477
|
-
*
|
|
1478
|
-
*
|
|
1479
|
-
* assuming a fixed ceiling. Required for `limit` orders and unused by
|
|
1885
|
+
* Limit price in dollars, as a string: `"0.42"` is 42 cents. A number is
|
|
1886
|
+
* rejected outright rather than reinterpreted, because a bare `42` could mean
|
|
1887
|
+
* 42 cents or 42 dollars and the wrong reading is off by 100x. Must be
|
|
1888
|
+
* strictly less than the market's `max_price`; read that per market rather
|
|
1889
|
+
* than assuming a fixed ceiling. Required for `limit` orders and unused by
|
|
1480
1890
|
* `market` orders, but validated whenever it is present: a malformed or
|
|
1481
1891
|
* sub-cent price is a 400 on a `market` order too, rather than being quietly
|
|
1482
1892
|
* dropped. An explicit `null` is accepted there, exactly as omitting the key
|
|
1483
|
-
* is. Must be greater than zero and a whole number of cents
|
|
1893
|
+
* is. Must be greater than zero and a whole number of cents: at most two
|
|
1484
1894
|
* decimal places, not counting trailing zeros. So "0.42" and "0.4200" are the
|
|
1485
1895
|
* same accepted value, and "0.001" is rejected. Money as a decimal string, as
|
|
1486
1896
|
* sent by the API.
|
|
@@ -1489,7 +1899,7 @@ interface NewOrder {
|
|
|
1489
1899
|
/**
|
|
1490
1900
|
* Number of contracts, greater than zero, as a decimal string: `"10"` and
|
|
1491
1901
|
* `"10.00"` are read the same. A number is rejected rather than converted,
|
|
1492
|
-
* the same rule `price` follows, though for a different reason
|
|
1902
|
+
* the same rule `price` follows, though for a different reason: a float
|
|
1493
1903
|
* arrives as a binary double, so the size that rests on the book would not
|
|
1494
1904
|
* always be the size that was sent. More than nine decimal places is rounded.
|
|
1495
1905
|
* Responses always return it as a string.
|
|
@@ -1512,8 +1922,9 @@ interface Order {
|
|
|
1512
1922
|
*/
|
|
1513
1923
|
action?: string | null;
|
|
1514
1924
|
/**
|
|
1515
|
-
* Order size
|
|
1516
|
-
* quantity.
|
|
1925
|
+
* Order size in dollars, for an order entered by amount rather than by
|
|
1926
|
+
* contract quantity. `null` for orders placed through this API, which always
|
|
1927
|
+
* take a quantity. Money as a decimal string, as sent by the API.
|
|
1517
1928
|
*/
|
|
1518
1929
|
amount?: string | null;
|
|
1519
1930
|
/**
|
|
@@ -1547,6 +1958,12 @@ interface Order {
|
|
|
1547
1958
|
* The expiration time for time-based expiration. UNIX microseconds.
|
|
1548
1959
|
*/
|
|
1549
1960
|
expiration_time?: number | null;
|
|
1961
|
+
/**
|
|
1962
|
+
* When the contracts this order trades expire, as UNIX microseconds: the
|
|
1963
|
+
* market's expiration, copied onto the order when it is placed. `null` when
|
|
1964
|
+
* the market has no event. Not the same as `expiration_time`.
|
|
1965
|
+
*/
|
|
1966
|
+
expires_at?: number | null;
|
|
1550
1967
|
/**
|
|
1551
1968
|
* Contracts filled so far. Compare with `quantity` to get remaining size.
|
|
1552
1969
|
* Quantity as a decimal string, as sent by the API.
|
|
@@ -1583,11 +2000,13 @@ interface Order {
|
|
|
1583
2000
|
*/
|
|
1584
2001
|
market_id?: string | null;
|
|
1585
2002
|
/**
|
|
1586
|
-
* The odds
|
|
2003
|
+
* Legacy. The odds format (`decimal` or `american`) an order was entered in
|
|
2004
|
+
* on an STX app. `null` for orders placed through this API.
|
|
1587
2005
|
*/
|
|
1588
2006
|
odds_type?: string | null;
|
|
1589
2007
|
/**
|
|
1590
|
-
* The odds
|
|
2008
|
+
* Legacy. The odds an order was entered at on an STX app, as a string. `null`
|
|
2009
|
+
* for orders placed through this API.
|
|
1591
2010
|
*/
|
|
1592
2011
|
odds_value?: string | null;
|
|
1593
2012
|
/**
|
|
@@ -1599,9 +2018,9 @@ interface Order {
|
|
|
1599
2018
|
*/
|
|
1600
2019
|
placed_pre_start?: boolean | null;
|
|
1601
2020
|
/**
|
|
1602
|
-
* Limit price
|
|
1603
|
-
*
|
|
1604
|
-
* decimal places
|
|
2021
|
+
* Limit price, below the market's `max_price`; read that per market rather
|
|
2022
|
+
* than assuming a ceiling. Absent for market orders. In dollars. Carries up
|
|
2023
|
+
* to 7 decimal places; parse money with a variable-scale decimal type, not a
|
|
1605
2024
|
* fixed-width one. Money as a decimal string, as sent by the API.
|
|
1606
2025
|
*/
|
|
1607
2026
|
price?: string | null;
|
|
@@ -1614,7 +2033,7 @@ interface Order {
|
|
|
1614
2033
|
*/
|
|
1615
2034
|
rejection_reason?: string | null;
|
|
1616
2035
|
/**
|
|
1617
|
-
* Order state
|
|
2036
|
+
* Order state, one of nine. See [Market and order
|
|
1618
2037
|
* status](/concepts/market-status/#order-statuses) for the full set and which
|
|
1619
2038
|
* are terminal. One of: `created`, `requested`, `accepted`, `delayed`,
|
|
1620
2039
|
* `open`, `filled`, `rejected`, `cancelled`, `partially_cancelled`.
|
|
@@ -1695,7 +2114,7 @@ interface PaymentTransaction {
|
|
|
1695
2114
|
*/
|
|
1696
2115
|
time?: string | null;
|
|
1697
2116
|
/**
|
|
1698
|
-
* What moved the money or the points
|
|
2117
|
+
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
1699
2118
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
1700
2119
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
1701
2120
|
* `fee_refund`, `casino`, `adjustment`, `loyalty`, `loyalty_points_rollup`,
|
|
@@ -1751,7 +2170,7 @@ interface Position {
|
|
|
1751
2170
|
*/
|
|
1752
2171
|
max_potential_fee?: string | null;
|
|
1753
2172
|
/**
|
|
1754
|
-
* Total possible profit for the position if everything settles
|
|
2173
|
+
* Total possible profit for the position if everything settles favorably. In
|
|
1755
2174
|
* dollars. Money as a decimal string, as sent by the API.
|
|
1756
2175
|
*/
|
|
1757
2176
|
max_potential_profit?: string | null;
|
|
@@ -1804,7 +2223,7 @@ interface Position {
|
|
|
1804
2223
|
*/
|
|
1805
2224
|
total_fee?: string | null;
|
|
1806
2225
|
/**
|
|
1807
|
-
* Profit or loss
|
|
2226
|
+
* Profit or loss realized from settlements so far. In dollars. Money as a
|
|
1808
2227
|
* decimal string, as sent by the API.
|
|
1809
2228
|
*/
|
|
1810
2229
|
total_settlement_pnl?: string | null;
|
|
@@ -1812,12 +2231,38 @@ interface Position {
|
|
|
1812
2231
|
[key: string]: unknown;
|
|
1813
2232
|
}
|
|
1814
2233
|
/**
|
|
1815
|
-
*
|
|
2234
|
+
* The public-profile fields to change. Every key is optional, but at least one
|
|
2235
|
+
* is required.
|
|
2236
|
+
*/
|
|
2237
|
+
interface ProfileUpdate {
|
|
2238
|
+
/**
|
|
2239
|
+
* A new avatar. Any style/palette pairing renders; the seed selects the
|
|
2240
|
+
* pattern. `null` is refused (`400`).
|
|
2241
|
+
*/
|
|
2242
|
+
avatar?: Record<string, unknown> | null;
|
|
2243
|
+
/**
|
|
2244
|
+
* New public handle: 3-24 characters of lowercase letters, digits and inner
|
|
2245
|
+
* `.` or `_`; case is folded. Must be unused, not a reserved word and not
|
|
2246
|
+
* blocked. May be changed once every 30 days; re-sending your current handle
|
|
2247
|
+
* is not a change. A blank handle is refused (`422`).
|
|
2248
|
+
*/
|
|
2249
|
+
handle?: string | null;
|
|
2250
|
+
/**
|
|
2251
|
+
* Your consent to appear on public boards. `true` joins, `false` leaves; your
|
|
2252
|
+
* own standing is unaffected. Each change is recorded with its time. Joining
|
|
2253
|
+
* gives you a generated handle and avatar if you have none yet.
|
|
2254
|
+
*/
|
|
2255
|
+
leaderboard_opt_in?: boolean | null;
|
|
2256
|
+
/** Fields the server added after this SDK was generated. */
|
|
2257
|
+
[key: string]: unknown;
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* One recent trade on the market.
|
|
1816
2261
|
*/
|
|
1817
2262
|
interface RecentTrade {
|
|
1818
2263
|
/**
|
|
1819
2264
|
* Which side took liquidity. `Trade.liquidity_taker/1` derives this from the
|
|
1820
|
-
* resting side, so the values are `buyer` and `seller
|
|
2265
|
+
* resting side, so the values are `buyer` and `seller`, not `buy`/`sell` as
|
|
1821
2266
|
* on an order's `action`. One of: `buyer`, `seller`.
|
|
1822
2267
|
*/
|
|
1823
2268
|
liquidity_taker?: string | null;
|
|
@@ -1967,7 +2412,7 @@ interface StatDetail {
|
|
|
1967
2412
|
*/
|
|
1968
2413
|
prop_type?: string | null;
|
|
1969
2414
|
/**
|
|
1970
|
-
* The stat
|
|
2415
|
+
* The stat the line is on, e.g. `passingYards`.
|
|
1971
2416
|
*/
|
|
1972
2417
|
stat?: string | null;
|
|
1973
2418
|
/**
|
|
@@ -2035,7 +2480,7 @@ interface Transaction {
|
|
|
2035
2480
|
*/
|
|
2036
2481
|
time?: string | null;
|
|
2037
2482
|
/**
|
|
2038
|
-
* What moved the money or the points
|
|
2483
|
+
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
2039
2484
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
2040
2485
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
2041
2486
|
* `fee_refund`, `casino`, `adjustment`, `loyalty`, `loyalty_points_rollup`,
|
|
@@ -2052,6 +2497,9 @@ type models_Cancellation = Cancellation;
|
|
|
2052
2497
|
type models_Event = Event;
|
|
2053
2498
|
type models_FeeTransaction = FeeTransaction;
|
|
2054
2499
|
type models_Fill = Fill;
|
|
2500
|
+
type models_Leaderboard = Leaderboard;
|
|
2501
|
+
type models_LeaderboardEntry = LeaderboardEntry;
|
|
2502
|
+
type models_LeaderboardStanding = LeaderboardStanding;
|
|
2055
2503
|
type models_Market = Market;
|
|
2056
2504
|
type models_MarketFilter = MarketFilter;
|
|
2057
2505
|
type models_MarketStat = MarketStat;
|
|
@@ -2060,16 +2508,17 @@ type models_NewOrder = NewOrder;
|
|
|
2060
2508
|
type models_Order = Order;
|
|
2061
2509
|
type models_PaymentTransaction = PaymentTransaction;
|
|
2062
2510
|
type models_Position = Position;
|
|
2511
|
+
type models_ProfileUpdate = ProfileUpdate;
|
|
2063
2512
|
type models_RecentTrade = RecentTrade;
|
|
2064
2513
|
type models_Settlement = Settlement;
|
|
2065
2514
|
type models_StatDetail = StatDetail;
|
|
2066
2515
|
type models_Transaction = Transaction;
|
|
2067
2516
|
declare namespace models {
|
|
2068
|
-
export type { models_Balance as Balance, models_BookLevel as BookLevel, models_Cancellation as Cancellation, Error$1 as Error, models_Event as Event, models_FeeTransaction as FeeTransaction, models_Fill as Fill, models_Market as Market, models_MarketFilter as MarketFilter, models_MarketStat as MarketStat, models_Me as Me, models_NewOrder as NewOrder, models_Order as Order, models_PaymentTransaction as PaymentTransaction, models_Position as Position, models_RecentTrade as RecentTrade, models_Settlement as Settlement, models_StatDetail as StatDetail, models_Transaction as Transaction };
|
|
2517
|
+
export type { models_Balance as Balance, models_BookLevel as BookLevel, models_Cancellation as Cancellation, Error$1 as Error, models_Event as Event, models_FeeTransaction as FeeTransaction, models_Fill as Fill, models_Leaderboard as Leaderboard, models_LeaderboardEntry as LeaderboardEntry, models_LeaderboardStanding as LeaderboardStanding, models_Market as Market, models_MarketFilter as MarketFilter, models_MarketStat as MarketStat, models_Me as Me, models_NewOrder as NewOrder, models_Order as Order, models_PaymentTransaction as PaymentTransaction, models_Position as Position, models_ProfileUpdate as ProfileUpdate, models_RecentTrade as RecentTrade, models_Settlement as Settlement, models_StatDetail as StatDetail, models_Transaction as Transaction };
|
|
2069
2518
|
}
|
|
2070
2519
|
|
|
2071
2520
|
interface Operation {
|
|
2072
|
-
readonly method: "GET" | "POST" | "DELETE";
|
|
2521
|
+
readonly method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
2073
2522
|
readonly path: string;
|
|
2074
2523
|
readonly query: readonly string[];
|
|
2075
2524
|
readonly pathParams: readonly string[];
|
|
@@ -2113,6 +2562,17 @@ declare const OPERATIONS: {
|
|
|
2113
2562
|
readonly isList: true;
|
|
2114
2563
|
readonly paginated: true;
|
|
2115
2564
|
};
|
|
2565
|
+
readonly events__id_players_get: {
|
|
2566
|
+
readonly method: "GET";
|
|
2567
|
+
readonly path: "/api/v1/events/{event_id}/players";
|
|
2568
|
+
readonly query: readonly [];
|
|
2569
|
+
readonly pathParams: readonly ["event_id"];
|
|
2570
|
+
readonly hasBody: false;
|
|
2571
|
+
readonly responseKey: "";
|
|
2572
|
+
readonly model: "";
|
|
2573
|
+
readonly isList: false;
|
|
2574
|
+
readonly paginated: false;
|
|
2575
|
+
};
|
|
2116
2576
|
readonly fills_get: {
|
|
2117
2577
|
readonly method: "GET";
|
|
2118
2578
|
readonly path: "/api/v1/fills";
|
|
@@ -2124,6 +2584,28 @@ declare const OPERATIONS: {
|
|
|
2124
2584
|
readonly isList: true;
|
|
2125
2585
|
readonly paginated: true;
|
|
2126
2586
|
};
|
|
2587
|
+
readonly leaderboard_get: {
|
|
2588
|
+
readonly method: "GET";
|
|
2589
|
+
readonly path: "/api/v1/leaderboard";
|
|
2590
|
+
readonly query: readonly ["period", "category", "metric", "limit"];
|
|
2591
|
+
readonly pathParams: readonly [];
|
|
2592
|
+
readonly hasBody: false;
|
|
2593
|
+
readonly responseKey: "";
|
|
2594
|
+
readonly model: "";
|
|
2595
|
+
readonly isList: false;
|
|
2596
|
+
readonly paginated: false;
|
|
2597
|
+
};
|
|
2598
|
+
readonly leaderboard_me_get: {
|
|
2599
|
+
readonly method: "GET";
|
|
2600
|
+
readonly path: "/api/v1/leaderboard/me";
|
|
2601
|
+
readonly query: readonly ["period", "category"];
|
|
2602
|
+
readonly pathParams: readonly [];
|
|
2603
|
+
readonly hasBody: false;
|
|
2604
|
+
readonly responseKey: "";
|
|
2605
|
+
readonly model: "";
|
|
2606
|
+
readonly isList: false;
|
|
2607
|
+
readonly paginated: false;
|
|
2608
|
+
};
|
|
2127
2609
|
readonly markets_get: {
|
|
2128
2610
|
readonly method: "GET";
|
|
2129
2611
|
readonly path: "/api/v1/markets";
|
|
@@ -2135,6 +2617,17 @@ declare const OPERATIONS: {
|
|
|
2135
2617
|
readonly isList: true;
|
|
2136
2618
|
readonly paginated: true;
|
|
2137
2619
|
};
|
|
2620
|
+
readonly markets_post: {
|
|
2621
|
+
readonly method: "POST";
|
|
2622
|
+
readonly path: "/api/v1/markets";
|
|
2623
|
+
readonly query: readonly [];
|
|
2624
|
+
readonly pathParams: readonly [];
|
|
2625
|
+
readonly hasBody: true;
|
|
2626
|
+
readonly responseKey: "";
|
|
2627
|
+
readonly model: "";
|
|
2628
|
+
readonly isList: false;
|
|
2629
|
+
readonly paginated: false;
|
|
2630
|
+
};
|
|
2138
2631
|
readonly me_get: {
|
|
2139
2632
|
readonly method: "GET";
|
|
2140
2633
|
readonly path: "/api/v1/me";
|
|
@@ -2146,6 +2639,17 @@ declare const OPERATIONS: {
|
|
|
2146
2639
|
readonly isList: false;
|
|
2147
2640
|
readonly paginated: false;
|
|
2148
2641
|
};
|
|
2642
|
+
readonly me_profile_patch: {
|
|
2643
|
+
readonly method: "PATCH";
|
|
2644
|
+
readonly path: "/api/v1/me/profile";
|
|
2645
|
+
readonly query: readonly [];
|
|
2646
|
+
readonly pathParams: readonly [];
|
|
2647
|
+
readonly hasBody: true;
|
|
2648
|
+
readonly responseKey: "me";
|
|
2649
|
+
readonly model: "Me";
|
|
2650
|
+
readonly isList: false;
|
|
2651
|
+
readonly paginated: false;
|
|
2652
|
+
};
|
|
2149
2653
|
readonly orders_get: {
|
|
2150
2654
|
readonly method: "GET";
|
|
2151
2655
|
readonly path: "/api/v1/orders";
|
|
@@ -2173,7 +2677,7 @@ declare const OPERATIONS: {
|
|
|
2173
2677
|
readonly path: "/api/v1/orders/all";
|
|
2174
2678
|
readonly query: readonly [];
|
|
2175
2679
|
readonly pathParams: readonly [];
|
|
2176
|
-
readonly hasBody:
|
|
2680
|
+
readonly hasBody: true;
|
|
2177
2681
|
readonly responseKey: "cancellations";
|
|
2178
2682
|
readonly model: "Cancellation";
|
|
2179
2683
|
readonly isList: true;
|
|
@@ -2206,7 +2710,7 @@ declare const OPERATIONS: {
|
|
|
2206
2710
|
readonly path: "/api/v1/orders/{order_id}";
|
|
2207
2711
|
readonly query: readonly [];
|
|
2208
2712
|
readonly pathParams: readonly ["order_id"];
|
|
2209
|
-
readonly hasBody:
|
|
2713
|
+
readonly hasBody: true;
|
|
2210
2714
|
readonly responseKey: "";
|
|
2211
2715
|
readonly model: "";
|
|
2212
2716
|
readonly isList: false;
|
|
@@ -2311,6 +2815,17 @@ declare const OPERATIONS: {
|
|
|
2311
2815
|
readonly isList: false;
|
|
2312
2816
|
readonly paginated: false;
|
|
2313
2817
|
};
|
|
2818
|
+
readonly types_get: {
|
|
2819
|
+
readonly method: "GET";
|
|
2820
|
+
readonly path: "/api/v1/types";
|
|
2821
|
+
readonly query: readonly [];
|
|
2822
|
+
readonly pathParams: readonly [];
|
|
2823
|
+
readonly hasBody: false;
|
|
2824
|
+
readonly responseKey: "";
|
|
2825
|
+
readonly model: "";
|
|
2826
|
+
readonly isList: false;
|
|
2827
|
+
readonly paginated: false;
|
|
2828
|
+
};
|
|
2314
2829
|
};
|
|
2315
2830
|
type OperationId = keyof typeof OPERATIONS;
|
|
2316
2831
|
|
|
@@ -2364,7 +2879,7 @@ declare class STXAPIException extends STXException {
|
|
|
2364
2879
|
declare class STXValidationException extends STXAPIException {
|
|
2365
2880
|
}
|
|
2366
2881
|
/**
|
|
2367
|
-
* 401: the signature, key
|
|
2882
|
+
* 401: the signature, key ID or timestamp was not accepted. A machine clock
|
|
2368
2883
|
* more than 30 seconds off also lands here.
|
|
2369
2884
|
*/
|
|
2370
2885
|
declare class STXAuthenticationException extends STXAPIException {
|
|
@@ -2525,7 +3040,7 @@ declare function loadPrivateKey(value: PrivateKeyInput): KeyObject;
|
|
|
2525
3040
|
*/
|
|
2526
3041
|
declare function signerFromPrivateKey(value: PrivateKeyInput): Signer;
|
|
2527
3042
|
/**
|
|
2528
|
-
* An STX API key: the key
|
|
3043
|
+
* An STX API key: the key ID sent with every request, and the means of
|
|
2529
3044
|
* signing. Build one from a PEM string or path:
|
|
2530
3045
|
*
|
|
2531
3046
|
* new ApiKeyCredentials("my-key-id", "~/.stx/ontario.pem")
|
|
@@ -2556,8 +3071,8 @@ declare class ApiKeyCredentials implements AuthProvider {
|
|
|
2556
3071
|
toString(): string;
|
|
2557
3072
|
}
|
|
2558
3073
|
|
|
2559
|
-
declare const VERSION = "0.
|
|
2560
|
-
declare const USER_AGENT = "stx-typescript/0.
|
|
3074
|
+
declare const VERSION = "0.9.0-alpha.1";
|
|
3075
|
+
declare const USER_AGENT = "stx-typescript/0.9.0-alpha.1";
|
|
2561
3076
|
/**
|
|
2562
3077
|
* `Symbol.asyncDispose` where the runtime has it (Node 20+, Bun), so
|
|
2563
3078
|
* `await using client = new STX()` works there; a registered stand-in on
|
|
@@ -2804,7 +3319,9 @@ interface STXWebSocketOptions extends Pick<STXOptions, "environment" | "region"
|
|
|
2804
3319
|
* Called when the socket gives up because its credentials are dead: an OAuth
|
|
2805
3320
|
* grant was revoked (`STXGrantRevokedException`), or the tokens are gone. The
|
|
2806
3321
|
* socket is closed by then; `ws.error` holds the same exception. Send the
|
|
2807
|
-
* member back through consent.
|
|
3322
|
+
* member back through consent. It is also called with
|
|
3323
|
+
* `STXAccountPendingException` while the member's STX account is still being
|
|
3324
|
+
* verified: their tokens are kept, so connect again once they are verified.
|
|
2808
3325
|
*/
|
|
2809
3326
|
onAuthError?: (err: STXException) => void;
|
|
2810
3327
|
/** Milliseconds to wait for a join or push reply. Default 10000. */
|
|
@@ -2817,7 +3334,7 @@ interface STXWebSocketOptions extends Pick<STXOptions, "environment" | "region"
|
|
|
2817
3334
|
* Phoenix-channels client for the documented STX topics. Build it from an
|
|
2818
3335
|
* `STX` client, which supplies the host, the key and your user id:
|
|
2819
3336
|
*
|
|
2820
|
-
* const client = new STX(
|
|
3337
|
+
* const client = new STX();
|
|
2821
3338
|
* const ws = await client.websocket().connect();
|
|
2822
3339
|
* const book = await ws.orderbook(["<market-id>"], { onMessage: console.log });
|
|
2823
3340
|
* const orders = await ws.orders();
|
|
@@ -3007,7 +3524,7 @@ interface STXOptions {
|
|
|
3007
3524
|
env?: string | null;
|
|
3008
3525
|
/** A hostname or URL, overriding region/env: `"demo.stxapp.ca"`, `"http://localhost:4000"`. */
|
|
3009
3526
|
host?: string | null;
|
|
3010
|
-
/** The API key
|
|
3527
|
+
/** The API key ID. */
|
|
3011
3528
|
keyId?: string | null;
|
|
3012
3529
|
/** The Ed25519 private key: PEM text, a path to a PEM file, PEM bytes, or a KeyObject. */
|
|
3013
3530
|
privateKey?: PrivateKeyInput | null;
|
|
@@ -3082,6 +3599,7 @@ interface MarketsQuery {
|
|
|
3082
3599
|
eventIds?: StrList;
|
|
3083
3600
|
/** One status or a list, e.g. `["pre_open", "open"]`. */
|
|
3084
3601
|
status?: StrList;
|
|
3602
|
+
/** `true` for only the markets accepting orders now, `false` for only those that are not. */
|
|
3085
3603
|
trading?: boolean;
|
|
3086
3604
|
sports?: StrList;
|
|
3087
3605
|
competitions?: StrList;
|
|
@@ -3180,7 +3698,7 @@ declare function orderBody(marketId: string, action: string, orderType: string,
|
|
|
3180
3698
|
* The STX client. Configuration comes from the options, then
|
|
3181
3699
|
* environment variables, then a profile in ~/.stx/credentials:
|
|
3182
3700
|
*
|
|
3183
|
-
* const client = new STX(
|
|
3701
|
+
* const client = new STX();
|
|
3184
3702
|
* const me = await client.me();
|
|
3185
3703
|
* const page = await client.markets({ status: "open", limit: 10 });
|
|
3186
3704
|
*/
|
|
@@ -3230,6 +3748,43 @@ declare class STX {
|
|
|
3230
3748
|
events(query?: EventsQuery): Promise<Page<Event>>;
|
|
3231
3749
|
/** Every event matching the filters, following the cursor. */
|
|
3232
3750
|
iterEvents(query?: WithoutCursor<EventsQuery>): AsyncGenerator<Event, void, undefined>;
|
|
3751
|
+
/**
|
|
3752
|
+
* `GET /api/v1/events/{event_id}/players`: the event's team rosters and the
|
|
3753
|
+
* stats a market on it can use. `teams` is empty until the rosters are
|
|
3754
|
+
* published. Needs an OAuth app token with `events`, or an API key.
|
|
3755
|
+
*/
|
|
3756
|
+
eventPlayers(eventId: string): Promise<EventPlayers>;
|
|
3757
|
+
/** The stats `event` accepts for new markets. */
|
|
3758
|
+
statsFor(event: string | {
|
|
3759
|
+
event_id?: string | null;
|
|
3760
|
+
}): Promise<EventStat[]>;
|
|
3761
|
+
/**
|
|
3762
|
+
* `GET /api/v1/types`: the market types, keyed by rule. One with
|
|
3763
|
+
* `partner_create: true` can be created with `createMarkets()`, and lists
|
|
3764
|
+
* the `fields` an entry takes and, per event type, the `stats` on offer. It
|
|
3765
|
+
* changes only when STX adds a rule or a stat, so read it once and keep it.
|
|
3766
|
+
* Needs an OAuth app token with `events`, or an API key.
|
|
3767
|
+
*/
|
|
3768
|
+
marketTypes(): Promise<MarketTypes>;
|
|
3769
|
+
/**
|
|
3770
|
+
* `POST /api/v1/markets`: create markets on a scheduled event, up to
|
|
3771
|
+
* `MAX_MARKETS_PER_REQUEST` per call. Each market names its `rule` and the
|
|
3772
|
+
* fields that rule takes. Needs an OAuth app token with `markets.write`,
|
|
3773
|
+
* which STX grants, from an address on the client's IP allow-list (it
|
|
3774
|
+
* applies to every call that client makes).
|
|
3775
|
+
*
|
|
3776
|
+
* Returns one result per market, in the order given, each with its `index`:
|
|
3777
|
+
* `created` or `exists` (both with `market_id`), `valid` (a `dryRun` market
|
|
3778
|
+
* that would be created), or `rejected` with a `reason`. A rejected market
|
|
3779
|
+
* is a result, not an error, and resending is safe: a market that is
|
|
3780
|
+
* already listed comes back `exists`. A refused request throws (`403`
|
|
3781
|
+
* without `markets.write`, `404` unknown event, `422` event not open).
|
|
3782
|
+
*
|
|
3783
|
+
* `dryRun` runs every check and creates nothing. More than
|
|
3784
|
+
* `MAX_MARKETS_PER_REQUEST` markets throws `TypeError` before any request.
|
|
3785
|
+
* `validate` also needs the `events` scope.
|
|
3786
|
+
*/
|
|
3787
|
+
createMarkets(eventId: string, markets: readonly NewMarket[], opts?: CreateMarketsOptions): Promise<CreateMarketResult[]>;
|
|
3233
3788
|
/** `GET /api/v1/orders`: one page of your orders, newest first. */
|
|
3234
3789
|
orders(query?: OrdersQuery): Promise<Page<Order>>;
|
|
3235
3790
|
/** Every order matching the filters, following the cursor. */
|
|
@@ -3352,4 +3907,4 @@ declare class STX {
|
|
|
3352
3907
|
websocket(opts?: Omit<STXWebSocketOptions, "rest">): STXWebSocket;
|
|
3353
3908
|
}
|
|
3354
3909
|
|
|
3355
|
-
export {
|
|
3910
|
+
export { type MarketTypes as $, type AcceptTermsOptions as A, type Balance as B, type Cancellation as C, type GeoLocationProvider as D, Environment as E, type FeeTransaction as F, type GeoCheckResult as G, type GeoOption as H, type GeoRejection as I, HOSTS as J, KEY_HEADER as K, type KnownStat as L, type Leaderboard as M, type LeaderboardEntry as N, type LeaderboardStanding as O, type ListedMarketType as P, type Logger as Q, MAX_MARKETS_PER_REQUEST as R, type Market as S, type MarketFilter as T, type MarketRejectionReason as U, type MarketRule as V, type MarketStat as W, type MarketStatsQuery as X, type MarketType as Y, type MarketTypeEventType as Z, type MarketTypeField as _, type AccountChange as a, baseUrlFor as a$, type MarketsQuery as a0, type Me as a1, type MessageHandler as a2, NO_RETRY as a3, type NewMarket as a4, type NewOrder as a5, type NewOrderInput as a6, OPERATIONS as a7, type Operation as a8, type OperationId as a9, STXForbiddenException as aA, STXGeoLocationException as aB, STXInsufficientScopeException as aC, STXInvalidTokenException as aD, STXNotFoundException as aE, type STXOptions as aF, STXRateLimitException as aG, STXRejectedException as aH, STXServerException as aI, STXTimeoutException as aJ, STXTransportException as aK, STXValidationException as aL, STXWebSocket as aM, type STXWebSocketOptions as aN, type Settlement as aO, type SettlementsQuery as aP, type Signer as aQ, type Stat as aR, type StatDetail as aS, Stats as aT, type StrList as aU, TERMINAL_ORDER_STATUSES as aV, TIMESTAMP_HEADER as aW, type Transaction as aX, USER_AGENT as aY, VERSION as aZ, type WebSocketAuthContext as a_, type Order as aa, type OrderOptions as ab, type OrdersQuery as ac, Page as ad, type PageQuery as ae, type PaymentTransaction as af, type PlayerStatLineMarket as ag, type Position as ah, type PrivateKeyInput as ai, type ProfileUpdate as aj, type RecentTrade as ak, ReconnectPolicy as al, type ReconnectPolicyOptions as am, Region as an, type ResponseEvent as ao, RetryPolicy as ap, type RetryPolicyOptions as aq, SIGNATURE_HEADER as ar, SNAPSHOT_EVENTS as as, STX as at, STXAPIException as au, STXAuthenticationException as av, STXChannelException as aw, STXConfigException as ax, type STXEnvironment as ay, STXException as az, type AccountChangeKind as b, buildMessage as b0, environmentNamed as b1, errorForStatus as b2, geoRejection as b3, handshakePath as b4, isValidLine as b5, loadPrivateKey as b6, models as b7, orderBody as b8, requestPath as b9, resolveHost as ba, signerFromPrivateKey as bb, socketUrlFor as bc, 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, Channel as k, ChannelMessage as l, type CreatableMarketType as m, type CreateMarketResult as n, type CreateMarketsOptions as o, Environments as p, type Error$1 as q, type Event as r, type EventPlayer as s, type EventPlayers as t, type EventStat as u, type EventTeam as v, type EventsQuery as w, type FetchLike as x, type Fill as y, type FillsQuery as z };
|