@stxapp/stx-typescript 0.8.3 → 0.9.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 +36 -0
- package/README.md +42 -0
- package/dist/{chunk-SIYERAKK.js → chunk-46XK6VDD.js} +406 -27
- package/dist/chunk-46XK6VDD.js.map +1 -0
- package/dist/{chunk-SI3EILHN.cjs → chunk-R77AZ5UH.cjs} +470 -91
- package/dist/chunk-R77AZ5UH.cjs.map +1 -0
- package/dist/{client-BrHjO1__.d.ts → client-B-MMKiRt.d.cts} +249 -17
- package/dist/{client-BrHjO1__.d.cts → client-B-MMKiRt.d.ts} +249 -17
- package/dist/index.cjs +14 -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 +13 -1
- package/dist/oauth.cjs +566 -94
- package/dist/oauth.cjs.map +1 -1
- package/dist/oauth.d.cts +264 -19
- package/dist/oauth.d.ts +264 -19
- package/dist/oauth.js +537 -65
- package/dist/oauth.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-SI3EILHN.cjs.map +0 -1
- package/dist/chunk-SIYERAKK.js.map +0 -1
|
@@ -30,6 +30,46 @@ interface WebSocketAuthContext {
|
|
|
30
30
|
reconnect?: boolean;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/** The features `STX.capabilities()` reports, by stable id. */
|
|
34
|
+
declare const FEATURES: readonly ["oauth", "oauth.member", "oauth.app", "connect", "terms.stx_page", "markets.create", "market_types", "event_players", "leaderboard", "combos"];
|
|
35
|
+
/** A feature id `STX.capabilities()` reports. */
|
|
36
|
+
type Feature = (typeof FEATURES)[number];
|
|
37
|
+
/**
|
|
38
|
+
* Per feature: `true` (the exchange has it), `false` (it does not), or `null`
|
|
39
|
+
* (not known: the check needs credentials this client does not have, or the
|
|
40
|
+
* exchange did not answer).
|
|
41
|
+
*/
|
|
42
|
+
type FeatureMap = Record<Feature, boolean | null>;
|
|
43
|
+
/** What `STX.capabilities()` found on one exchange. */
|
|
44
|
+
declare class Capabilities {
|
|
45
|
+
/** The exchange host, e.g. `"demo.stxapp.io"`. */
|
|
46
|
+
readonly host: string;
|
|
47
|
+
/** `GET /api_version`, e.g. `"3.3.196-rnd.9"`, or null when it did not answer. */
|
|
48
|
+
readonly apiVersion: string | null;
|
|
49
|
+
/** When the checks ran. */
|
|
50
|
+
readonly checkedAt: Date;
|
|
51
|
+
/** The scopes the exchange's OAuth discovery document lists; empty without OAuth. */
|
|
52
|
+
readonly scopesSupported: readonly string[];
|
|
53
|
+
/** Every feature and whether the exchange has it. */
|
|
54
|
+
readonly features: Readonly<FeatureMap>;
|
|
55
|
+
constructor(init: {
|
|
56
|
+
host: string;
|
|
57
|
+
apiVersion: string | null;
|
|
58
|
+
checkedAt: Date;
|
|
59
|
+
scopesSupported: readonly string[];
|
|
60
|
+
features: FeatureMap;
|
|
61
|
+
});
|
|
62
|
+
/** True only when the exchange is known to have `feature`. */
|
|
63
|
+
has(feature: Feature): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Throw `STXNotAvailableException` unless the exchange is known to have
|
|
66
|
+
* `feature`. A feature that could not be checked (`null`) does not throw:
|
|
67
|
+
* the call itself will say.
|
|
68
|
+
*/
|
|
69
|
+
require(feature: Feature): void;
|
|
70
|
+
toJSON(): Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
|
|
33
73
|
declare const Region: {
|
|
34
74
|
readonly US: "us";
|
|
35
75
|
readonly ONTARIO: "ontario";
|
|
@@ -252,6 +292,46 @@ interface EventPlayers {
|
|
|
252
292
|
stats: EventStat[];
|
|
253
293
|
[key: string]: unknown;
|
|
254
294
|
}
|
|
295
|
+
/** The stats one event type offers, in `STX.marketTypes()`. */
|
|
296
|
+
interface MarketTypeEventType {
|
|
297
|
+
/** The sport, e.g. `"Football"`. */
|
|
298
|
+
sport: string;
|
|
299
|
+
/** The stats on offer, sorted by `stat`. */
|
|
300
|
+
stats: EventStat[];
|
|
301
|
+
[key: string]: unknown;
|
|
302
|
+
}
|
|
303
|
+
/** One field a market entry takes besides `rule`. */
|
|
304
|
+
interface MarketTypeField {
|
|
305
|
+
/** Its JSON type, e.g. `"string"`. */
|
|
306
|
+
type: string;
|
|
307
|
+
/** What it takes. */
|
|
308
|
+
description: string;
|
|
309
|
+
[key: string]: unknown;
|
|
310
|
+
}
|
|
311
|
+
/** A market type `STX.createMarkets()` can create. */
|
|
312
|
+
interface CreatableMarketType {
|
|
313
|
+
partner_create: true;
|
|
314
|
+
/** The fields an entry takes besides `rule`, by wire name. */
|
|
315
|
+
fields: Record<string, MarketTypeField>;
|
|
316
|
+
/** The event types it runs on, keyed by event type, e.g. `"NFL"`. */
|
|
317
|
+
event_types: Record<string, MarketTypeEventType>;
|
|
318
|
+
[key: string]: unknown;
|
|
319
|
+
}
|
|
320
|
+
/** A market type STX lists but an app cannot create. */
|
|
321
|
+
interface ListedMarketType {
|
|
322
|
+
partner_create: false;
|
|
323
|
+
/** The event types it runs on. */
|
|
324
|
+
event_types: string[];
|
|
325
|
+
[key: string]: unknown;
|
|
326
|
+
}
|
|
327
|
+
/** One market type. `partner_create` says whether `STX.createMarkets()` takes it. */
|
|
328
|
+
type MarketType = CreatableMarketType | ListedMarketType;
|
|
329
|
+
/** `GET /api/v1/types`: the market types, keyed by rule. */
|
|
330
|
+
type MarketTypes = {
|
|
331
|
+
player_stat_line: CreatableMarketType;
|
|
332
|
+
} & {
|
|
333
|
+
[rule: string]: MarketType;
|
|
334
|
+
};
|
|
255
335
|
/** One market to create. */
|
|
256
336
|
interface NewMarketInput {
|
|
257
337
|
/**
|
|
@@ -274,6 +354,16 @@ interface NewMarketInput {
|
|
|
274
354
|
*/
|
|
275
355
|
propType?: "ou";
|
|
276
356
|
}
|
|
357
|
+
/** A player stat line: over/under one player's stat in one event. The same shape as `NewMarketInput`. */
|
|
358
|
+
type PlayerStatLineMarket = NewMarketInput;
|
|
359
|
+
/**
|
|
360
|
+
* One market to create. `rule` names the market type and decides the other
|
|
361
|
+
* fields; `STX.marketTypes()` lists the rules an app can create. Player stat
|
|
362
|
+
* lines are the only one today.
|
|
363
|
+
*/
|
|
364
|
+
type NewMarket = NewMarketInput;
|
|
365
|
+
/** A rule `STX.createMarkets()` takes. */
|
|
366
|
+
type MarketRule = NonNullable<NewMarketInput["rule"]>;
|
|
277
367
|
/** Why a market was not created. */
|
|
278
368
|
type MarketRejectionReason = "invalid_market" | "unsupported_rule" | "unsupported_stat" | "invalid_line" | "unknown_player" | "event_not_open" | "not_created" | (string & {});
|
|
279
369
|
/** The market a result is for, as it was requested. */
|
|
@@ -2784,6 +2874,17 @@ declare const OPERATIONS: {
|
|
|
2784
2874
|
readonly isList: false;
|
|
2785
2875
|
readonly paginated: false;
|
|
2786
2876
|
};
|
|
2877
|
+
readonly types_get: {
|
|
2878
|
+
readonly method: "GET";
|
|
2879
|
+
readonly path: "/api/v1/types";
|
|
2880
|
+
readonly query: readonly [];
|
|
2881
|
+
readonly pathParams: readonly [];
|
|
2882
|
+
readonly hasBody: false;
|
|
2883
|
+
readonly responseKey: "";
|
|
2884
|
+
readonly model: "";
|
|
2885
|
+
readonly isList: false;
|
|
2886
|
+
readonly paginated: false;
|
|
2887
|
+
};
|
|
2787
2888
|
};
|
|
2788
2889
|
type OperationId = keyof typeof OPERATIONS;
|
|
2789
2890
|
|
|
@@ -2869,6 +2970,29 @@ declare class STXInvalidTokenException extends STXAuthenticationException {
|
|
|
2869
2970
|
*/
|
|
2870
2971
|
declare class STXInsufficientScopeException extends STXForbiddenException {
|
|
2871
2972
|
}
|
|
2973
|
+
/**
|
|
2974
|
+
* 403 on an OAuth bearer request: the member has not accepted the current STX
|
|
2975
|
+
* terms, so the exchange places no orders for them through an app
|
|
2976
|
+
* (`{"error": "terms_required", "terms_url": "..."}`). The connection and the
|
|
2977
|
+
* tokens are fine, and reads and cancels keep working. Send the member's
|
|
2978
|
+
* browser to `termsUrl` (see `termsUrlWithReturn()`); once they have agreed on
|
|
2979
|
+
* the STX page, the same call works with the same tokens.
|
|
2980
|
+
*/
|
|
2981
|
+
declare class STXTermsRequiredException extends STXForbiddenException {
|
|
2982
|
+
/** The STX page where the member accepts the terms, when the answer names it. */
|
|
2983
|
+
readonly termsUrl: string | undefined;
|
|
2984
|
+
constructor(message: string, opts?: STXExceptionOptions & {
|
|
2985
|
+
termsUrl?: string;
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
/**
|
|
2989
|
+
* 403 on an OAuth bearer request: the token is fine, but the app's IP
|
|
2990
|
+
* allow-list does not include the address this write came from
|
|
2991
|
+
* (`{"error": "ip_not_allowed"}`). Reads keep working. Send writes from an
|
|
2992
|
+
* address on the allow-list you gave STX for this app. Never retried.
|
|
2993
|
+
*/
|
|
2994
|
+
declare class STXIPNotAllowedException extends STXForbiddenException {
|
|
2995
|
+
}
|
|
2872
2996
|
/** 404: the resource does not exist, or belongs to another account. */
|
|
2873
2997
|
declare class STXNotFoundException extends STXAPIException {
|
|
2874
2998
|
}
|
|
@@ -2928,12 +3052,48 @@ declare class STXChannelException extends STXException {
|
|
|
2928
3052
|
*/
|
|
2929
3053
|
declare class STXTimeoutException extends STXChannelException {
|
|
2930
3054
|
}
|
|
3055
|
+
/** The sentence an `STXNotAvailableException` carries: `Combos are not available on demo.stxapp.ca yet.` */
|
|
3056
|
+
declare function notAvailableMessage(feature: string, host: string): string;
|
|
3057
|
+
/**
|
|
3058
|
+
* This exchange does not have the feature yet: combos on an exchange without
|
|
3059
|
+
* them, OAuth where it is not switched on, a scope the exchange does not offer
|
|
3060
|
+
* in its jurisdiction. Nothing is wrong with the request or the credentials,
|
|
3061
|
+
* and nothing else is affected; the same call works on an exchange that has
|
|
3062
|
+
* the feature. `STX.capabilities()` says up front which features an exchange
|
|
3063
|
+
* has.
|
|
3064
|
+
*
|
|
3065
|
+
* `feature` is a stable id (`oauth`, `oauth.member`, `oauth.app`, `connect`,
|
|
3066
|
+
* `terms.stx_page`, `markets.create`, `market_types`, `event_players`,
|
|
3067
|
+
* `leaderboard`, `combos`, or `scope:<name>`); `host` is the exchange that answered.
|
|
3068
|
+
* `statusCode` and `body` are the HTTP answer the decision came from, when
|
|
3069
|
+
* there was one.
|
|
3070
|
+
*/
|
|
3071
|
+
declare class STXNotAvailableException extends STXAPIException {
|
|
3072
|
+
/** The feature id, e.g. `"combos"`. */
|
|
3073
|
+
readonly feature: string;
|
|
3074
|
+
/** The exchange host that lacks it, e.g. `"demo.stxapp.ca"`. */
|
|
3075
|
+
readonly host: string;
|
|
3076
|
+
constructor(feature: string, host: string, opts?: STXExceptionOptions & {
|
|
3077
|
+
message?: string;
|
|
3078
|
+
});
|
|
3079
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
3080
|
+
}
|
|
2931
3081
|
/**
|
|
2932
|
-
* Combos are not available on this
|
|
2933
|
-
*
|
|
2934
|
-
*
|
|
3082
|
+
* Combos are not available on this exchange: it refused the join to the
|
|
3083
|
+
* player or maker topic with `unmatched topic`. Nothing else is affected.
|
|
3084
|
+
*
|
|
3085
|
+
* A channel exception, as before, and also an `STXNotAvailableException`
|
|
3086
|
+
* (`instanceof` is true for both), with `feature` `"combos"` and `host`.
|
|
2935
3087
|
*/
|
|
2936
3088
|
declare class STXCombosUnavailableException extends STXChannelException {
|
|
3089
|
+
readonly feature = "combos";
|
|
3090
|
+
/** The exchange host that lacks combos. */
|
|
3091
|
+
readonly host: string;
|
|
3092
|
+
constructor(message: string, opts?: {
|
|
3093
|
+
topic?: string;
|
|
3094
|
+
reply?: unknown;
|
|
3095
|
+
host?: string;
|
|
3096
|
+
});
|
|
2937
3097
|
}
|
|
2938
3098
|
/**
|
|
2939
3099
|
* The exchange refused a combo command or join. `code` is the refusal
|
|
@@ -3078,8 +3238,8 @@ declare class ApiKeyCredentials implements AuthProvider {
|
|
|
3078
3238
|
toString(): string;
|
|
3079
3239
|
}
|
|
3080
3240
|
|
|
3081
|
-
declare const VERSION = "0.
|
|
3082
|
-
declare const USER_AGENT = "stx-typescript/0.
|
|
3241
|
+
declare const VERSION = "0.9.0";
|
|
3242
|
+
declare const USER_AGENT = "stx-typescript/0.9.0";
|
|
3083
3243
|
/**
|
|
3084
3244
|
* `Symbol.asyncDispose` where the runtime has it (Node 20+, Bun), so
|
|
3085
3245
|
* `await using client = new STX()` works there; a registered stand-in on
|
|
@@ -3426,7 +3586,16 @@ declare abstract class ComboSession<E extends {
|
|
|
3426
3586
|
}): Promise<Extract<E, {
|
|
3427
3587
|
event: K;
|
|
3428
3588
|
}>>;
|
|
3429
|
-
/**
|
|
3589
|
+
/**
|
|
3590
|
+
* Leave the topic. Requests opened and quotes placed on this channel end
|
|
3591
|
+
* (`cancelled`), as on any close, and delivery on this channel stops when
|
|
3592
|
+
* `leave()` resolves: the exchange's `negotiation_closed` for those requests
|
|
3593
|
+
* arrives after the channel has closed and is not passed to `onEvent` or to
|
|
3594
|
+
* an iterator. Treat every request still open here as cancelled once
|
|
3595
|
+
* `leave()` resolves. To see each request's own close first, `cancel()` it
|
|
3596
|
+
* and wait for its `negotiation_closed` before leaving. Other connections of
|
|
3597
|
+
* the same member still receive the close.
|
|
3598
|
+
*/
|
|
3430
3599
|
leave(): Promise<void>;
|
|
3431
3600
|
/** @internal Send a command and map a refusal to the combo exceptions. */
|
|
3432
3601
|
_command<T>(command: string, payload: Record<string, unknown>, timeoutMs?: number): Promise<T>;
|
|
@@ -3564,7 +3733,6 @@ declare class ReconnectPolicy {
|
|
|
3564
3733
|
constructor(opts?: ReconnectPolicyOptions);
|
|
3565
3734
|
delayMs(attempt: number): number;
|
|
3566
3735
|
}
|
|
3567
|
-
/** One joined topic. */
|
|
3568
3736
|
declare class Channel implements AsyncIterable<ChannelMessage> {
|
|
3569
3737
|
#private;
|
|
3570
3738
|
/** The wire topic, e.g. `orders:<user_id>`. */
|
|
@@ -3664,9 +3832,11 @@ interface STXWebSocketOptions extends Pick<STXOptions, "environment" | "region"
|
|
|
3664
3832
|
/** Milliseconds between socket heartbeats. The server closes a socket silent for 60 s. Default 25000. */
|
|
3665
3833
|
heartbeatIntervalMs?: number;
|
|
3666
3834
|
/**
|
|
3667
|
-
* Milliseconds between channel `ping` frames on every joined topic
|
|
3668
|
-
* disables them. `orders` with cancel-on-disconnect
|
|
3669
|
-
* granted timeout. Default 30000.
|
|
3835
|
+
* Milliseconds between channel `ping` frames on every joined topic that
|
|
3836
|
+
* answers them; `null` disables them. `orders` with cancel-on-disconnect
|
|
3837
|
+
* pings faster, from the granted timeout. Default 30000. The `market:<id>`,
|
|
3838
|
+
* `rfq:` and `combo_quote:` topics have no `ping` command and are never
|
|
3839
|
+
* pinged; the socket heartbeat keeps them alive.
|
|
3670
3840
|
*/
|
|
3671
3841
|
channelPingIntervalMs?: number | null;
|
|
3672
3842
|
/** Reconnect after a drop. Default true. */
|
|
@@ -3678,7 +3848,9 @@ interface STXWebSocketOptions extends Pick<STXOptions, "environment" | "region"
|
|
|
3678
3848
|
* Called when the socket gives up because its credentials are dead: an OAuth
|
|
3679
3849
|
* grant was revoked (`STXGrantRevokedException`), or the tokens are gone. The
|
|
3680
3850
|
* socket is closed by then; `ws.error` holds the same exception. Send the
|
|
3681
|
-
* member back through consent.
|
|
3851
|
+
* member back through consent. It is also called with
|
|
3852
|
+
* `STXAccountPendingException` while the member's STX account is still being
|
|
3853
|
+
* verified: their tokens are kept, so connect again once they are verified.
|
|
3682
3854
|
*/
|
|
3683
3855
|
onAuthError?: (err: STXException) => void;
|
|
3684
3856
|
/** Milliseconds to wait for a join or push reply. Default 10000. */
|
|
@@ -4036,6 +4208,15 @@ interface SettlementsQuery {
|
|
|
4036
4208
|
limit?: number;
|
|
4037
4209
|
cursor?: string;
|
|
4038
4210
|
}
|
|
4211
|
+
interface LeaderboardQuery {
|
|
4212
|
+
/** `daily`, `weekly`, `monthly`, `yearly` or `all`. */
|
|
4213
|
+
period?: "daily" | "weekly" | "monthly" | "yearly" | "all" | (string & {});
|
|
4214
|
+
/** `all` or a sport key. */
|
|
4215
|
+
category?: string;
|
|
4216
|
+
/** `volume`, `profit`, `predictions`, `markets`, `win_rate`, `biggest_win`, `return` or `streak`. */
|
|
4217
|
+
metric?: string;
|
|
4218
|
+
limit?: number;
|
|
4219
|
+
}
|
|
4039
4220
|
interface PageQuery {
|
|
4040
4221
|
limit?: number;
|
|
4041
4222
|
cursor?: string;
|
|
@@ -4099,6 +4280,26 @@ declare class STX {
|
|
|
4099
4280
|
_sleep: (ms: number) => Promise<void>;
|
|
4100
4281
|
constructor(opts?: STXOptions);
|
|
4101
4282
|
toString(): string;
|
|
4283
|
+
/** The exchange host, e.g. `"demo.stxapp.io"`: the name `STXNotAvailableException` and `capabilities()` report. */
|
|
4284
|
+
get host(): string;
|
|
4285
|
+
/**
|
|
4286
|
+
* Which features this exchange has, from what it publishes: its OAuth
|
|
4287
|
+
* discovery document, `/api_version`, a signed GET of the routes that not
|
|
4288
|
+
* every exchange has yet, and a join of a combos topic nobody owns. Nothing
|
|
4289
|
+
* is created or changed. Checked once per client and cached; pass
|
|
4290
|
+
* `{ refresh: true }` to check again.
|
|
4291
|
+
*
|
|
4292
|
+
* const caps = await stx.capabilities();
|
|
4293
|
+
* caps.features.combos; // false on demo.stxapp.ca
|
|
4294
|
+
* caps.require("combos"); // throws STXNotAvailableException there
|
|
4295
|
+
*
|
|
4296
|
+
* Each feature is `true`, `false`, or `null` when it could not be checked
|
|
4297
|
+
* (no credentials for a signed check, or no answer). A missing feature never
|
|
4298
|
+
* throws here; the call that needs it throws `STXNotAvailableException`.
|
|
4299
|
+
*/
|
|
4300
|
+
capabilities(opts?: {
|
|
4301
|
+
refresh?: boolean;
|
|
4302
|
+
}): Promise<Capabilities>;
|
|
4102
4303
|
/** Nothing to release (fetch pools connections itself); present so `await using` and explicit cleanup work. */
|
|
4103
4304
|
close(): Promise<void>;
|
|
4104
4305
|
/**
|
|
@@ -4137,9 +4338,19 @@ declare class STX {
|
|
|
4137
4338
|
event_id?: string | null;
|
|
4138
4339
|
}): Promise<EventStat[]>;
|
|
4139
4340
|
/**
|
|
4140
|
-
* `
|
|
4141
|
-
*
|
|
4142
|
-
* `
|
|
4341
|
+
* `GET /api/v1/types`: the market types, keyed by rule. One with
|
|
4342
|
+
* `partner_create: true` can be created with `createMarkets()`, and lists
|
|
4343
|
+
* the `fields` an entry takes and, per event type, the `stats` on offer. It
|
|
4344
|
+
* changes only when STX adds a rule or a stat, so read it once and keep it.
|
|
4345
|
+
* Needs an OAuth app token with `events`, or an API key.
|
|
4346
|
+
*/
|
|
4347
|
+
marketTypes(): Promise<MarketTypes>;
|
|
4348
|
+
/**
|
|
4349
|
+
* `POST /api/v1/markets`: create markets on a scheduled event, up to
|
|
4350
|
+
* `MAX_MARKETS_PER_REQUEST` per call. Each market names its `rule` and the
|
|
4351
|
+
* fields that rule takes. Needs an OAuth app token with `markets.write`,
|
|
4352
|
+
* which STX grants, from an address on the client's IP allow-list (it
|
|
4353
|
+
* applies to every call that client makes).
|
|
4143
4354
|
*
|
|
4144
4355
|
* Returns one result per market, in order: `created` or `exists` (both with
|
|
4145
4356
|
* `market_id`), `valid` with `dryRun`, or `rejected` with a `reason`. Each
|
|
@@ -4154,7 +4365,7 @@ declare class STX {
|
|
|
4154
4365
|
* request. `dryRun` runs every check and creates nothing. `validate` also
|
|
4155
4366
|
* needs the `events` scope.
|
|
4156
4367
|
*/
|
|
4157
|
-
createMarkets(eventId: string, markets: readonly
|
|
4368
|
+
createMarkets(eventId: string, markets: readonly NewMarket[], opts?: CreateMarketsOptions): Promise<CreateMarketResult[]>;
|
|
4158
4369
|
/** `GET /api/v1/orders`: one page of your orders, newest first. */
|
|
4159
4370
|
orders(query?: OrdersQuery): Promise<Page<Order>>;
|
|
4160
4371
|
/** Every order matching the filters, following the cursor. */
|
|
@@ -4268,7 +4479,28 @@ declare class STX {
|
|
|
4268
4479
|
iterLoyalty(query?: {
|
|
4269
4480
|
limit?: number;
|
|
4270
4481
|
}): AsyncGenerator<Transaction, void, undefined>;
|
|
4271
|
-
/**
|
|
4482
|
+
/**
|
|
4483
|
+
* `GET /api/v1/leaderboard`: ranked members for a period, sport and metric.
|
|
4484
|
+
* Rows carry a public handle and avatar, never an account id. Throws
|
|
4485
|
+
* `STXNotAvailableException` (feature `leaderboard`) where the exchange does
|
|
4486
|
+
* not have the leaderboard.
|
|
4487
|
+
*/
|
|
4488
|
+
leaderboard(query?: LeaderboardQuery): Promise<Leaderboard>;
|
|
4489
|
+
/** `GET /api/v1/leaderboard/me`: your own standing, including your rank outside the list. */
|
|
4490
|
+
leaderboardMe(query?: Pick<LeaderboardQuery, "period" | "category">): Promise<LeaderboardStanding>;
|
|
4491
|
+
/**
|
|
4492
|
+
* `PATCH /api/v1/me/profile`: change your public handle, avatar or
|
|
4493
|
+
* leaderboard opt-in. Resolves to the updated `me`.
|
|
4494
|
+
*/
|
|
4495
|
+
updateProfile(update: ProfileUpdate): Promise<Me>;
|
|
4496
|
+
/**
|
|
4497
|
+
* `POST /api/v1/tnc/accept`: accept the current terms for your own account,
|
|
4498
|
+
* with your own API key. Resolves to the server's message.
|
|
4499
|
+
*
|
|
4500
|
+
* An app cannot accept the terms for a member: called with a member's OAuth
|
|
4501
|
+
* access token, the exchange answers 403 `terms_not_delegable`
|
|
4502
|
+
* (`STXForbiddenException`). The member accepts on an STX page instead.
|
|
4503
|
+
*/
|
|
4272
4504
|
acceptTerms(deviceId: string, opts?: AcceptTermsOptions): Promise<string>;
|
|
4273
4505
|
/**
|
|
4274
4506
|
* An `STXWebSocket` using this client's host and key. Account channels
|
|
@@ -4277,4 +4509,4 @@ declare class STX {
|
|
|
4277
4509
|
websocket(opts?: Omit<STXWebSocketOptions, "rest">): STXWebSocket;
|
|
4278
4510
|
}
|
|
4279
4511
|
|
|
4280
|
-
export { type
|
|
4512
|
+
export { type EventPlayers as $, type AcceptTermsOptions as A, type Balance as B, type Cancellation as C, ComboPlayer as D, type ComboPlayerEvent as E, type ComboQuoteAcceptedEvent as F, type ComboQuoteClosedEvent as G, type ComboQuoteClosedReason as H, type ComboQuoteReply as I, type ComboRefusalReason as J, type ComboRequestClosedEvent as K, type ComboRequestClosedReason as L, type ComboRequestReply as M, type ComboRfqClosedEvent as N, type ComboRfqClosedReason as O, type ComboRfqLeg as P, type ComboRfqOpenedEvent as Q, type ComboSnapshot as R, type ComboWithdrawReply as S, type CreatableMarketType as T, type CreateMarketResult as U, type CreateMarketsOptions as V, Environment as W, Environments as X, type Error$1 as Y, type Event as Z, type EventPlayer as _, type AccountChange as a, SIGNATURE_HEADER as a$, type EventStat as a0, type EventTeam as a1, type EventsQuery as a2, FEATURES as a3, type Feature as a4, type FeatureMap as a5, type FeeTransaction as a6, type FetchLike as a7, type Fill as a8, type FillsQuery as a9, type Me as aA, type MessageHandler as aB, NO_RETRY as aC, type NewMarket as aD, type NewMarketInput as aE, type NewOrder as aF, type NewOrderInput as aG, OPERATIONS as aH, type Operation as aI, type OperationId as aJ, type Order as aK, type OrderOptions as aL, type OrdersQuery as aM, Page as aN, type PageQuery as aO, type PaymentTransaction as aP, type PlayerStatLineMarket as aQ, type Position as aR, type PrivateKeyInput as aS, type ProfileUpdate as aT, type RecentTrade as aU, ReconnectPolicy as aV, type ReconnectPolicyOptions as aW, Region as aX, type ResponseEvent as aY, RetryPolicy as aZ, type RetryPolicyOptions as a_, type GeoCheckResult as aa, type GeoLocationProvider as ab, type GeoOption as ac, type GeoRejection as ad, HOSTS as ae, KEY_HEADER as af, type KnownStat as ag, type Leaderboard as ah, type LeaderboardEntry as ai, type LeaderboardQuery as aj, type LeaderboardStanding as ak, type ListedMarketType as al, type Logger as am, MAX_MARKETS_PER_REQUEST as an, type Market as ao, type MarketFilter as ap, type MarketRejectionReason as aq, type MarketRequestEcho as ar, type MarketRule as as, type MarketStat as at, type MarketStatsQuery as au, type MarketType as av, type MarketTypeEventType as aw, type MarketTypeField as ax, type MarketTypes as ay, type MarketsQuery as az, type AccountChangeKind as b, SNAPSHOT_EVENTS as b0, STX as b1, STXAPIException as b2, STXAuthenticationException as b3, STXChannelException as b4, STXComboPriceMovedException as b5, STXComboRefusedException as b6, STXCombosUnavailableException as b7, STXConfigException as b8, type STXEnvironment as b9, TIMESTAMP_HEADER as bA, type Transaction as bB, USER_AGENT as bC, VERSION as bD, type WebSocketAuthContext as bE, baseUrlFor as bF, buildMessage as bG, environmentNamed as bH, errorForStatus as bI, geoRejection as bJ, handshakePath as bK, isValidLine as bL, loadPrivateKey as bM, models as bN, notAvailableMessage as bO, orderBody as bP, requestPath as bQ, resolveHost as bR, signerFromPrivateKey as bS, socketUrlFor as bT, STXException as ba, STXForbiddenException as bb, STXGeoLocationException as bc, STXIPNotAllowedException as bd, STXInsufficientScopeException as be, STXInvalidTokenException as bf, STXNotAvailableException as bg, STXNotFoundException as bh, type STXOptions as bi, STXRateLimitException as bj, STXRejectedException as bk, STXServerException as bl, STXTermsRequiredException as bm, STXTimeoutException as bn, STXTransportException as bo, STXValidationException as bp, STXWebSocket as bq, type STXWebSocketOptions as br, type Settlement as bs, type SettlementsQuery as bt, type Signer as bu, type Stat as bv, type StatDetail as bw, Stats as bx, type StrList as by, TERMINAL_ORDER_STATUSES as bz, type AccountState as c, AccountView as d, type AccountViewOptions as e, ApiKeyCredentials as f, type AuthProvider as g, type AuthRequest as h, type BatchOrderResult as i, type BookLevel as j, Capabilities as k, Channel as l, ChannelMessage as m, type ComboBestQuote as n, type ComboBestQuoteEvent as o, type ComboCancelReply as p, type ComboCashOutReply as q, type ComboJoinOptions as r, type ComboJoinReply as s, type ComboLeg as t, ComboMaker as u, type ComboMakerEvent as v, type ComboMakerPlacedEvent as w, type ComboOutcome as x, type ComboPlacedEvent as y, type ComboPlacement as z };
|