@stxapp/stx-typescript 0.10.0 → 0.12.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 +21 -0
- package/README.md +2 -0
- package/dist/{chunk-42OCIF3G.cjs → chunk-B3JQFXMJ.cjs} +198 -46
- package/dist/chunk-B3JQFXMJ.cjs.map +1 -0
- package/dist/{chunk-FTZCBXT7.js → chunk-JJRK3Z27.js} +169 -17
- package/dist/chunk-JJRK3Z27.js.map +1 -0
- package/dist/{client-DJr0UUvB.d.cts → client-CwshT5D4.d.cts} +211 -36
- package/dist/{client-DJr0UUvB.d.ts → client-CwshT5D4.d.ts} +211 -36
- package/dist/index.cjs +12 -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 +11 -1
- package/dist/oauth.cjs +30 -30
- package/dist/oauth.d.cts +2 -2
- package/dist/oauth.d.ts +2 -2
- package/dist/oauth.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-42OCIF3G.cjs.map +0 -1
- package/dist/chunk-FTZCBXT7.js.map +0 -1
|
@@ -671,8 +671,8 @@ interface FeeTransaction {
|
|
|
671
671
|
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
672
672
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
673
673
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
674
|
-
* `fee_refund`, `casino`, `adjustment`, `loyalty`,
|
|
675
|
-
* `loyalty_points_referral`.
|
|
674
|
+
* `fee_refund`, `maker_rebate`, `casino`, `adjustment`, `loyalty`,
|
|
675
|
+
* `loyalty_points_rollup`, `loyalty_points_referral`.
|
|
676
676
|
*/
|
|
677
677
|
type?: string | null;
|
|
678
678
|
/** Fields the server added after this SDK was generated. */
|
|
@@ -912,12 +912,13 @@ interface Fill {
|
|
|
912
912
|
time?: string | null;
|
|
913
913
|
/**
|
|
914
914
|
* Sum of on-trade fee plus fees paid from settlements linked with the trade.
|
|
915
|
-
*
|
|
915
|
+
* Negative when a maker rebate exceeds the fees paid. In dollars. Money as a
|
|
916
|
+
* decimal string, as sent by the API.
|
|
916
917
|
*/
|
|
917
918
|
total_fee?: string | null;
|
|
918
919
|
/**
|
|
919
|
-
* Per-trade fee (on-trade fee schedule). Included in total_fee.
|
|
920
|
-
* Money as a decimal string, as sent by the API.
|
|
920
|
+
* Per-trade fee (on-trade fee schedule). Included in total_fee. Negative for
|
|
921
|
+
* a maker rebate. In dollars. Money as a decimal string, as sent by the API.
|
|
921
922
|
*/
|
|
922
923
|
trade_fee?: string | null;
|
|
923
924
|
/**
|
|
@@ -930,9 +931,10 @@ interface Fill {
|
|
|
930
931
|
*/
|
|
931
932
|
traded_contracts?: string | null;
|
|
932
933
|
/**
|
|
933
|
-
* Fee before rounding. Use the rounded fee for
|
|
934
|
-
* Carries up to 9 decimal places; parse money
|
|
935
|
-
* type, not a fixed-width one. Money as a
|
|
934
|
+
* Fee before rounding; negative for a maker rebate. Use the rounded fee for
|
|
935
|
+
* reconciliation. In dollars. Carries up to 9 decimal places; parse money
|
|
936
|
+
* with a variable-scale decimal type, not a fixed-width one. Money as a
|
|
937
|
+
* decimal string, as sent by the API.
|
|
936
938
|
*/
|
|
937
939
|
unrounded_trade_fee?: string | null;
|
|
938
940
|
/**
|
|
@@ -947,6 +949,28 @@ interface Fill {
|
|
|
947
949
|
/** Fields the server added after this SDK was generated. */
|
|
948
950
|
[key: string]: unknown;
|
|
949
951
|
}
|
|
952
|
+
/**
|
|
953
|
+
* The 403 failure envelope. A refusal on the member's STX terms adds
|
|
954
|
+
* `error_description` and `terms_url` to `error`.
|
|
955
|
+
*/
|
|
956
|
+
interface ForbiddenError {
|
|
957
|
+
/**
|
|
958
|
+
* Failure reason: `terms_required` or `terms_not_delegable` for a terms
|
|
959
|
+
* refusal, otherwise a human-readable message.
|
|
960
|
+
*/
|
|
961
|
+
error?: string | null;
|
|
962
|
+
/**
|
|
963
|
+
* Present on a terms refusal: what the app should do, in plain words.
|
|
964
|
+
*/
|
|
965
|
+
error_description?: string | null;
|
|
966
|
+
/**
|
|
967
|
+
* Present on a terms refusal: the STX page where the member accepts the
|
|
968
|
+
* terms, e.g. `<STX host>/connect/terms?client_id=<client_id>`.
|
|
969
|
+
*/
|
|
970
|
+
terms_url?: string | null;
|
|
971
|
+
/** Fields the server added after this SDK was generated. */
|
|
972
|
+
[key: string]: unknown;
|
|
973
|
+
}
|
|
950
974
|
/**
|
|
951
975
|
* One ranked board.
|
|
952
976
|
*/
|
|
@@ -1199,6 +1223,12 @@ interface Market {
|
|
|
1199
1223
|
* The market this record relates to.
|
|
1200
1224
|
*/
|
|
1201
1225
|
market_id?: string | null;
|
|
1226
|
+
/**
|
|
1227
|
+
* The contract rules document for this market, as a PDF, the same version as
|
|
1228
|
+
* `rules_version`. `null` where rules documents are not published, or before
|
|
1229
|
+
* one takes effect.
|
|
1230
|
+
*/
|
|
1231
|
+
market_rules_pdf_url?: string | null;
|
|
1202
1232
|
/**
|
|
1203
1233
|
* The settlement value of one winning contract, and the ceiling on order
|
|
1204
1234
|
* prices: an order must price strictly below it. Read it per market. In
|
|
@@ -1229,7 +1259,7 @@ interface Market {
|
|
|
1229
1259
|
*/
|
|
1230
1260
|
position?: string | null;
|
|
1231
1261
|
/**
|
|
1232
|
-
* The provider used to result this market.
|
|
1262
|
+
* The provider used to result this market, or `null` when there is none.
|
|
1233
1263
|
*/
|
|
1234
1264
|
powered_by?: Record<string, unknown> | null;
|
|
1235
1265
|
/**
|
|
@@ -1262,6 +1292,11 @@ interface Market {
|
|
|
1262
1292
|
* The rules for this market.
|
|
1263
1293
|
*/
|
|
1264
1294
|
rules?: string | null;
|
|
1295
|
+
/**
|
|
1296
|
+
* The version number of the contract rules document in force for this market.
|
|
1297
|
+
* `null` where rules documents are not published, or before one takes effect.
|
|
1298
|
+
*/
|
|
1299
|
+
rules_version?: number | null;
|
|
1265
1300
|
/**
|
|
1266
1301
|
* When the market was resulted or voided. A raw microsecond integer, unlike
|
|
1267
1302
|
* the ISO-8601 `timestamp` and `event_start` beside it. UNIX microseconds.
|
|
@@ -1888,6 +1923,22 @@ interface NewOrder {
|
|
|
1888
1923
|
* `good_till_time`. UNIX microseconds.
|
|
1889
1924
|
*/
|
|
1890
1925
|
expiration_time?: number | null;
|
|
1926
|
+
/**
|
|
1927
|
+
* `post_only` makes a limit order rest only as a maker. When it would match
|
|
1928
|
+
* on arrival, it is cancelled with `cancellation_reason` `auto_matching` and
|
|
1929
|
+
* the response carries the cancelled order; when the first order it would
|
|
1930
|
+
* match is your own, it is a 422 (`match_with_self`). `fill_or_kill` makes a
|
|
1931
|
+
* limit order fill in full when it is matched, at its price or better, or not
|
|
1932
|
+
* at all. The response carries it `accepted` before it is matched, or
|
|
1933
|
+
* `delayed` during the in-play delay; it then becomes `filled`, or
|
|
1934
|
+
* `cancelled` with `cancellation_reason` `auto_matching`, nothing filled and
|
|
1935
|
+
* nothing left on the book, or `rejected` for a reason any order can be
|
|
1936
|
+
* (`match_with_self`, `market_liability_limit`). Either is a 400 on a
|
|
1937
|
+
* `market` order or where it is not enabled, and a 422 on a combination
|
|
1938
|
+
* market. `normal` is the default; any other value is a 400. One of:
|
|
1939
|
+
* `normal`, `post_only`, `fill_or_kill`.
|
|
1940
|
+
*/
|
|
1941
|
+
fill_mode?: string | null;
|
|
1891
1942
|
/**
|
|
1892
1943
|
* The market to place the order on.
|
|
1893
1944
|
*/
|
|
@@ -1898,18 +1949,15 @@ interface NewOrder {
|
|
|
1898
1949
|
*/
|
|
1899
1950
|
order_type?: string | null;
|
|
1900
1951
|
/**
|
|
1901
|
-
* Limit price in dollars, as a string: `"0.42"` is 42 cents. A number
|
|
1902
|
-
* rejected
|
|
1903
|
-
*
|
|
1904
|
-
*
|
|
1905
|
-
*
|
|
1906
|
-
*
|
|
1907
|
-
*
|
|
1908
|
-
*
|
|
1909
|
-
*
|
|
1910
|
-
* decimal places, not counting trailing zeros. So "0.42" and "0.4200" are the
|
|
1911
|
-
* same accepted value, and "0.001" is rejected. Money as a decimal string, as
|
|
1912
|
-
* sent by the API.
|
|
1952
|
+
* Limit price in dollars, as a string: `"0.42"` is 42 cents. A number such as
|
|
1953
|
+
* `42` is rejected, since it could mean cents or dollars. Must be strictly
|
|
1954
|
+
* less than the market's `max_price`, read per market. Required for `limit`
|
|
1955
|
+
* orders. A `market` order ignores it but still rejects a malformed or
|
|
1956
|
+
* sub-cent price with a 400; an explicit `null` is the same as omitting it.
|
|
1957
|
+
* Must be greater than zero and a whole number of cents: at most two decimal
|
|
1958
|
+
* places, not counting trailing zeros. So "0.42" and "0.4200" are the same
|
|
1959
|
+
* accepted value, and "0.001" is rejected. Money as a decimal string, as sent
|
|
1960
|
+
* by the API.
|
|
1913
1961
|
*/
|
|
1914
1962
|
price?: string | null;
|
|
1915
1963
|
/**
|
|
@@ -1980,6 +2028,12 @@ interface Order {
|
|
|
1980
2028
|
* the market has no event. Not the same as `expiration_time`.
|
|
1981
2029
|
*/
|
|
1982
2030
|
expires_at?: number | null;
|
|
2031
|
+
/**
|
|
2032
|
+
* How the order matches: `normal`, `post_only` or `fill_or_kill` for a limit
|
|
2033
|
+
* order you placed, `cancel_unfilled` for a market order, `rfq` or `quote`
|
|
2034
|
+
* for an order of a combination bind.
|
|
2035
|
+
*/
|
|
2036
|
+
fill_mode?: string | null;
|
|
1983
2037
|
/**
|
|
1984
2038
|
* Contracts filled so far. Compare with `quantity` to get remaining size.
|
|
1985
2039
|
* Quantity as a decimal string, as sent by the API.
|
|
@@ -2133,8 +2187,8 @@ interface PaymentTransaction {
|
|
|
2133
2187
|
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
2134
2188
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
2135
2189
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
2136
|
-
* `fee_refund`, `casino`, `adjustment`, `loyalty`,
|
|
2137
|
-
* `loyalty_points_referral`.
|
|
2190
|
+
* `fee_refund`, `maker_rebate`, `casino`, `adjustment`, `loyalty`,
|
|
2191
|
+
* `loyalty_points_rollup`, `loyalty_points_referral`.
|
|
2138
2192
|
*/
|
|
2139
2193
|
type?: string | null;
|
|
2140
2194
|
/** Fields the server added after this SDK was generated. */
|
|
@@ -2195,6 +2249,12 @@ interface Position {
|
|
|
2195
2249
|
* loss. In dollars. Money as a decimal string, as sent by the API.
|
|
2196
2250
|
*/
|
|
2197
2251
|
max_risk?: string | null;
|
|
2252
|
+
/**
|
|
2253
|
+
* A combination position's payout per dollar risked: max price over the
|
|
2254
|
+
* buy-side average fill, floored to two places. `null` for any market that is
|
|
2255
|
+
* not a combination.
|
|
2256
|
+
*/
|
|
2257
|
+
multiplier?: number | null;
|
|
2198
2258
|
/**
|
|
2199
2259
|
* Potential fee on the open contracts when they settle. In dollars. Money as
|
|
2200
2260
|
* a decimal string, as sent by the API.
|
|
@@ -2246,6 +2306,21 @@ interface Position {
|
|
|
2246
2306
|
/** Fields the server added after this SDK was generated. */
|
|
2247
2307
|
[key: string]: unknown;
|
|
2248
2308
|
}
|
|
2309
|
+
/**
|
|
2310
|
+
* The data provider that results a market.
|
|
2311
|
+
*/
|
|
2312
|
+
interface PoweredBy {
|
|
2313
|
+
/**
|
|
2314
|
+
* A link to the provider, or to its page for the event.
|
|
2315
|
+
*/
|
|
2316
|
+
link?: string | null;
|
|
2317
|
+
/**
|
|
2318
|
+
* The provider's name, e.g. `ESPN`.
|
|
2319
|
+
*/
|
|
2320
|
+
provider?: string | null;
|
|
2321
|
+
/** Fields the server added after this SDK was generated. */
|
|
2322
|
+
[key: string]: unknown;
|
|
2323
|
+
}
|
|
2249
2324
|
/**
|
|
2250
2325
|
* The public-profile fields to change. Every key is optional, but at least one
|
|
2251
2326
|
* is required.
|
|
@@ -2499,8 +2574,8 @@ interface Transaction {
|
|
|
2499
2574
|
* What moved the money or the points, for example a deposit, a trade fee, a
|
|
2500
2575
|
* referral, or a manual adjustment. Each endpoint returns only its own subset
|
|
2501
2576
|
* of these. One of: `deposit`, `withdrawal`, `settlement`, `fee`,
|
|
2502
|
-
* `fee_refund`, `casino`, `adjustment`, `loyalty`,
|
|
2503
|
-
* `loyalty_points_referral`.
|
|
2577
|
+
* `fee_refund`, `maker_rebate`, `casino`, `adjustment`, `loyalty`,
|
|
2578
|
+
* `loyalty_points_rollup`, `loyalty_points_referral`.
|
|
2504
2579
|
*/
|
|
2505
2580
|
type?: string | null;
|
|
2506
2581
|
/** Fields the server added after this SDK was generated. */
|
|
@@ -2513,6 +2588,7 @@ type models_Cancellation = Cancellation;
|
|
|
2513
2588
|
type models_Event = Event;
|
|
2514
2589
|
type models_FeeTransaction = FeeTransaction;
|
|
2515
2590
|
type models_Fill = Fill;
|
|
2591
|
+
type models_ForbiddenError = ForbiddenError;
|
|
2516
2592
|
type models_Leaderboard = Leaderboard;
|
|
2517
2593
|
type models_LeaderboardEntry = LeaderboardEntry;
|
|
2518
2594
|
type models_LeaderboardStanding = LeaderboardStanding;
|
|
@@ -2524,13 +2600,14 @@ type models_NewOrder = NewOrder;
|
|
|
2524
2600
|
type models_Order = Order;
|
|
2525
2601
|
type models_PaymentTransaction = PaymentTransaction;
|
|
2526
2602
|
type models_Position = Position;
|
|
2603
|
+
type models_PoweredBy = PoweredBy;
|
|
2527
2604
|
type models_ProfileUpdate = ProfileUpdate;
|
|
2528
2605
|
type models_RecentTrade = RecentTrade;
|
|
2529
2606
|
type models_Settlement = Settlement;
|
|
2530
2607
|
type models_StatDetail = StatDetail;
|
|
2531
2608
|
type models_Transaction = Transaction;
|
|
2532
2609
|
declare namespace models {
|
|
2533
|
-
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 };
|
|
2610
|
+
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_ForbiddenError as ForbiddenError, 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_PoweredBy as PoweredBy, models_ProfileUpdate as ProfileUpdate, models_RecentTrade as RecentTrade, models_Settlement as Settlement, models_StatDetail as StatDetail, models_Transaction as Transaction };
|
|
2534
2611
|
}
|
|
2535
2612
|
|
|
2536
2613
|
interface Operation {
|
|
@@ -2559,7 +2636,7 @@ declare const OPERATIONS: {
|
|
|
2559
2636
|
readonly account_market_stats_get: {
|
|
2560
2637
|
readonly method: "GET";
|
|
2561
2638
|
readonly path: "/api/v1/account/market_stats";
|
|
2562
|
-
readonly query: readonly ["market_ids", "event_ids", "exclude_zero_settlements", "from_time", "to_time", "sports", "competitions", "limit", "cursor"];
|
|
2639
|
+
readonly query: readonly ["market_ids", "event_ids", "exclude_zero_settlements", "unsettled_only", "from_time", "to_time", "sports", "competitions", "limit", "cursor"];
|
|
2563
2640
|
readonly pathParams: readonly [];
|
|
2564
2641
|
readonly hasBody: false;
|
|
2565
2642
|
readonly responseKey: "market_stats";
|
|
@@ -2950,6 +3027,30 @@ declare class STXTermsRequiredException extends STXForbiddenException {
|
|
|
2950
3027
|
*/
|
|
2951
3028
|
declare class STXIPNotAllowedException extends STXForbiddenException {
|
|
2952
3029
|
}
|
|
3030
|
+
/**
|
|
3031
|
+
* 403 from the network edge in front of the exchange: the request never
|
|
3032
|
+
* reached it, so nothing was done. `reason` is `restricted_jurisdiction`,
|
|
3033
|
+
* `unusual_network`, or `blocked` when the edge sent no reason (most often a
|
|
3034
|
+
* request without a `User-Agent` header). `reference` identifies the block for
|
|
3035
|
+
* support, when sent. Retrying will not help, so it is never retried.
|
|
3036
|
+
*/
|
|
3037
|
+
declare class STXBlockedException extends STXForbiddenException {
|
|
3038
|
+
readonly reason: string;
|
|
3039
|
+
readonly reference: string | undefined;
|
|
3040
|
+
constructor(message: string, opts?: STXExceptionOptions & {
|
|
3041
|
+
reason?: string;
|
|
3042
|
+
reference?: string;
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
/** 403 `restricted_jurisdiction`: the request came from a location the exchange does not serve. */
|
|
3046
|
+
declare class STXRestrictedJurisdictionException extends STXBlockedException {
|
|
3047
|
+
}
|
|
3048
|
+
/**
|
|
3049
|
+
* 403 `unusual_network`: the request came from a network the exchange does
|
|
3050
|
+
* not accept traffic from, such as some hosting providers, proxies or VPNs.
|
|
3051
|
+
*/
|
|
3052
|
+
declare class STXUnusualNetworkException extends STXBlockedException {
|
|
3053
|
+
}
|
|
2953
3054
|
/** 404: the resource does not exist, or belongs to another account. */
|
|
2954
3055
|
declare class STXNotFoundException extends STXAPIException {
|
|
2955
3056
|
}
|
|
@@ -2959,11 +3060,42 @@ declare class STXNotFoundException extends STXAPIException {
|
|
|
2959
3060
|
*/
|
|
2960
3061
|
declare class STXRejectedException extends STXAPIException {
|
|
2961
3062
|
}
|
|
2962
|
-
/**
|
|
3063
|
+
/**
|
|
3064
|
+
* 422: this market does not take the order's `fillMode`. Combination markets
|
|
3065
|
+
* accept only normal orders. `fillMode` is the mode sent.
|
|
3066
|
+
*/
|
|
3067
|
+
declare class STXFillModeNotAllowedException extends STXRejectedException {
|
|
3068
|
+
readonly fillMode: string;
|
|
3069
|
+
constructor(message: string, opts: STXExceptionOptions & {
|
|
3070
|
+
fillMode: string;
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
/**
|
|
3074
|
+
* A `post_only` order would have matched on arrival, so it was not left on the
|
|
3075
|
+
* book and nothing filled. `reason` is `auto_matching` when the exchange
|
|
3076
|
+
* accepted and cancelled it (`order` is that cancelled order), or
|
|
3077
|
+
* `match_with_self` when the first order it would match is your own (a 422;
|
|
3078
|
+
* `order` is undefined).
|
|
3079
|
+
*/
|
|
3080
|
+
declare class STXPostOnlyWouldMatchException extends STXRejectedException {
|
|
3081
|
+
readonly reason: "auto_matching" | "match_with_self";
|
|
3082
|
+
readonly order: Order | undefined;
|
|
3083
|
+
constructor(message: string, opts: STXExceptionOptions & {
|
|
3084
|
+
reason: "auto_matching" | "match_with_self";
|
|
3085
|
+
order?: Order;
|
|
3086
|
+
});
|
|
3087
|
+
}
|
|
3088
|
+
/**
|
|
3089
|
+
* 429: too many requests. `retryAfter` is seconds, when sent. `reference`
|
|
3090
|
+
* identifies the block for support when the network edge in front of the
|
|
3091
|
+
* exchange answered (`{"error": "rate_limited", ...}`), else it is undefined.
|
|
3092
|
+
*/
|
|
2963
3093
|
declare class STXRateLimitException extends STXAPIException {
|
|
2964
3094
|
readonly retryAfter: number | undefined;
|
|
3095
|
+
readonly reference: string | undefined;
|
|
2965
3096
|
constructor(message: string, opts?: STXExceptionOptions & {
|
|
2966
3097
|
retryAfter?: number;
|
|
3098
|
+
reference?: string;
|
|
2967
3099
|
});
|
|
2968
3100
|
}
|
|
2969
3101
|
/** 5xx: the server failed. Retried by the default policy on GET and DELETE. */
|
|
@@ -2996,7 +3128,7 @@ declare class STXChannelException extends STXException {
|
|
|
2996
3128
|
declare class STXTimeoutException extends STXChannelException {
|
|
2997
3129
|
}
|
|
2998
3130
|
/** The sentence an `STXNotAvailableException` carries: `Combos are not available on demo.stxapp.ca yet.` */
|
|
2999
|
-
declare function notAvailableMessage(feature: string, host: string): string;
|
|
3131
|
+
declare function notAvailableMessage(feature: string, host: string, apiVersion?: string | null): string;
|
|
3000
3132
|
/**
|
|
3001
3133
|
* This exchange does not have the feature yet: combos on an exchange without
|
|
3002
3134
|
* them, OAuth where it is not switched on, a scope the exchange does not offer
|
|
@@ -3007,7 +3139,9 @@ declare function notAvailableMessage(feature: string, host: string): string;
|
|
|
3007
3139
|
*
|
|
3008
3140
|
* `feature` is a stable id (`oauth`, `oauth.member`, `oauth.app`, `connect`,
|
|
3009
3141
|
* `terms.stx_page`, `markets.create`, `market_types`, `event_players`,
|
|
3010
|
-
* `leaderboard`, `loyalty`, `combos`,
|
|
3142
|
+
* `leaderboard`, `loyalty`, `combos`, `orders.post_only`, `orders.fill_or_kill`, or
|
|
3143
|
+
* `scope:<name>`); `host` is the exchange that answered, and `apiVersion` its
|
|
3144
|
+
* build when known.
|
|
3011
3145
|
* `statusCode` and `body` are the HTTP answer the decision came from, when
|
|
3012
3146
|
* there was one.
|
|
3013
3147
|
*/
|
|
@@ -3016,8 +3150,11 @@ declare class STXNotAvailableException extends STXAPIException {
|
|
|
3016
3150
|
readonly feature: string;
|
|
3017
3151
|
/** The exchange host that lacks it, e.g. `"demo.stxapp.ca"`. */
|
|
3018
3152
|
readonly host: string;
|
|
3153
|
+
/** The exchange build, e.g. `"3.4.24"`, when known. */
|
|
3154
|
+
readonly apiVersion: string | undefined;
|
|
3019
3155
|
constructor(feature: string, host: string, opts?: STXExceptionOptions & {
|
|
3020
3156
|
message?: string;
|
|
3157
|
+
apiVersion?: string | null;
|
|
3021
3158
|
});
|
|
3022
3159
|
static [Symbol.hasInstance](value: unknown): boolean;
|
|
3023
3160
|
}
|
|
@@ -3086,6 +3223,10 @@ declare function errorForStatus(statusCode: number, body: unknown, opts: {
|
|
|
3086
3223
|
path: string;
|
|
3087
3224
|
retryAfter?: string | null;
|
|
3088
3225
|
wwwAuthenticate?: string | null;
|
|
3226
|
+
/** The `x-stx-error` response header: the exchange sets it, an edge block never does. */
|
|
3227
|
+
stxError?: string | null;
|
|
3228
|
+
/** The `x-amz-cf-id` response header: the reference of an edge block. */
|
|
3229
|
+
cfId?: string | null;
|
|
3089
3230
|
}): STXAPIException;
|
|
3090
3231
|
|
|
3091
3232
|
type ExceptionClass = abstract new (...args: never[]) => STXException;
|
|
@@ -3181,8 +3322,8 @@ declare class ApiKeyCredentials implements AuthProvider {
|
|
|
3181
3322
|
toString(): string;
|
|
3182
3323
|
}
|
|
3183
3324
|
|
|
3184
|
-
declare const VERSION = "0.
|
|
3185
|
-
declare const USER_AGENT = "stx-typescript/0.
|
|
3325
|
+
declare const VERSION = "0.12.0";
|
|
3326
|
+
declare const USER_AGENT = "stx-typescript/0.12.0";
|
|
3186
3327
|
/**
|
|
3187
3328
|
* `Symbol.asyncDispose` where the runtime has it (Node 20+, Bun), so
|
|
3188
3329
|
* `await using client = new STX()` works there; a registered stand-in on
|
|
@@ -4129,6 +4270,12 @@ interface MarketStatsQuery {
|
|
|
4129
4270
|
marketIds?: StrList;
|
|
4130
4271
|
eventIds?: StrList;
|
|
4131
4272
|
excludeZeroSettlements?: boolean;
|
|
4273
|
+
/**
|
|
4274
|
+
* Only markets not yet resulted or voided, ordered by market id so a row
|
|
4275
|
+
* keeps its place between pages. Not combinable with `fromTime`, `toTime` or
|
|
4276
|
+
* `excludeZeroSettlements: true`.
|
|
4277
|
+
*/
|
|
4278
|
+
unsettledOnly?: boolean;
|
|
4132
4279
|
fromTime?: number;
|
|
4133
4280
|
toTime?: number;
|
|
4134
4281
|
sports?: StrList;
|
|
@@ -4170,7 +4317,15 @@ interface OrderOptions {
|
|
|
4170
4317
|
expirationTime?: number;
|
|
4171
4318
|
cancelOnDisconnect?: boolean;
|
|
4172
4319
|
deviceId?: string;
|
|
4320
|
+
/**
|
|
4321
|
+
* `"normal"` (the default), `"post_only"` (only ever rests on the book as a
|
|
4322
|
+
* maker) or `"fill_or_kill"` (fills in full or not at all). Limit orders
|
|
4323
|
+
* only.
|
|
4324
|
+
*/
|
|
4325
|
+
fillMode?: FillMode;
|
|
4173
4326
|
}
|
|
4327
|
+
/** How a limit order matches. */
|
|
4328
|
+
type FillMode = "normal" | "post_only" | "fill_or_kill";
|
|
4174
4329
|
/** One order in a `placeOrders` batch. */
|
|
4175
4330
|
interface NewOrderInput extends OrderOptions {
|
|
4176
4331
|
marketId: string;
|
|
@@ -4184,7 +4339,10 @@ interface AcceptTermsOptions {
|
|
|
4184
4339
|
acceptPrivacy?: boolean;
|
|
4185
4340
|
acceptHouseRules?: boolean;
|
|
4186
4341
|
}
|
|
4187
|
-
/**
|
|
4342
|
+
/**
|
|
4343
|
+
* The JSON body for one new order. Fields left undefined are omitted, and so is
|
|
4344
|
+
* `fillMode: "normal"`, the default.
|
|
4345
|
+
*/
|
|
4188
4346
|
declare function orderBody(marketId: string, action: string, orderType: string, opts: OrderOptions): Record<string, unknown>;
|
|
4189
4347
|
/**
|
|
4190
4348
|
* The STX client. Configuration comes from the options, then
|
|
@@ -4218,7 +4376,7 @@ declare class STX {
|
|
|
4218
4376
|
get host(): string;
|
|
4219
4377
|
/**
|
|
4220
4378
|
* Which features this exchange has, from what it publishes: its OAuth
|
|
4221
|
-
* discovery document,
|
|
4379
|
+
* discovery document, a signed GET of the routes that not
|
|
4222
4380
|
* every exchange has yet, and a join of a combos topic nobody owns. Nothing
|
|
4223
4381
|
* is created or changed. Checked once per client and cached; pass
|
|
4224
4382
|
* `{ refresh: true }` to check again.
|
|
@@ -4314,6 +4472,18 @@ declare class STX {
|
|
|
4314
4472
|
* are decimal strings, e.g. `{ price: "0.58", quantity: "100" }`. Numbers are
|
|
4315
4473
|
* refused client-side.
|
|
4316
4474
|
*
|
|
4475
|
+
* `fillMode` (limit orders only) is `"normal"` (the default), `"post_only"`
|
|
4476
|
+
* or `"fill_or_kill"`. A post-only order that would match on arrival is not
|
|
4477
|
+
* placed: this throws `STXPostOnlyWouldMatchException`. A fill-or-kill order
|
|
4478
|
+
* comes back `accepted` (or `delayed` in play); follow it on the `orders`
|
|
4479
|
+
* channel or with `order()` to see it `filled` or `cancelled`.
|
|
4480
|
+
*
|
|
4481
|
+
* The exchange decides whether it takes either mode. Where a mode is not
|
|
4482
|
+
* enabled it rejects the order and this throws `STXNotAvailableException`
|
|
4483
|
+
* (`orders.post_only`, `orders.fill_or_kill`). An exchange on a release from
|
|
4484
|
+
* before fill modes places the order as a normal limit order. A combination
|
|
4485
|
+
* market throws `STXFillModeNotAllowedException`.
|
|
4486
|
+
*
|
|
4317
4487
|
* The exchange validates the order: a bad price step or a fractional
|
|
4318
4488
|
* quantity throws `STXValidationException` (400) or `STXRejectedException`
|
|
4319
4489
|
* (422) with the API's message. An order from outside the region is also
|
|
@@ -4326,7 +4496,12 @@ declare class STX {
|
|
|
4326
4496
|
/**
|
|
4327
4497
|
* `POST /api/v1/orders/batched`: place several orders in one call. Returns
|
|
4328
4498
|
* one result per order, in order; a rejected order has `errors` instead of
|
|
4329
|
-
* `order` and does not stop the others.
|
|
4499
|
+
* `order` and does not stop the others. A post-only order that would have
|
|
4500
|
+
* matched comes back as its order, `cancelled` with `cancellation_reason`
|
|
4501
|
+
* `auto_matching`.
|
|
4502
|
+
*
|
|
4503
|
+
* When the exchange rejects the call because a `fillMode` is not enabled
|
|
4504
|
+
* there, this throws `STXNotAvailableException`, as `placeOrder()` does.
|
|
4330
4505
|
*/
|
|
4331
4506
|
placeOrders(orders: readonly NewOrderInput[]): Promise<BatchOrderResult[]>;
|
|
4332
4507
|
/**
|
|
@@ -4430,4 +4605,4 @@ declare class STX {
|
|
|
4430
4605
|
websocket(opts?: Omit<STXWebSocketOptions, "rest">): STXWebSocket;
|
|
4431
4606
|
}
|
|
4432
4607
|
|
|
4433
|
-
export { type EventPlayers as $, type AcceptTermsOptions as A, type Balance as B, type Cancellation as C, ComboPlayer as D, type ComboPlayerEvent as E, type ComboQuoteAcceptedEvent as F, type ComboQuoteClosedEvent as G, type ComboQuoteClosedReason as H, type ComboQuoteReply as I, type ComboRefusalReason as J, type ComboRequestClosedEvent as K, type ComboRequestClosedReason as L, type ComboRequestReply as M, type ComboRfqClosedEvent as N, type ComboRfqClosedReason as O, type ComboRfqLeg as P, type ComboRfqOpenedEvent as Q, type ComboSnapshot as R, type ComboWithdrawReply as S, type CreatableMarketType as T, type CreateMarketResult as U, type CreateMarketsOptions as V, Environment as W, Environments as X, type Error$1 as Y, type Event as Z, type EventPlayer as _, type AccountChange as a,
|
|
4608
|
+
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, SNAPSHOT_EVENTS 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 FillMode as a9, NO_RETRY as aA, type NewMarket as aB, type NewMarketInput as aC, type NewOrder as aD, type NewOrderInput as aE, OPERATIONS as aF, type Operation as aG, type OperationId as aH, type Order as aI, type OrderOptions as aJ, type OrdersQuery as aK, Page as aL, type PageQuery as aM, type PaymentTransaction as aN, type PlayerStatLineMarket as aO, type Position as aP, type PoweredBy as aQ, type PrivateKeyInput as aR, type ProfileUpdate as aS, type RecentTrade as aT, ReconnectPolicy as aU, type ReconnectPolicyOptions as aV, Region as aW, type ResponseEvent as aX, RetryPolicy as aY, type RetryPolicyOptions as aZ, SIGNATURE_HEADER as a_, type FillsQuery as aa, type ForbiddenError as ab, HOSTS as ac, KEY_HEADER as ad, type KnownStat as ae, type Leaderboard as af, type LeaderboardEntry as ag, type LeaderboardQuery as ah, type LeaderboardStanding as ai, type ListedMarketType as aj, type Logger as ak, MAX_MARKETS_PER_REQUEST as al, type Market as am, type MarketFilter as an, type MarketRejectionReason as ao, type MarketRequestEcho as ap, type MarketRule as aq, type MarketStat as ar, type MarketStatsQuery as as, type MarketType as at, type MarketTypeEventType as au, type MarketTypeField as av, type MarketTypes as aw, type MarketsQuery as ax, type Me as ay, type MessageHandler as az, type AccountChangeKind as b, STX as b0, STXAPIException as b1, STXAuthenticationException as b2, STXBlockedException as b3, STXChannelException as b4, STXComboPriceMovedException as b5, STXComboRefusedException as b6, STXCombosUnavailableException as b7, STXConfigException as b8, type STXEnvironment as b9, Stats as bA, type StrList as bB, TERMINAL_ORDER_STATUSES as bC, TIMESTAMP_HEADER as bD, type Transaction as bE, USER_AGENT as bF, VERSION as bG, type WebSocketAuthContext as bH, baseUrlFor as bI, buildMessage as bJ, environmentNamed as bK, errorForStatus as bL, handshakePath as bM, isValidLine as bN, loadPrivateKey as bO, models as bP, notAvailableMessage as bQ, orderBody as bR, requestPath as bS, resolveHost as bT, signerFromPrivateKey as bU, socketUrlFor as bV, STXException as ba, STXFillModeNotAllowedException as bb, STXForbiddenException as bc, STXIPNotAllowedException as bd, STXInsufficientScopeException as be, STXInvalidTokenException as bf, STXNotAvailableException as bg, STXNotFoundException as bh, type STXOptions as bi, STXPostOnlyWouldMatchException as bj, STXRateLimitException as bk, STXRejectedException as bl, STXRestrictedJurisdictionException as bm, STXServerException as bn, STXTermsRequiredException as bo, STXTimeoutException as bp, STXTransportException as bq, STXUnusualNetworkException as br, STXValidationException as bs, STXWebSocket as bt, type STXWebSocketOptions as bu, type Settlement as bv, type SettlementsQuery as bw, type Signer as bx, type Stat as by, type StatDetail 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 };
|