@stxapp/stx-typescript 0.6.3 → 0.8.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 +10 -0
- package/dist/{chunk-PZUVKPHZ.js → chunk-H7XZDE2U.js} +224 -197
- package/dist/chunk-H7XZDE2U.js.map +1 -0
- package/dist/{chunk-CSHPFQ2V.cjs → chunk-L2DEU7R6.cjs} +243 -216
- package/dist/chunk-L2DEU7R6.cjs.map +1 -0
- package/dist/{client-Dkd5vesS.d.cts → client-E5Lg6k8d.d.cts} +585 -116
- package/dist/{client-Dkd5vesS.d.ts → client-E5Lg6k8d.d.ts} +585 -116
- 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 +24 -22
- package/dist/oauth.cjs.map +1 -1
- package/dist/oauth.d.cts +12 -8
- package/dist/oauth.d.ts +12 -8
- package/dist/oauth.js +8 -6
- package/dist/oauth.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-CSHPFQ2V.cjs.map +0 -1
- package/dist/chunk-PZUVKPHZ.js.map +0 -1
|
@@ -89,7 +89,7 @@ declare const Environments: {
|
|
|
89
89
|
readonly name: "ontario-production";
|
|
90
90
|
readonly region: "ontario";
|
|
91
91
|
readonly env: "production";
|
|
92
|
-
readonly host: "stxapp.ca";
|
|
92
|
+
readonly host: "api.on.stxapp.ca";
|
|
93
93
|
readonly realMoney: true;
|
|
94
94
|
};
|
|
95
95
|
};
|
|
@@ -140,13 +140,182 @@ 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 market to create. */
|
|
256
|
+
interface NewMarketInput {
|
|
257
|
+
/** The market type. Player stat lines are the only one today. */
|
|
258
|
+
rule?: "player_stat_line";
|
|
259
|
+
/** From `eventPlayers()`. */
|
|
260
|
+
playerId: string;
|
|
261
|
+
/** One of the event's stats, e.g. `Stats.Basketball.POINTS`. */
|
|
262
|
+
stat: Stat;
|
|
263
|
+
/**
|
|
264
|
+
* The line. A positive number ending in `.5`, e.g. `18.5`. Whole numbers
|
|
265
|
+
* (`18`), quarter lines (`18.25`), zero, negatives and strings (`"18.5"`)
|
|
266
|
+
* are rejected with `invalid_line`.
|
|
267
|
+
*/
|
|
268
|
+
line: number;
|
|
269
|
+
/** `"ou"` (over/under), the only type today and the default. */
|
|
270
|
+
propType?: "ou";
|
|
271
|
+
}
|
|
272
|
+
/** Why a market was not created. */
|
|
273
|
+
type MarketRejectionReason = "invalid_market" | "unsupported_market_type" | "unsupported_prop_type" | "unsupported_stat" | "invalid_line" | "unknown_player" | "event_not_open" | "not_created" | (string & {});
|
|
274
|
+
/** What was sent for one market, as the exchange echoes it. */
|
|
275
|
+
interface MarketRequestEcho {
|
|
276
|
+
player_id?: string;
|
|
277
|
+
stat?: string;
|
|
278
|
+
prop_type?: string;
|
|
279
|
+
line?: number;
|
|
280
|
+
[key: string]: unknown;
|
|
281
|
+
}
|
|
282
|
+
/** The outcome for one requested market, in request order. */
|
|
283
|
+
type CreateMarketResult = {
|
|
284
|
+
status: "created";
|
|
285
|
+
market_id: string;
|
|
286
|
+
market: MarketRequestEcho;
|
|
287
|
+
} | {
|
|
288
|
+
status: "exists";
|
|
289
|
+
market_id: string;
|
|
290
|
+
market: MarketRequestEcho;
|
|
291
|
+
} | {
|
|
292
|
+
status: "rejected";
|
|
293
|
+
reason: MarketRejectionReason;
|
|
294
|
+
market: MarketRequestEcho;
|
|
295
|
+
};
|
|
296
|
+
/** Options for `STX.createMarkets()`. */
|
|
297
|
+
interface CreateMarketsOptions {
|
|
298
|
+
/**
|
|
299
|
+
* Check each market against the event's players and stats, and the line
|
|
300
|
+
* rule, before sending. Failing markets come back `rejected` without a
|
|
301
|
+
* request; the rest are sent with the event's own stat key. The exchange
|
|
302
|
+
* checks every market either way. Reads `eventPlayers()`, so the token also
|
|
303
|
+
* needs the `events` scope.
|
|
304
|
+
*/
|
|
305
|
+
validate?: boolean;
|
|
306
|
+
}
|
|
307
|
+
/** The most markets one `createMarkets()` call takes. */
|
|
308
|
+
declare const MAX_MARKETS_PER_REQUEST = 25;
|
|
309
|
+
/** Whether `line` is a valid line: positive and ending in `.5`. */
|
|
310
|
+
declare function isValidLine(line: unknown): boolean;
|
|
311
|
+
|
|
143
312
|
/**
|
|
144
313
|
* One account's balance and fee summary, in the dollar wire format.
|
|
145
314
|
*/
|
|
146
315
|
interface Balance {
|
|
147
316
|
/**
|
|
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
|
|
317
|
+
* The account's cash balance. Unaffected by placing an order, but not all of
|
|
318
|
+
* it may be available. In dollars. Money as a decimal string, as sent by the
|
|
150
319
|
* API.
|
|
151
320
|
*/
|
|
152
321
|
account_balance?: string | null;
|
|
@@ -283,8 +452,8 @@ interface Cancellation {
|
|
|
283
452
|
*/
|
|
284
453
|
order_id?: string | null;
|
|
285
454
|
/**
|
|
286
|
-
* The order status after cancelling, or a reason it was not cancelled
|
|
287
|
-
* "Order not found" for an unknown id.
|
|
455
|
+
* The order status after cancelling, or a reason it was not cancelled, such
|
|
456
|
+
* as "Order not found" for an unknown id.
|
|
288
457
|
*/
|
|
289
458
|
status?: string | null;
|
|
290
459
|
/** Fields the server added after this SDK was generated. */
|
|
@@ -307,7 +476,7 @@ interface Error$1 {
|
|
|
307
476
|
*/
|
|
308
477
|
interface Event {
|
|
309
478
|
/**
|
|
310
|
-
*
|
|
479
|
+
* Whether this event is archived.
|
|
311
480
|
*/
|
|
312
481
|
archived?: boolean | null;
|
|
313
482
|
/**
|
|
@@ -319,15 +488,16 @@ interface Event {
|
|
|
319
488
|
*/
|
|
320
489
|
event_id?: string | null;
|
|
321
490
|
/**
|
|
322
|
-
* The
|
|
491
|
+
* The type of this event, e.g. `ad_hoc`, `baseball_game`, `basketball_game`.
|
|
323
492
|
*/
|
|
324
493
|
event_type?: string | null;
|
|
325
494
|
/**
|
|
326
|
-
* The
|
|
495
|
+
* The event's participants, as an array of `{name, role, short_name,
|
|
496
|
+
* abbreviation}`.
|
|
327
497
|
*/
|
|
328
498
|
participants?: Array<Record<string, unknown>> | null;
|
|
329
499
|
/**
|
|
330
|
-
*
|
|
500
|
+
* Whether this event is promoted.
|
|
331
501
|
*/
|
|
332
502
|
promoted?: boolean | null;
|
|
333
503
|
/**
|
|
@@ -412,7 +582,7 @@ interface FeeTransaction {
|
|
|
412
582
|
*/
|
|
413
583
|
time?: string | null;
|
|
414
584
|
/**
|
|
415
|
-
* What moved the money or the points
|
|
585
|
+
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
416
586
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
417
587
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
418
588
|
* `fee_refund`, `casino`, `adjustment`, `loyalty`, `loyalty_points_rollup`,
|
|
@@ -435,13 +605,13 @@ interface Fill {
|
|
|
435
605
|
*/
|
|
436
606
|
action?: string | null;
|
|
437
607
|
/**
|
|
438
|
-
* Internal. Operator audit trail, not part of the supported contract
|
|
608
|
+
* Internal. Operator audit trail, not part of the supported contract; do not
|
|
439
609
|
* depend on it.
|
|
440
610
|
*/
|
|
441
611
|
admin_log?: Record<string, unknown> | null;
|
|
442
612
|
/**
|
|
443
|
-
* True if
|
|
444
|
-
* `
|
|
613
|
+
* True if STX has amended this trade. When true, compare `original_price` and
|
|
614
|
+
* `original_filled` against the current values.
|
|
445
615
|
*/
|
|
446
616
|
amended?: boolean | null;
|
|
447
617
|
/**
|
|
@@ -460,7 +630,7 @@ interface Fill {
|
|
|
460
630
|
*/
|
|
461
631
|
closed_fee?: string | null;
|
|
462
632
|
/**
|
|
463
|
-
*
|
|
633
|
+
* Realized profit or loss on the closed portion. Negative for a loss. In
|
|
464
634
|
* dollars. Money as a decimal string, as sent by the API.
|
|
465
635
|
*/
|
|
466
636
|
closed_net_pnl?: string | null;
|
|
@@ -475,7 +645,7 @@ interface Fill {
|
|
|
475
645
|
*/
|
|
476
646
|
closing?: string | null;
|
|
477
647
|
/**
|
|
478
|
-
* The
|
|
648
|
+
* The device associated with this trade.
|
|
479
649
|
*/
|
|
480
650
|
device_id?: string | null;
|
|
481
651
|
/**
|
|
@@ -489,13 +659,13 @@ interface Fill {
|
|
|
489
659
|
*/
|
|
490
660
|
expired_fee?: string | null;
|
|
491
661
|
/**
|
|
492
|
-
*
|
|
662
|
+
* Realized profit or loss on the expired portion. In dollars. Money as a
|
|
493
663
|
* decimal string, as sent by the API.
|
|
494
664
|
*/
|
|
495
665
|
expired_net_pnl?: string | null;
|
|
496
666
|
/**
|
|
497
|
-
* The profit or loss
|
|
498
|
-
*
|
|
667
|
+
* The profit or loss on the trade when the market expired. In dollars. Money
|
|
668
|
+
* as a decimal string, as sent by the API.
|
|
499
669
|
*/
|
|
500
670
|
expired_pnl?: string | null;
|
|
501
671
|
/**
|
|
@@ -521,12 +691,12 @@ interface Fill {
|
|
|
521
691
|
*/
|
|
522
692
|
ip_address?: string | null;
|
|
523
693
|
/**
|
|
524
|
-
* When
|
|
694
|
+
* When STX last amended this trade, as UNIX microseconds. Null unless
|
|
525
695
|
* `amended` is true.
|
|
526
696
|
*/
|
|
527
697
|
last_modified_at?: number | null;
|
|
528
698
|
/**
|
|
529
|
-
* Internal. Operator audit field, not part of the supported contract
|
|
699
|
+
* Internal. Operator audit field, not part of the supported contract; do not
|
|
530
700
|
* depend on it.
|
|
531
701
|
*/
|
|
532
702
|
last_modified_by_admin_id?: string | null;
|
|
@@ -568,7 +738,7 @@ interface Fill {
|
|
|
568
738
|
*/
|
|
569
739
|
original_risk?: string | null;
|
|
570
740
|
/**
|
|
571
|
-
* The original
|
|
741
|
+
* The original gain if the position wins, for the trade excluding `closed`.
|
|
572
742
|
* In dollars. Money as a decimal string, as sent by the API.
|
|
573
743
|
*/
|
|
574
744
|
original_to_win?: string | null;
|
|
@@ -583,8 +753,9 @@ interface Fill {
|
|
|
583
753
|
*/
|
|
584
754
|
pc_risk?: string | null;
|
|
585
755
|
/**
|
|
586
|
-
*
|
|
587
|
-
*
|
|
756
|
+
* What each contract gains if the position wins: `max_price - price` on a
|
|
757
|
+
* buy, `price` on a sell. In dollars. Money as a decimal string, as sent by
|
|
758
|
+
* the API.
|
|
588
759
|
*/
|
|
589
760
|
pc_to_win?: string | null;
|
|
590
761
|
/**
|
|
@@ -625,8 +796,8 @@ interface Fill {
|
|
|
625
796
|
*/
|
|
626
797
|
remaining_risk?: string | null;
|
|
627
798
|
/**
|
|
628
|
-
*
|
|
629
|
-
* string, as sent by the API.
|
|
799
|
+
* What the unsettled contracts gain if the position wins. In dollars. Money
|
|
800
|
+
* as a decimal string, as sent by the API.
|
|
630
801
|
*/
|
|
631
802
|
remaining_to_win?: string | null;
|
|
632
803
|
/**
|
|
@@ -639,14 +810,14 @@ interface Fill {
|
|
|
639
810
|
*/
|
|
640
811
|
settled_contracts?: string | null;
|
|
641
812
|
/**
|
|
642
|
-
* The number of settlements where this
|
|
813
|
+
* The number of settlements where this trade is the opening trade.
|
|
643
814
|
*/
|
|
644
815
|
settlements_count?: number | null;
|
|
645
816
|
/**
|
|
646
817
|
* Fill state. `created` once the matching engine has written the fill, `open`
|
|
647
818
|
* while the position is live, `settled` once it no longer contributes to a
|
|
648
|
-
* position, and `cancelled` if
|
|
649
|
-
* `
|
|
819
|
+
* position, and `cancelled` if STX reversed it. One of: `created`, `open`,
|
|
820
|
+
* `settled`, `cancelled`.
|
|
650
821
|
*/
|
|
651
822
|
status?: string | null;
|
|
652
823
|
/**
|
|
@@ -674,7 +845,7 @@ interface Fill {
|
|
|
674
845
|
traded_contracts?: string | null;
|
|
675
846
|
/**
|
|
676
847
|
* Fee before rounding. Use the rounded fee for reconciliation. In dollars.
|
|
677
|
-
* Carries up to 9 decimal places
|
|
848
|
+
* Carries up to 9 decimal places; parse money with a variable-scale decimal
|
|
678
849
|
* type, not a fixed-width one. Money as a decimal string, as sent by the API.
|
|
679
850
|
*/
|
|
680
851
|
unrounded_trade_fee?: string | null;
|
|
@@ -690,16 +861,162 @@ interface Fill {
|
|
|
690
861
|
/** Fields the server added after this SDK was generated. */
|
|
691
862
|
[key: string]: unknown;
|
|
692
863
|
}
|
|
864
|
+
/**
|
|
865
|
+
* One ranked board.
|
|
866
|
+
*/
|
|
867
|
+
interface Leaderboard {
|
|
868
|
+
/**
|
|
869
|
+
* `all` or a sport key.
|
|
870
|
+
*/
|
|
871
|
+
category?: string | null;
|
|
872
|
+
/**
|
|
873
|
+
* Ranked rows, best first, at most the number of members STX shows per board
|
|
874
|
+
* (never more than 100). Empty for a board STX hides.
|
|
875
|
+
*/
|
|
876
|
+
leaderboard?: LeaderboardEntry[] | null;
|
|
877
|
+
/**
|
|
878
|
+
* The metric the rows are ranked on. One of: `volume`, `profit`,
|
|
879
|
+
* `predictions`, `markets`, `win_rate`, `biggest_win`, `return`, `streak`.
|
|
880
|
+
*/
|
|
881
|
+
metric?: string | null;
|
|
882
|
+
/**
|
|
883
|
+
* When this period's board resets: local midnight in America/New_York on the
|
|
884
|
+
* next boundary, as UTC. `null` for `all`, which never resets, and before the
|
|
885
|
+
* first snapshot.
|
|
886
|
+
*/
|
|
887
|
+
next_reset_at?: string | null;
|
|
888
|
+
/**
|
|
889
|
+
* The period the board covers. One of: `daily`, `weekly`, `monthly`,
|
|
890
|
+
* `yearly`, `all`.
|
|
891
|
+
*/
|
|
892
|
+
period?: string | null;
|
|
893
|
+
/**
|
|
894
|
+
* When this snapshot was built. `null` before the first snapshot is
|
|
895
|
+
* published.
|
|
896
|
+
*/
|
|
897
|
+
refreshed_at?: string | null;
|
|
898
|
+
/**
|
|
899
|
+
* Whether STX shows this board to members. `false` means the board is hidden
|
|
900
|
+
* and `leaderboard` is empty, not that nobody has ranked yet.
|
|
901
|
+
*/
|
|
902
|
+
shown?: boolean | null;
|
|
903
|
+
/** Fields the server added after this SDK was generated. */
|
|
904
|
+
[key: string]: unknown;
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* One ranked member.
|
|
908
|
+
*/
|
|
909
|
+
interface LeaderboardEntry {
|
|
910
|
+
/**
|
|
911
|
+
* Path of the member's avatar, `/avatars/{handle}.svg`, relative to the API
|
|
912
|
+
* host. `null` when `handle` is `null`.
|
|
913
|
+
*/
|
|
914
|
+
avatar_url?: string | null;
|
|
915
|
+
/**
|
|
916
|
+
* The member's public handle. `null` for a member who has not set one.
|
|
917
|
+
*/
|
|
918
|
+
handle?: string | null;
|
|
919
|
+
/**
|
|
920
|
+
* Dense rank, 1-based. Tied values share a rank.
|
|
921
|
+
*/
|
|
922
|
+
rank?: number | null;
|
|
923
|
+
/**
|
|
924
|
+
* The sport the member traded most in the period, as a category key. On a
|
|
925
|
+
* sport board it is that sport. `null` when unknown.
|
|
926
|
+
*/
|
|
927
|
+
top_sport?: string | null;
|
|
928
|
+
/**
|
|
929
|
+
* Path of the sport's icon, the same category icon the apps use, relative to
|
|
930
|
+
* the API host. `null` when `top_sport` is `null`.
|
|
931
|
+
*/
|
|
932
|
+
top_sport_icon_url?: string | null;
|
|
933
|
+
/**
|
|
934
|
+
* The ranked value. A dollar string on money boards, an integer on count
|
|
935
|
+
* boards and a number from 0 to 1 on ratio boards.
|
|
936
|
+
*/
|
|
937
|
+
value?: unknown | null;
|
|
938
|
+
/** Fields the server added after this SDK was generated. */
|
|
939
|
+
[key: string]: unknown;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Your standing in one period and category.
|
|
943
|
+
*/
|
|
944
|
+
interface LeaderboardStanding {
|
|
945
|
+
/**
|
|
946
|
+
* Your rank and biggest single-market win; `null` when unranked or the board
|
|
947
|
+
* is hidden.
|
|
948
|
+
*/
|
|
949
|
+
biggest_win?: Record<string, unknown> | null;
|
|
950
|
+
/**
|
|
951
|
+
* The category asked for.
|
|
952
|
+
*/
|
|
953
|
+
category?: string | null;
|
|
954
|
+
/**
|
|
955
|
+
* Your rank and markets settled; `null` when unranked or the board is hidden.
|
|
956
|
+
*/
|
|
957
|
+
markets?: Record<string, unknown> | null;
|
|
958
|
+
/**
|
|
959
|
+
* Whether you appear on public boards. `false` is why every rank is `null`
|
|
960
|
+
* for an opted-out member.
|
|
961
|
+
*/
|
|
962
|
+
opted_in?: boolean | null;
|
|
963
|
+
/**
|
|
964
|
+
* The period asked for. One of: `daily`, `weekly`, `monthly`, `yearly`,
|
|
965
|
+
* `all`.
|
|
966
|
+
*/
|
|
967
|
+
period?: string | null;
|
|
968
|
+
/**
|
|
969
|
+
* Your rank and contracts settled; `null` when unranked or the board is
|
|
970
|
+
* hidden.
|
|
971
|
+
*/
|
|
972
|
+
predictions?: Record<string, unknown> | null;
|
|
973
|
+
/**
|
|
974
|
+
* Your rank and net profit; `null` when unranked or the board is hidden.
|
|
975
|
+
*/
|
|
976
|
+
profit?: Record<string, unknown> | null;
|
|
977
|
+
/**
|
|
978
|
+
* Your rank and return (profit ÷ volume), `0.0`-`1.0`; needs $500 of volume;
|
|
979
|
+
* `null` when unranked or the board is hidden.
|
|
980
|
+
*/
|
|
981
|
+
return?: Record<string, unknown> | null;
|
|
982
|
+
/**
|
|
983
|
+
* Markets decided (won or lost) in the period. `0` when unranked.
|
|
984
|
+
*/
|
|
985
|
+
settled_markets?: number | null;
|
|
986
|
+
/**
|
|
987
|
+
* Your rank and longest winning streak; `null` when unranked or the board is
|
|
988
|
+
* hidden.
|
|
989
|
+
*/
|
|
990
|
+
streak?: Record<string, unknown> | null;
|
|
991
|
+
/**
|
|
992
|
+
* Your rank and notional traded; `null` when unranked or the board is hidden.
|
|
993
|
+
*/
|
|
994
|
+
volume?: Record<string, unknown> | null;
|
|
995
|
+
/**
|
|
996
|
+
* Share of decided markets you won, `0.0`-`1.0`. `null` until at least 10
|
|
997
|
+
* markets have been decided in the period; a market settled at zero profit is
|
|
998
|
+
* neither a win nor a loss.
|
|
999
|
+
*/
|
|
1000
|
+
win_rate?: number | null;
|
|
1001
|
+
/**
|
|
1002
|
+
* Your rank and win rate, `0.0`-`1.0`; needs 10 decided markets to rank;
|
|
1003
|
+
* `null` when unranked or the board is hidden.
|
|
1004
|
+
*/
|
|
1005
|
+
win_rate_rank?: Record<string, unknown> | null;
|
|
1006
|
+
/** Fields the server added after this SDK was generated. */
|
|
1007
|
+
[key: string]: unknown;
|
|
1008
|
+
}
|
|
693
1009
|
/**
|
|
694
1010
|
* A market you can trade, with its book and event context.
|
|
695
1011
|
*/
|
|
696
1012
|
interface Market {
|
|
697
1013
|
/**
|
|
698
|
-
*
|
|
1014
|
+
* Whether the market is archived.
|
|
699
1015
|
*/
|
|
700
1016
|
archived?: boolean | null;
|
|
701
1017
|
/**
|
|
702
|
-
* The
|
|
1018
|
+
* The top bids on the market, sorted by price descending, so the best
|
|
1019
|
+
* (highest) bid is first.
|
|
703
1020
|
*/
|
|
704
1021
|
bids?: BookLevel[] | null;
|
|
705
1022
|
/**
|
|
@@ -735,15 +1052,15 @@ interface Market {
|
|
|
735
1052
|
*/
|
|
736
1053
|
event_type?: string | null;
|
|
737
1054
|
/**
|
|
738
|
-
*
|
|
1055
|
+
* Whether the market is featured.
|
|
739
1056
|
*/
|
|
740
1057
|
featured?: boolean | null;
|
|
741
1058
|
/**
|
|
742
|
-
*
|
|
1059
|
+
* Whether the market is featured on the home page.
|
|
743
1060
|
*/
|
|
744
1061
|
featured_home?: boolean | null;
|
|
745
1062
|
/**
|
|
746
|
-
* The
|
|
1063
|
+
* The categorizations under which the market appears. A list, not an object.
|
|
747
1064
|
*/
|
|
748
1065
|
filters?: MarketFilter[] | null;
|
|
749
1066
|
/**
|
|
@@ -752,7 +1069,7 @@ interface Market {
|
|
|
752
1069
|
group_title?: string | null;
|
|
753
1070
|
/**
|
|
754
1071
|
* Identity of the set of mutually exclusive outcomes this market prices
|
|
755
|
-
* against
|
|
1072
|
+
* against: the 30 World Series contracts, the 4 AFC East contracts, one
|
|
756
1073
|
* fixture's moneyline pair. Opaque: compare for equality, never parse. Stable
|
|
757
1074
|
* for the life of the market, and present in every status, so it is the field
|
|
758
1075
|
* to map market data on. Unlike `symbol`, it does not move when a fixture is
|
|
@@ -761,12 +1078,12 @@ interface Market {
|
|
|
761
1078
|
grouping_id?: string | null;
|
|
762
1079
|
/**
|
|
763
1080
|
* The grouping in words, e.g. `AL East Division`, `Spread - 1st Quarter`.
|
|
764
|
-
* Descriptive rather than stable
|
|
1081
|
+
* Descriptive rather than stable: for a tournament it is the event title,
|
|
765
1082
|
* which can be renamed. Display it; join on `grouping_id`.
|
|
766
1083
|
*/
|
|
767
1084
|
grouping_name?: string | null;
|
|
768
1085
|
/**
|
|
769
|
-
* The category in which the market appears: `Upcoming`, `Live` or `
|
|
1086
|
+
* The category in which the market appears: `Upcoming`, `Live` or `null`.
|
|
770
1087
|
*/
|
|
771
1088
|
home_category?: string | null;
|
|
772
1089
|
/**
|
|
@@ -789,7 +1106,7 @@ interface Market {
|
|
|
789
1106
|
last_traded_price?: string | null;
|
|
790
1107
|
/**
|
|
791
1108
|
* `true` when the probability was set by hand, `false` when it came from the
|
|
792
|
-
*
|
|
1109
|
+
* pricing feed. A flag, not a probability figure.
|
|
793
1110
|
*/
|
|
794
1111
|
manual_probability?: boolean | null;
|
|
795
1112
|
/**
|
|
@@ -797,13 +1114,14 @@ interface Market {
|
|
|
797
1114
|
*/
|
|
798
1115
|
market_id?: string | null;
|
|
799
1116
|
/**
|
|
800
|
-
* The
|
|
801
|
-
*
|
|
1117
|
+
* The settlement value of one winning contract, and the ceiling on order
|
|
1118
|
+
* prices: an order must price strictly below it. Read it per market. In
|
|
802
1119
|
* dollars. Money as a decimal string, as sent by the API.
|
|
803
1120
|
*/
|
|
804
1121
|
max_price?: string | null;
|
|
805
1122
|
/**
|
|
806
|
-
* The
|
|
1123
|
+
* The top offers on the market, sorted by price descending, so the best
|
|
1124
|
+
* (lowest) offer is last.
|
|
807
1125
|
*/
|
|
808
1126
|
offers?: BookLevel[] | null;
|
|
809
1127
|
/**
|
|
@@ -812,7 +1130,7 @@ interface Market {
|
|
|
812
1130
|
*/
|
|
813
1131
|
open_interest?: string | null;
|
|
814
1132
|
/**
|
|
815
|
-
* The
|
|
1133
|
+
* The participants of the market's event, as an array.
|
|
816
1134
|
*/
|
|
817
1135
|
participants?: Array<Record<string, unknown>> | null;
|
|
818
1136
|
/**
|
|
@@ -825,7 +1143,7 @@ interface Market {
|
|
|
825
1143
|
*/
|
|
826
1144
|
position?: string | null;
|
|
827
1145
|
/**
|
|
828
|
-
*
|
|
1146
|
+
* The provider used to result this market.
|
|
829
1147
|
*/
|
|
830
1148
|
powered_by?: Record<string, unknown> | null;
|
|
831
1149
|
/**
|
|
@@ -834,12 +1152,12 @@ interface Market {
|
|
|
834
1152
|
*/
|
|
835
1153
|
price?: string | null;
|
|
836
1154
|
/**
|
|
837
|
-
* The change in price over the last 24 hours, as a percentage. Not money
|
|
1155
|
+
* The change in price over the last 24 hours, as a percentage. Not money: it
|
|
838
1156
|
* stays a number and must not be divided by 100.
|
|
839
1157
|
*/
|
|
840
1158
|
price_change24h?: number | null;
|
|
841
1159
|
/**
|
|
842
|
-
*
|
|
1160
|
+
* The market's probability of the outcome, between 0 and 1.
|
|
843
1161
|
*/
|
|
844
1162
|
probability?: number | null;
|
|
845
1163
|
/**
|
|
@@ -881,8 +1199,8 @@ interface Market {
|
|
|
881
1199
|
*/
|
|
882
1200
|
stat_detail?: StatDetail | null;
|
|
883
1201
|
/**
|
|
884
|
-
* Market state. See [Market and order status](/concepts/market-status/)
|
|
885
|
-
*
|
|
1202
|
+
* Market state. See [Market and order status](/concepts/market-status/). Note
|
|
1203
|
+
* that a market with `status: open` may still report as suspended when
|
|
886
1204
|
* trading is halted. One of: `scheduled`, `pre_open`, `open`, `suspended`,
|
|
887
1205
|
* `closed`, `resulted`, `cancelled`, `voided`.
|
|
888
1206
|
*/
|
|
@@ -910,11 +1228,11 @@ interface Market {
|
|
|
910
1228
|
*/
|
|
911
1229
|
total_volume?: string | null;
|
|
912
1230
|
/**
|
|
913
|
-
*
|
|
1231
|
+
* Whether the market is accepting orders right now.
|
|
914
1232
|
*/
|
|
915
1233
|
trading?: boolean | null;
|
|
916
1234
|
/**
|
|
917
|
-
* The
|
|
1235
|
+
* The categorizations used for organizing trades, settlements and related
|
|
918
1236
|
* items. A list, not an object.
|
|
919
1237
|
*/
|
|
920
1238
|
trading_filters?: MarketFilter[] | null;
|
|
@@ -927,7 +1245,7 @@ interface Market {
|
|
|
927
1245
|
[key: string]: unknown;
|
|
928
1246
|
}
|
|
929
1247
|
/**
|
|
930
|
-
* One
|
|
1248
|
+
* One categorization this market appears under.
|
|
931
1249
|
*/
|
|
932
1250
|
interface MarketFilter {
|
|
933
1251
|
/**
|
|
@@ -939,7 +1257,7 @@ interface MarketFilter {
|
|
|
939
1257
|
*/
|
|
940
1258
|
grouping?: string | null;
|
|
941
1259
|
/**
|
|
942
|
-
* Whether the
|
|
1260
|
+
* Whether the categorization was assigned by hand.
|
|
943
1261
|
*/
|
|
944
1262
|
manual?: boolean | null;
|
|
945
1263
|
/**
|
|
@@ -958,7 +1276,7 @@ interface MarketFilter {
|
|
|
958
1276
|
[key: string]: unknown;
|
|
959
1277
|
}
|
|
960
1278
|
/**
|
|
961
|
-
* Your exposure and
|
|
1279
|
+
* Your exposure and realized result in one market.
|
|
962
1280
|
*/
|
|
963
1281
|
interface MarketStat {
|
|
964
1282
|
/**
|
|
@@ -966,8 +1284,8 @@ interface MarketStat {
|
|
|
966
1284
|
*/
|
|
967
1285
|
account_id?: string | null;
|
|
968
1286
|
/**
|
|
969
|
-
*
|
|
970
|
-
*
|
|
1287
|
+
* When the record was marked as archived. `null` until the market is
|
|
1288
|
+
* archived. UNIX microseconds.
|
|
971
1289
|
*/
|
|
972
1290
|
archived_at?: number | null;
|
|
973
1291
|
/**
|
|
@@ -1100,8 +1418,8 @@ interface MarketStat {
|
|
|
1100
1418
|
*/
|
|
1101
1419
|
contracts_in_buy_orders?: string | null;
|
|
1102
1420
|
/**
|
|
1103
|
-
* Sum of all
|
|
1104
|
-
*
|
|
1421
|
+
* Sum of all unmatched contracts in all orders: each order's `quantity` minus
|
|
1422
|
+
* its `filled`. Quantity as a decimal string, as sent by the API.
|
|
1105
1423
|
*/
|
|
1106
1424
|
contracts_in_orders?: string | null;
|
|
1107
1425
|
/**
|
|
@@ -1115,9 +1433,9 @@ interface MarketStat {
|
|
|
1115
1433
|
*/
|
|
1116
1434
|
contracts_settled?: string | null;
|
|
1117
1435
|
/**
|
|
1118
|
-
* The total number of
|
|
1119
|
-
* contracts are counted
|
|
1120
|
-
* Quantity as a decimal string, as sent by the API.
|
|
1436
|
+
* The total number of contracts traded (the sum of each fill's `filled`).
|
|
1437
|
+
* Only opening trades' contracts are counted, not contracts closing other
|
|
1438
|
+
* trades. Quantity as a decimal string, as sent by the API.
|
|
1121
1439
|
*/
|
|
1122
1440
|
contracts_traded?: string | null;
|
|
1123
1441
|
/**
|
|
@@ -1168,7 +1486,7 @@ interface MarketStat {
|
|
|
1168
1486
|
*/
|
|
1169
1487
|
inserted_at?: number | null;
|
|
1170
1488
|
/**
|
|
1171
|
-
*
|
|
1489
|
+
* When the last settlement was created. UNIX microseconds.
|
|
1172
1490
|
*/
|
|
1173
1491
|
last_settled_at?: number | null;
|
|
1174
1492
|
/**
|
|
@@ -1176,7 +1494,7 @@ interface MarketStat {
|
|
|
1176
1494
|
*/
|
|
1177
1495
|
market_id?: string | null;
|
|
1178
1496
|
/**
|
|
1179
|
-
* The market's maximum price
|
|
1497
|
+
* The market's maximum price: the settlement value of one winning contract.
|
|
1180
1498
|
* In dollars. Money as a decimal string, as sent by the API.
|
|
1181
1499
|
*/
|
|
1182
1500
|
market_max_price?: string | null;
|
|
@@ -1186,7 +1504,7 @@ interface MarketStat {
|
|
|
1186
1504
|
*/
|
|
1187
1505
|
max_liability_loss?: string | null;
|
|
1188
1506
|
/**
|
|
1189
|
-
* Worst-case loss if this market settles in
|
|
1507
|
+
* Worst-case loss if this market settles in favor of the position you hold.
|
|
1190
1508
|
* In dollars. Money as a decimal string, as sent by the API.
|
|
1191
1509
|
*/
|
|
1192
1510
|
max_liability_win?: string | null;
|
|
@@ -1258,7 +1576,7 @@ interface MarketStat {
|
|
|
1258
1576
|
*/
|
|
1259
1577
|
pending_close_fee?: string | null;
|
|
1260
1578
|
/**
|
|
1261
|
-
* Profit or loss that would be
|
|
1579
|
+
* Profit or loss that would be realized if the resting close orders all
|
|
1262
1580
|
* filled. In dollars. Money as a decimal string, as sent by the API.
|
|
1263
1581
|
*/
|
|
1264
1582
|
pending_close_pnl?: string | null;
|
|
@@ -1295,7 +1613,7 @@ interface MarketStat {
|
|
|
1295
1613
|
*/
|
|
1296
1614
|
rejected_sell_orders?: number | null;
|
|
1297
1615
|
/**
|
|
1298
|
-
* The total number of
|
|
1616
|
+
* The total number of sell contracts that were closed. Quantity as a decimal
|
|
1299
1617
|
* string, as sent by the API.
|
|
1300
1618
|
*/
|
|
1301
1619
|
sell_contracts_closed?: string | null;
|
|
@@ -1338,8 +1656,8 @@ interface MarketStat {
|
|
|
1338
1656
|
*/
|
|
1339
1657
|
sell_trade_count?: number | null;
|
|
1340
1658
|
/**
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1659
|
+
* When the expired settlements were recorded. `null` if the market has not
|
|
1660
|
+
* resulted or voided yet. UNIX microseconds.
|
|
1343
1661
|
*/
|
|
1344
1662
|
settled_at?: number | null;
|
|
1345
1663
|
/**
|
|
@@ -1366,7 +1684,7 @@ interface MarketStat {
|
|
|
1366
1684
|
*/
|
|
1367
1685
|
total_fees?: string | null;
|
|
1368
1686
|
/**
|
|
1369
|
-
* The liability affecting
|
|
1687
|
+
* The liability affecting available balance from open orders and position. In
|
|
1370
1688
|
* dollars. Money as a decimal string, as sent by the API.
|
|
1371
1689
|
*/
|
|
1372
1690
|
total_liability?: string | null;
|
|
@@ -1376,7 +1694,7 @@ interface MarketStat {
|
|
|
1376
1694
|
*/
|
|
1377
1695
|
total_net_pnl?: string | null;
|
|
1378
1696
|
/**
|
|
1379
|
-
* The total
|
|
1697
|
+
* The total profit or loss on all settlements. In dollars. Money as a decimal
|
|
1380
1698
|
* string, as sent by the API.
|
|
1381
1699
|
*/
|
|
1382
1700
|
total_settlement_pnl?: string | null;
|
|
@@ -1392,20 +1710,35 @@ interface MarketStat {
|
|
|
1392
1710
|
[key: string]: unknown;
|
|
1393
1711
|
}
|
|
1394
1712
|
/**
|
|
1395
|
-
* The account behind the
|
|
1713
|
+
* The account behind the credential.
|
|
1396
1714
|
*/
|
|
1397
1715
|
interface Me {
|
|
1398
1716
|
/**
|
|
1399
1717
|
* Your account id. Trades, settlements and balances are scoped to it.
|
|
1400
1718
|
*/
|
|
1401
1719
|
account_id?: string | null;
|
|
1720
|
+
/**
|
|
1721
|
+
* Path of your avatar, `/avatars/{handle}.svg`, relative to the API host.
|
|
1722
|
+
* `null` when `handle` is `null`.
|
|
1723
|
+
*/
|
|
1724
|
+
avatar_url?: string | null;
|
|
1402
1725
|
/**
|
|
1403
1726
|
* First name on the account, or `null` if no profile is loaded.
|
|
1404
1727
|
*/
|
|
1405
1728
|
first_name?: string | null;
|
|
1406
1729
|
/**
|
|
1407
|
-
*
|
|
1408
|
-
*
|
|
1730
|
+
* Your public handle, shown on the leaderboard in place of your name. `null`
|
|
1731
|
+
* until one is set.
|
|
1732
|
+
*/
|
|
1733
|
+
handle?: string | null;
|
|
1734
|
+
/**
|
|
1735
|
+
* When you may next change your handle. `null` means now; otherwise the end
|
|
1736
|
+
* of the 30-day window since the last change.
|
|
1737
|
+
*/
|
|
1738
|
+
handle_changeable_at?: string | null;
|
|
1739
|
+
/**
|
|
1740
|
+
* The id of the API key that signed this request: the value sent in the
|
|
1741
|
+
* access-key header. `null` on a bearer request.
|
|
1409
1742
|
*/
|
|
1410
1743
|
key_id?: string | null;
|
|
1411
1744
|
/**
|
|
@@ -1413,16 +1746,24 @@ interface Me {
|
|
|
1413
1746
|
*/
|
|
1414
1747
|
last_name?: string | null;
|
|
1415
1748
|
/**
|
|
1416
|
-
*
|
|
1749
|
+
* Whether you have consented to appear on public leaderboards. New accounts
|
|
1750
|
+
* start with the jurisdiction's default; accounts from before the leaderboard
|
|
1751
|
+
* start at `false`. Change it with `PATCH /api/v1/me/profile`.
|
|
1752
|
+
*/
|
|
1753
|
+
leaderboard_opt_in?: boolean | null;
|
|
1754
|
+
/**
|
|
1755
|
+
* How this request authenticated: `api_key` for a signed request, `bearer`
|
|
1756
|
+
* for a session token. One of: `api_key`, `bearer`.
|
|
1417
1757
|
*/
|
|
1418
1758
|
method?: string | null;
|
|
1419
1759
|
/**
|
|
1420
1760
|
* Access level granted to this key: `read_only`, or `read_write` for keys
|
|
1421
|
-
* that may place and cancel orders. One of:
|
|
1761
|
+
* that may place and cancel orders. `null` on a bearer request. One of:
|
|
1762
|
+
* `read_only`, `read_write`.
|
|
1422
1763
|
*/
|
|
1423
1764
|
scope?: string | null;
|
|
1424
1765
|
/**
|
|
1425
|
-
* Your user id. Substitute this into
|
|
1766
|
+
* Your user id. Substitute this into account channel topics such as
|
|
1426
1767
|
* `orders:{user_id}`.
|
|
1427
1768
|
*/
|
|
1428
1769
|
user_id?: string | null;
|
|
@@ -1443,7 +1784,7 @@ interface NewOrder {
|
|
|
1443
1784
|
*/
|
|
1444
1785
|
cancel_on_disconnect?: boolean | null;
|
|
1445
1786
|
/**
|
|
1446
|
-
* Your own reference, echoed back unchanged. A free-form string, not a UUID
|
|
1787
|
+
* Your own reference, echoed back unchanged. A free-form string, not a UUID;
|
|
1447
1788
|
* FIX clients routinely send ids like `my-order-001`.
|
|
1448
1789
|
*/
|
|
1449
1790
|
client_order_id?: string | null;
|
|
@@ -1461,6 +1802,19 @@ interface NewOrder {
|
|
|
1461
1802
|
* `good_till_time`. UNIX microseconds.
|
|
1462
1803
|
*/
|
|
1463
1804
|
expiration_time?: number | null;
|
|
1805
|
+
/**
|
|
1806
|
+
* Location code from the STX geolocation check, covering this order. Inside a
|
|
1807
|
+
* `POST /api/v1/orders/batched` leg it is ignored; send the batch's top-level
|
|
1808
|
+
* `geo_location` instead. Read only in environments that enforce geo-fencing,
|
|
1809
|
+
* and ignored elsewhere. Where it is read, omitting it is a 422 (`Placing
|
|
1810
|
+
* Order(s) from this IP address … is disallowed.`) unless that environment
|
|
1811
|
+
* accepts the network location the request arrives from in its place, which
|
|
1812
|
+
* it can refuse for an address identified as a VPN, proxy or hosting
|
|
1813
|
+
* provider. Do not rely on omitting it: send the code whenever you have one.
|
|
1814
|
+
* A code that is sent is always checked, so a bad one is a 422 even where
|
|
1815
|
+
* omitting it would have been accepted.
|
|
1816
|
+
*/
|
|
1817
|
+
geo_location?: string | null;
|
|
1464
1818
|
/**
|
|
1465
1819
|
* The market to place the order on.
|
|
1466
1820
|
*/
|
|
@@ -1471,16 +1825,15 @@ interface NewOrder {
|
|
|
1471
1825
|
*/
|
|
1472
1826
|
order_type?: string | null;
|
|
1473
1827
|
/**
|
|
1474
|
-
* Limit price in dollars, as a string
|
|
1475
|
-
*
|
|
1476
|
-
*
|
|
1477
|
-
*
|
|
1478
|
-
*
|
|
1479
|
-
* assuming a fixed ceiling. Required for `limit` orders and unused by
|
|
1828
|
+
* Limit price in dollars, as a string: `"0.42"` is 42 cents. A number is
|
|
1829
|
+
* rejected outright rather than reinterpreted, because a bare `42` could mean
|
|
1830
|
+
* 42 cents or 42 dollars and the wrong reading is off by 100x. Must be
|
|
1831
|
+
* strictly less than the market's `max_price`; read that per market rather
|
|
1832
|
+
* than assuming a fixed ceiling. Required for `limit` orders and unused by
|
|
1480
1833
|
* `market` orders, but validated whenever it is present: a malformed or
|
|
1481
1834
|
* sub-cent price is a 400 on a `market` order too, rather than being quietly
|
|
1482
1835
|
* 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
|
|
1836
|
+
* is. Must be greater than zero and a whole number of cents: at most two
|
|
1484
1837
|
* decimal places, not counting trailing zeros. So "0.42" and "0.4200" are the
|
|
1485
1838
|
* same accepted value, and "0.001" is rejected. Money as a decimal string, as
|
|
1486
1839
|
* sent by the API.
|
|
@@ -1489,7 +1842,7 @@ interface NewOrder {
|
|
|
1489
1842
|
/**
|
|
1490
1843
|
* Number of contracts, greater than zero, as a decimal string: `"10"` and
|
|
1491
1844
|
* `"10.00"` are read the same. A number is rejected rather than converted,
|
|
1492
|
-
* the same rule `price` follows, though for a different reason
|
|
1845
|
+
* the same rule `price` follows, though for a different reason: a float
|
|
1493
1846
|
* arrives as a binary double, so the size that rests on the book would not
|
|
1494
1847
|
* always be the size that was sent. More than nine decimal places is rounded.
|
|
1495
1848
|
* Responses always return it as a string.
|
|
@@ -1512,8 +1865,9 @@ interface Order {
|
|
|
1512
1865
|
*/
|
|
1513
1866
|
action?: string | null;
|
|
1514
1867
|
/**
|
|
1515
|
-
* Order size
|
|
1516
|
-
* quantity.
|
|
1868
|
+
* Order size in dollars, for an order entered by amount rather than by
|
|
1869
|
+
* contract quantity. `null` for orders placed through this API, which always
|
|
1870
|
+
* take a quantity. Money as a decimal string, as sent by the API.
|
|
1517
1871
|
*/
|
|
1518
1872
|
amount?: string | null;
|
|
1519
1873
|
/**
|
|
@@ -1547,6 +1901,12 @@ interface Order {
|
|
|
1547
1901
|
* The expiration time for time-based expiration. UNIX microseconds.
|
|
1548
1902
|
*/
|
|
1549
1903
|
expiration_time?: number | null;
|
|
1904
|
+
/**
|
|
1905
|
+
* When the contracts this order trades expire, as UNIX microseconds: the
|
|
1906
|
+
* market's expiration, copied onto the order when it is placed. `null` when
|
|
1907
|
+
* the market has no event. Not the same as `expiration_time`.
|
|
1908
|
+
*/
|
|
1909
|
+
expires_at?: number | null;
|
|
1550
1910
|
/**
|
|
1551
1911
|
* Contracts filled so far. Compare with `quantity` to get remaining size.
|
|
1552
1912
|
* Quantity as a decimal string, as sent by the API.
|
|
@@ -1583,11 +1943,13 @@ interface Order {
|
|
|
1583
1943
|
*/
|
|
1584
1944
|
market_id?: string | null;
|
|
1585
1945
|
/**
|
|
1586
|
-
* The odds
|
|
1946
|
+
* Legacy. The odds format (`decimal` or `american`) an order was entered in
|
|
1947
|
+
* on an STX app. `null` for orders placed through this API.
|
|
1587
1948
|
*/
|
|
1588
1949
|
odds_type?: string | null;
|
|
1589
1950
|
/**
|
|
1590
|
-
* The odds
|
|
1951
|
+
* Legacy. The odds an order was entered at on an STX app, as a string. `null`
|
|
1952
|
+
* for orders placed through this API.
|
|
1591
1953
|
*/
|
|
1592
1954
|
odds_value?: string | null;
|
|
1593
1955
|
/**
|
|
@@ -1599,9 +1961,9 @@ interface Order {
|
|
|
1599
1961
|
*/
|
|
1600
1962
|
placed_pre_start?: boolean | null;
|
|
1601
1963
|
/**
|
|
1602
|
-
* Limit price
|
|
1603
|
-
*
|
|
1604
|
-
* decimal places
|
|
1964
|
+
* Limit price, below the market's `max_price`; read that per market rather
|
|
1965
|
+
* than assuming a ceiling. Absent for market orders. In dollars. Carries up
|
|
1966
|
+
* to 7 decimal places; parse money with a variable-scale decimal type, not a
|
|
1605
1967
|
* fixed-width one. Money as a decimal string, as sent by the API.
|
|
1606
1968
|
*/
|
|
1607
1969
|
price?: string | null;
|
|
@@ -1614,7 +1976,7 @@ interface Order {
|
|
|
1614
1976
|
*/
|
|
1615
1977
|
rejection_reason?: string | null;
|
|
1616
1978
|
/**
|
|
1617
|
-
* Order state
|
|
1979
|
+
* Order state, one of nine. See [Market and order
|
|
1618
1980
|
* status](/concepts/market-status/#order-statuses) for the full set and which
|
|
1619
1981
|
* are terminal. One of: `created`, `requested`, `accepted`, `delayed`,
|
|
1620
1982
|
* `open`, `filled`, `rejected`, `cancelled`, `partially_cancelled`.
|
|
@@ -1695,7 +2057,7 @@ interface PaymentTransaction {
|
|
|
1695
2057
|
*/
|
|
1696
2058
|
time?: string | null;
|
|
1697
2059
|
/**
|
|
1698
|
-
* What moved the money or the points
|
|
2060
|
+
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
1699
2061
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
1700
2062
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
1701
2063
|
* `fee_refund`, `casino`, `adjustment`, `loyalty`, `loyalty_points_rollup`,
|
|
@@ -1751,7 +2113,7 @@ interface Position {
|
|
|
1751
2113
|
*/
|
|
1752
2114
|
max_potential_fee?: string | null;
|
|
1753
2115
|
/**
|
|
1754
|
-
* Total possible profit for the position if everything settles
|
|
2116
|
+
* Total possible profit for the position if everything settles favorably. In
|
|
1755
2117
|
* dollars. Money as a decimal string, as sent by the API.
|
|
1756
2118
|
*/
|
|
1757
2119
|
max_potential_profit?: string | null;
|
|
@@ -1804,7 +2166,7 @@ interface Position {
|
|
|
1804
2166
|
*/
|
|
1805
2167
|
total_fee?: string | null;
|
|
1806
2168
|
/**
|
|
1807
|
-
* Profit or loss
|
|
2169
|
+
* Profit or loss realized from settlements so far. In dollars. Money as a
|
|
1808
2170
|
* decimal string, as sent by the API.
|
|
1809
2171
|
*/
|
|
1810
2172
|
total_settlement_pnl?: string | null;
|
|
@@ -1812,12 +2174,38 @@ interface Position {
|
|
|
1812
2174
|
[key: string]: unknown;
|
|
1813
2175
|
}
|
|
1814
2176
|
/**
|
|
1815
|
-
*
|
|
2177
|
+
* The public-profile fields to change. Every key is optional, but at least one
|
|
2178
|
+
* is required.
|
|
2179
|
+
*/
|
|
2180
|
+
interface ProfileUpdate {
|
|
2181
|
+
/**
|
|
2182
|
+
* A new avatar. Any style/palette pairing renders; the seed selects the
|
|
2183
|
+
* pattern. `null` is refused (`400`).
|
|
2184
|
+
*/
|
|
2185
|
+
avatar?: Record<string, unknown> | null;
|
|
2186
|
+
/**
|
|
2187
|
+
* New public handle: 3-24 characters of lowercase letters, digits and inner
|
|
2188
|
+
* `.` or `_`; case is folded. Must be unused, not a reserved word and not
|
|
2189
|
+
* blocked. May be changed once every 30 days; re-sending your current handle
|
|
2190
|
+
* is not a change. A blank handle is refused (`422`).
|
|
2191
|
+
*/
|
|
2192
|
+
handle?: string | null;
|
|
2193
|
+
/**
|
|
2194
|
+
* Your consent to appear on public boards. `true` joins, `false` leaves; your
|
|
2195
|
+
* own standing is unaffected. Each change is recorded with its time. Joining
|
|
2196
|
+
* gives you a generated handle and avatar if you have none yet.
|
|
2197
|
+
*/
|
|
2198
|
+
leaderboard_opt_in?: boolean | null;
|
|
2199
|
+
/** Fields the server added after this SDK was generated. */
|
|
2200
|
+
[key: string]: unknown;
|
|
2201
|
+
}
|
|
2202
|
+
/**
|
|
2203
|
+
* One recent trade on the market.
|
|
1816
2204
|
*/
|
|
1817
2205
|
interface RecentTrade {
|
|
1818
2206
|
/**
|
|
1819
2207
|
* Which side took liquidity. `Trade.liquidity_taker/1` derives this from the
|
|
1820
|
-
* resting side, so the values are `buyer` and `seller
|
|
2208
|
+
* resting side, so the values are `buyer` and `seller`, not `buy`/`sell` as
|
|
1821
2209
|
* on an order's `action`. One of: `buyer`, `seller`.
|
|
1822
2210
|
*/
|
|
1823
2211
|
liquidity_taker?: string | null;
|
|
@@ -1967,7 +2355,7 @@ interface StatDetail {
|
|
|
1967
2355
|
*/
|
|
1968
2356
|
prop_type?: string | null;
|
|
1969
2357
|
/**
|
|
1970
|
-
* The stat
|
|
2358
|
+
* The stat the line is on, e.g. `passingYards`.
|
|
1971
2359
|
*/
|
|
1972
2360
|
stat?: string | null;
|
|
1973
2361
|
/**
|
|
@@ -2035,7 +2423,7 @@ interface Transaction {
|
|
|
2035
2423
|
*/
|
|
2036
2424
|
time?: string | null;
|
|
2037
2425
|
/**
|
|
2038
|
-
* What moved the money or the points
|
|
2426
|
+
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
2039
2427
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
2040
2428
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
2041
2429
|
* `fee_refund`, `casino`, `adjustment`, `loyalty`, `loyalty_points_rollup`,
|
|
@@ -2052,6 +2440,9 @@ type models_Cancellation = Cancellation;
|
|
|
2052
2440
|
type models_Event = Event;
|
|
2053
2441
|
type models_FeeTransaction = FeeTransaction;
|
|
2054
2442
|
type models_Fill = Fill;
|
|
2443
|
+
type models_Leaderboard = Leaderboard;
|
|
2444
|
+
type models_LeaderboardEntry = LeaderboardEntry;
|
|
2445
|
+
type models_LeaderboardStanding = LeaderboardStanding;
|
|
2055
2446
|
type models_Market = Market;
|
|
2056
2447
|
type models_MarketFilter = MarketFilter;
|
|
2057
2448
|
type models_MarketStat = MarketStat;
|
|
@@ -2060,16 +2451,17 @@ type models_NewOrder = NewOrder;
|
|
|
2060
2451
|
type models_Order = Order;
|
|
2061
2452
|
type models_PaymentTransaction = PaymentTransaction;
|
|
2062
2453
|
type models_Position = Position;
|
|
2454
|
+
type models_ProfileUpdate = ProfileUpdate;
|
|
2063
2455
|
type models_RecentTrade = RecentTrade;
|
|
2064
2456
|
type models_Settlement = Settlement;
|
|
2065
2457
|
type models_StatDetail = StatDetail;
|
|
2066
2458
|
type models_Transaction = Transaction;
|
|
2067
2459
|
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 };
|
|
2460
|
+
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
2461
|
}
|
|
2070
2462
|
|
|
2071
2463
|
interface Operation {
|
|
2072
|
-
readonly method: "GET" | "POST" | "DELETE";
|
|
2464
|
+
readonly method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
2073
2465
|
readonly path: string;
|
|
2074
2466
|
readonly query: readonly string[];
|
|
2075
2467
|
readonly pathParams: readonly string[];
|
|
@@ -2113,6 +2505,17 @@ declare const OPERATIONS: {
|
|
|
2113
2505
|
readonly isList: true;
|
|
2114
2506
|
readonly paginated: true;
|
|
2115
2507
|
};
|
|
2508
|
+
readonly events__id_players_get: {
|
|
2509
|
+
readonly method: "GET";
|
|
2510
|
+
readonly path: "/api/v1/events/{event_id}/players";
|
|
2511
|
+
readonly query: readonly [];
|
|
2512
|
+
readonly pathParams: readonly ["event_id"];
|
|
2513
|
+
readonly hasBody: false;
|
|
2514
|
+
readonly responseKey: "";
|
|
2515
|
+
readonly model: "";
|
|
2516
|
+
readonly isList: false;
|
|
2517
|
+
readonly paginated: false;
|
|
2518
|
+
};
|
|
2116
2519
|
readonly fills_get: {
|
|
2117
2520
|
readonly method: "GET";
|
|
2118
2521
|
readonly path: "/api/v1/fills";
|
|
@@ -2124,6 +2527,28 @@ declare const OPERATIONS: {
|
|
|
2124
2527
|
readonly isList: true;
|
|
2125
2528
|
readonly paginated: true;
|
|
2126
2529
|
};
|
|
2530
|
+
readonly leaderboard_get: {
|
|
2531
|
+
readonly method: "GET";
|
|
2532
|
+
readonly path: "/api/v1/leaderboard";
|
|
2533
|
+
readonly query: readonly ["period", "category", "metric", "limit"];
|
|
2534
|
+
readonly pathParams: readonly [];
|
|
2535
|
+
readonly hasBody: false;
|
|
2536
|
+
readonly responseKey: "";
|
|
2537
|
+
readonly model: "";
|
|
2538
|
+
readonly isList: false;
|
|
2539
|
+
readonly paginated: false;
|
|
2540
|
+
};
|
|
2541
|
+
readonly leaderboard_me_get: {
|
|
2542
|
+
readonly method: "GET";
|
|
2543
|
+
readonly path: "/api/v1/leaderboard/me";
|
|
2544
|
+
readonly query: readonly ["period", "category"];
|
|
2545
|
+
readonly pathParams: readonly [];
|
|
2546
|
+
readonly hasBody: false;
|
|
2547
|
+
readonly responseKey: "";
|
|
2548
|
+
readonly model: "";
|
|
2549
|
+
readonly isList: false;
|
|
2550
|
+
readonly paginated: false;
|
|
2551
|
+
};
|
|
2127
2552
|
readonly markets_get: {
|
|
2128
2553
|
readonly method: "GET";
|
|
2129
2554
|
readonly path: "/api/v1/markets";
|
|
@@ -2135,6 +2560,17 @@ declare const OPERATIONS: {
|
|
|
2135
2560
|
readonly isList: true;
|
|
2136
2561
|
readonly paginated: true;
|
|
2137
2562
|
};
|
|
2563
|
+
readonly markets_post: {
|
|
2564
|
+
readonly method: "POST";
|
|
2565
|
+
readonly path: "/api/v1/markets";
|
|
2566
|
+
readonly query: readonly [];
|
|
2567
|
+
readonly pathParams: readonly [];
|
|
2568
|
+
readonly hasBody: true;
|
|
2569
|
+
readonly responseKey: "";
|
|
2570
|
+
readonly model: "";
|
|
2571
|
+
readonly isList: false;
|
|
2572
|
+
readonly paginated: false;
|
|
2573
|
+
};
|
|
2138
2574
|
readonly me_get: {
|
|
2139
2575
|
readonly method: "GET";
|
|
2140
2576
|
readonly path: "/api/v1/me";
|
|
@@ -2146,6 +2582,17 @@ declare const OPERATIONS: {
|
|
|
2146
2582
|
readonly isList: false;
|
|
2147
2583
|
readonly paginated: false;
|
|
2148
2584
|
};
|
|
2585
|
+
readonly me_profile_patch: {
|
|
2586
|
+
readonly method: "PATCH";
|
|
2587
|
+
readonly path: "/api/v1/me/profile";
|
|
2588
|
+
readonly query: readonly [];
|
|
2589
|
+
readonly pathParams: readonly [];
|
|
2590
|
+
readonly hasBody: true;
|
|
2591
|
+
readonly responseKey: "me";
|
|
2592
|
+
readonly model: "Me";
|
|
2593
|
+
readonly isList: false;
|
|
2594
|
+
readonly paginated: false;
|
|
2595
|
+
};
|
|
2149
2596
|
readonly orders_get: {
|
|
2150
2597
|
readonly method: "GET";
|
|
2151
2598
|
readonly path: "/api/v1/orders";
|
|
@@ -2173,7 +2620,7 @@ declare const OPERATIONS: {
|
|
|
2173
2620
|
readonly path: "/api/v1/orders/all";
|
|
2174
2621
|
readonly query: readonly [];
|
|
2175
2622
|
readonly pathParams: readonly [];
|
|
2176
|
-
readonly hasBody:
|
|
2623
|
+
readonly hasBody: true;
|
|
2177
2624
|
readonly responseKey: "cancellations";
|
|
2178
2625
|
readonly model: "Cancellation";
|
|
2179
2626
|
readonly isList: true;
|
|
@@ -2206,7 +2653,7 @@ declare const OPERATIONS: {
|
|
|
2206
2653
|
readonly path: "/api/v1/orders/{order_id}";
|
|
2207
2654
|
readonly query: readonly [];
|
|
2208
2655
|
readonly pathParams: readonly ["order_id"];
|
|
2209
|
-
readonly hasBody:
|
|
2656
|
+
readonly hasBody: true;
|
|
2210
2657
|
readonly responseKey: "";
|
|
2211
2658
|
readonly model: "";
|
|
2212
2659
|
readonly isList: false;
|
|
@@ -2364,7 +2811,7 @@ declare class STXAPIException extends STXException {
|
|
|
2364
2811
|
declare class STXValidationException extends STXAPIException {
|
|
2365
2812
|
}
|
|
2366
2813
|
/**
|
|
2367
|
-
* 401: the signature, key
|
|
2814
|
+
* 401: the signature, key ID or timestamp was not accepted. A machine clock
|
|
2368
2815
|
* more than 30 seconds off also lands here.
|
|
2369
2816
|
*/
|
|
2370
2817
|
declare class STXAuthenticationException extends STXAPIException {
|
|
@@ -2525,7 +2972,7 @@ declare function loadPrivateKey(value: PrivateKeyInput): KeyObject;
|
|
|
2525
2972
|
*/
|
|
2526
2973
|
declare function signerFromPrivateKey(value: PrivateKeyInput): Signer;
|
|
2527
2974
|
/**
|
|
2528
|
-
* An STX API key: the key
|
|
2975
|
+
* An STX API key: the key ID sent with every request, and the means of
|
|
2529
2976
|
* signing. Build one from a PEM string or path:
|
|
2530
2977
|
*
|
|
2531
2978
|
* new ApiKeyCredentials("my-key-id", "~/.stx/ontario.pem")
|
|
@@ -2556,8 +3003,8 @@ declare class ApiKeyCredentials implements AuthProvider {
|
|
|
2556
3003
|
toString(): string;
|
|
2557
3004
|
}
|
|
2558
3005
|
|
|
2559
|
-
declare const VERSION = "0.
|
|
2560
|
-
declare const USER_AGENT = "stx-typescript/0.
|
|
3006
|
+
declare const VERSION = "0.8.0";
|
|
3007
|
+
declare const USER_AGENT = "stx-typescript/0.8.0";
|
|
2561
3008
|
/**
|
|
2562
3009
|
* `Symbol.asyncDispose` where the runtime has it (Node 20+, Bun), so
|
|
2563
3010
|
* `await using client = new STX()` works there; a registered stand-in on
|
|
@@ -2817,7 +3264,7 @@ interface STXWebSocketOptions extends Pick<STXOptions, "environment" | "region"
|
|
|
2817
3264
|
* Phoenix-channels client for the documented STX topics. Build it from an
|
|
2818
3265
|
* `STX` client, which supplies the host, the key and your user id:
|
|
2819
3266
|
*
|
|
2820
|
-
* const client = new STX(
|
|
3267
|
+
* const client = new STX();
|
|
2821
3268
|
* const ws = await client.websocket().connect();
|
|
2822
3269
|
* const book = await ws.orderbook(["<market-id>"], { onMessage: console.log });
|
|
2823
3270
|
* const orders = await ws.orders();
|
|
@@ -3007,7 +3454,7 @@ interface STXOptions {
|
|
|
3007
3454
|
env?: string | null;
|
|
3008
3455
|
/** A hostname or URL, overriding region/env: `"demo.stxapp.ca"`, `"http://localhost:4000"`. */
|
|
3009
3456
|
host?: string | null;
|
|
3010
|
-
/** The API key
|
|
3457
|
+
/** The API key ID. */
|
|
3011
3458
|
keyId?: string | null;
|
|
3012
3459
|
/** The Ed25519 private key: PEM text, a path to a PEM file, PEM bytes, or a KeyObject. */
|
|
3013
3460
|
privateKey?: PrivateKeyInput | null;
|
|
@@ -3082,6 +3529,7 @@ interface MarketsQuery {
|
|
|
3082
3529
|
eventIds?: StrList;
|
|
3083
3530
|
/** One status or a list, e.g. `["pre_open", "open"]`. */
|
|
3084
3531
|
status?: StrList;
|
|
3532
|
+
/** `true` for only the markets accepting orders now, `false` for only those that are not. */
|
|
3085
3533
|
trading?: boolean;
|
|
3086
3534
|
sports?: StrList;
|
|
3087
3535
|
competitions?: StrList;
|
|
@@ -3180,7 +3628,7 @@ declare function orderBody(marketId: string, action: string, orderType: string,
|
|
|
3180
3628
|
* The STX client. Configuration comes from the options, then
|
|
3181
3629
|
* environment variables, then a profile in ~/.stx/credentials:
|
|
3182
3630
|
*
|
|
3183
|
-
* const client = new STX(
|
|
3631
|
+
* const client = new STX();
|
|
3184
3632
|
* const me = await client.me();
|
|
3185
3633
|
* const page = await client.markets({ status: "open", limit: 10 });
|
|
3186
3634
|
*/
|
|
@@ -3211,11 +3659,6 @@ declare class STX {
|
|
|
3211
3659
|
* (`read_only` or `read_write`).
|
|
3212
3660
|
*/
|
|
3213
3661
|
me(): Promise<Me>;
|
|
3214
|
-
/**
|
|
3215
|
-
* @internal The cached `me()` when it has both ids, else a fresh `me()`.
|
|
3216
|
-
* Never falls back to `balance()`, so the channel fallbacks can use it.
|
|
3217
|
-
*/
|
|
3218
|
-
_identity(): Promise<Me>;
|
|
3219
3662
|
/**
|
|
3220
3663
|
* The user id from `me()`, fetched once and cached. If `me()` is not
|
|
3221
3664
|
* permitted, the id comes from `balance()`, which carries the same
|
|
@@ -3235,6 +3678,32 @@ declare class STX {
|
|
|
3235
3678
|
events(query?: EventsQuery): Promise<Page<Event>>;
|
|
3236
3679
|
/** Every event matching the filters, following the cursor. */
|
|
3237
3680
|
iterEvents(query?: WithoutCursor<EventsQuery>): AsyncGenerator<Event, void, undefined>;
|
|
3681
|
+
/**
|
|
3682
|
+
* `GET /api/v1/events/{event_id}/players`: the event's team rosters and the
|
|
3683
|
+
* stats a market on it can use. `teams` is empty until the rosters are
|
|
3684
|
+
* published. Needs an OAuth app token with `events`, or an API key.
|
|
3685
|
+
*/
|
|
3686
|
+
eventPlayers(eventId: string): Promise<EventPlayers>;
|
|
3687
|
+
/** The stats `event` accepts for new markets. */
|
|
3688
|
+
statsFor(event: string | {
|
|
3689
|
+
event_id?: string | null;
|
|
3690
|
+
}): Promise<EventStat[]>;
|
|
3691
|
+
/**
|
|
3692
|
+
* `POST /api/v1/markets`: create player-prop markets on a scheduled event,
|
|
3693
|
+
* up to `MAX_MARKETS_PER_REQUEST` per call. Needs an OAuth app token with
|
|
3694
|
+
* `markets.write`, which STX grants, from the client's IP allow-list.
|
|
3695
|
+
*
|
|
3696
|
+
* Returns one result per market, in order: `created` or `exists` (both with
|
|
3697
|
+
* `market_id`), or `rejected` with a `reason`. A rejected market is a
|
|
3698
|
+
* result, not an error, and resending is safe: a market that is already
|
|
3699
|
+
* listed comes back `exists`. A refused request throws (`403` without
|
|
3700
|
+
* `markets.write`, `404` unknown event, `422` event not open).
|
|
3701
|
+
*
|
|
3702
|
+
* Each `line` must be a positive number ending in `.5`, e.g. `18.5`. More
|
|
3703
|
+
* than `MAX_MARKETS_PER_REQUEST` markets throws `TypeError` before any
|
|
3704
|
+
* request. `validate` also needs the `events` scope.
|
|
3705
|
+
*/
|
|
3706
|
+
createMarkets(eventId: string, markets: readonly NewMarketInput[], opts?: CreateMarketsOptions): Promise<CreateMarketResult[]>;
|
|
3238
3707
|
/** `GET /api/v1/orders`: one page of your orders, newest first. */
|
|
3239
3708
|
orders(query?: OrdersQuery): Promise<Page<Order>>;
|
|
3240
3709
|
/** Every order matching the filters, following the cursor. */
|
|
@@ -3309,7 +3778,7 @@ declare class STX {
|
|
|
3309
3778
|
balance(): Promise<Balance>;
|
|
3310
3779
|
/**
|
|
3311
3780
|
* `GET /api/v1/account/market_stats`: your exposure and P&L per market.
|
|
3312
|
-
* Not the
|
|
3781
|
+
* Not the `market_stats` WebSocket channel, which carries price history.
|
|
3313
3782
|
*/
|
|
3314
3783
|
accountMarketStats(query?: MarketStatsQuery): Promise<Page<MarketStat>>;
|
|
3315
3784
|
/** Every per-market stat row, following the cursor. */
|
|
@@ -3357,4 +3826,4 @@ declare class STX {
|
|
|
3357
3826
|
websocket(opts?: Omit<STXWebSocketOptions, "rest">): STXWebSocket;
|
|
3358
3827
|
}
|
|
3359
3828
|
|
|
3360
|
-
export {
|
|
3829
|
+
export { type NewOrder as $, type AcceptTermsOptions as A, type Balance as B, type Cancellation as C, type GeoOption as D, Environment as E, type FeeTransaction as F, type GeoCheckResult as G, type GeoRejection as H, HOSTS as I, type KnownStat as J, KEY_HEADER as K, type Leaderboard as L, type LeaderboardEntry as M, type LeaderboardStanding as N, type Logger as O, MAX_MARKETS_PER_REQUEST as P, type Market as Q, type MarketFilter as R, type MarketRejectionReason as S, type MarketRequestEcho as T, type MarketStat as U, type MarketStatsQuery as V, type MarketsQuery as W, type Me as X, type MessageHandler as Y, NO_RETRY as Z, type NewMarketInput as _, type AccountChange as a, loadPrivateKey as a$, type NewOrderInput as a0, OPERATIONS as a1, type Operation as a2, type OperationId as a3, type Order as a4, type OrderOptions as a5, type OrdersQuery as a6, Page as a7, type PageQuery as a8, type PaymentTransaction as a9, STXRejectedException as aA, STXServerException as aB, STXTimeoutException as aC, STXTransportException as aD, STXValidationException as aE, STXWebSocket as aF, type STXWebSocketOptions as aG, type Settlement as aH, type SettlementsQuery as aI, type Signer as aJ, type Stat as aK, type StatDetail as aL, Stats as aM, type StrList as aN, TERMINAL_ORDER_STATUSES as aO, TIMESTAMP_HEADER as aP, type Transaction as aQ, USER_AGENT as aR, VERSION as aS, type WebSocketAuthContext as aT, baseUrlFor as aU, buildMessage as aV, environmentNamed as aW, errorForStatus as aX, geoRejection as aY, handshakePath as aZ, isValidLine as a_, type Position as aa, type PrivateKeyInput as ab, type ProfileUpdate as ac, type RecentTrade as ad, ReconnectPolicy as ae, type ReconnectPolicyOptions as af, Region as ag, type ResponseEvent as ah, RetryPolicy as ai, type RetryPolicyOptions as aj, SIGNATURE_HEADER as ak, SNAPSHOT_EVENTS as al, STX as am, STXAPIException as an, STXAuthenticationException as ao, STXChannelException as ap, STXConfigException as aq, type STXEnvironment as ar, STXException as as, STXForbiddenException as at, STXGeoLocationException as au, STXInsufficientScopeException as av, STXInvalidTokenException as aw, STXNotFoundException as ax, type STXOptions as ay, STXRateLimitException as az, type AccountChangeKind as b, models as b0, orderBody as b1, requestPath as b2, resolveHost as b3, signerFromPrivateKey as b4, socketUrlFor as b5, 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 CreateMarketResult as m, type CreateMarketsOptions as n, Environments as o, type Error$1 as p, type Event as q, type EventPlayer as r, type EventPlayers as s, type EventStat as t, type EventTeam as u, type EventsQuery as v, type FetchLike as w, type Fill as x, type FillsQuery as y, type GeoLocationProvider as z };
|