@stxapp/stx-typescript 0.8.2 → 0.8.3
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 +5 -0
- package/README.md +23 -20
- package/dist/{chunk-JHREXRKD.cjs → chunk-SI3EILHN.cjs} +3 -3
- package/dist/chunk-SI3EILHN.cjs.map +1 -0
- package/dist/{chunk-BDKOZ6S2.js → chunk-SIYERAKK.js} +3 -3
- package/dist/chunk-SIYERAKK.js.map +1 -0
- package/dist/{client-jcBBoio1.d.cts → client-BrHjO1__.d.cts} +14 -9
- package/dist/{client-jcBBoio1.d.ts → client-BrHjO1__.d.ts} +14 -9
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/oauth.cjs +17 -17
- 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-BDKOZ6S2.js.map +0 -1
- package/dist/chunk-JHREXRKD.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.3 (2026-10-20)
|
|
4
|
+
|
|
5
|
+
- Combos are no longer marked preview.
|
|
6
|
+
- `ComboRfqLeg.short_name` is `string | null`: the exchange sends `null` when it has no name for a leg.
|
|
7
|
+
|
|
3
8
|
## 0.8.2 (2026-10-15)
|
|
4
9
|
|
|
5
10
|
- `createMarkets()` sends each market in the form the exchange takes, `{ rule: "player_stat_line", player_id, stat, line }`. Markets sent by 0.8.0 and 0.8.1 came back `rejected` with `invalid_market`.
|
package/README.md
CHANGED
|
@@ -22,46 +22,49 @@ const client = new STX();
|
|
|
22
22
|
const page = await client.markets({ status: "open", trading: true, limit: 5 });
|
|
23
23
|
|
|
24
24
|
for (const market of page.items) {
|
|
25
|
-
// bids are what buyers will pay, offers what sellers will accept
|
|
25
|
+
// bids are what buyers will pay, offers what sellers will accept. Both lists are sorted
|
|
26
|
+
// by price, highest first, so the best bid is the first entry and the best offer the last.
|
|
26
27
|
// Prices are dollars per contract, as strings; a winning contract pays market.max_price.
|
|
27
28
|
const bid = market.bids?.[0]?.price ?? "-"; // "-" when nobody is bidding
|
|
28
|
-
const offer = market.offers?.
|
|
29
|
+
const offer = market.offers?.at(-1)?.price ?? "-";
|
|
29
30
|
console.log(`${market.event_title}: ${market.title} bid ${bid} offer ${offer}`);
|
|
30
31
|
}
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
Sample output:
|
|
34
|
+
Sample output (two of the five markets):
|
|
34
35
|
|
|
35
36
|
```text
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Norfolk State Spartans at Old Dominion Monarchs: Old Dominion Score Last bid - offer -
|
|
39
|
-
Norfolk State Spartans at Old Dominion Monarchs: Norfolk St Score Last bid - offer -
|
|
40
|
-
Los Angeles Chargers at Buffalo Bills: NFL - Week 3 LAC @ BUF bid - offer -
|
|
37
|
+
Edmonton Oilers at San Jose Sharks: NHL EDM @ SJ bid 0.5800 offer 0.5900
|
|
38
|
+
Edmonton Oilers at San Jose Sharks: C. McDavid 3.5 SOG bid 0.4900 offer 0.5300
|
|
41
39
|
```
|
|
42
40
|
|
|
43
|
-
A bid of `0.
|
|
41
|
+
A bid of `0.5800` on a market whose winning contract pays `1.0000` means a buyer will pay 58 cents for a contract that pays $1 if the Oilers win.
|
|
44
42
|
|
|
45
43
|
<details>
|
|
46
44
|
<summary>One market from the response (selected fields)</summary>
|
|
47
45
|
|
|
48
46
|
```json
|
|
49
47
|
{
|
|
50
|
-
"market_id": "
|
|
51
|
-
"symbol": "
|
|
52
|
-
"event_title": "
|
|
53
|
-
"title": "
|
|
54
|
-
"question": "Will
|
|
48
|
+
"market_id": "e00651a3-10cb-4bc1-9e1f-c5ea1796c83b",
|
|
49
|
+
"symbol": "STXNHL-26OCT101600EDMSJ-GAMEEDM",
|
|
50
|
+
"event_title": "Edmonton Oilers at San Jose Sharks",
|
|
51
|
+
"title": "NHL EDM @ SJ",
|
|
52
|
+
"question": "Will the Edmonton Oilers defeat the San Jose Sharks?",
|
|
55
53
|
"status": "open",
|
|
56
54
|
"trading": true,
|
|
57
|
-
"event_start": "2026-
|
|
55
|
+
"event_start": "2026-10-10T20:00:00.000000Z",
|
|
58
56
|
"max_price": "1.0000",
|
|
59
|
-
"last_traded_price":
|
|
57
|
+
"last_traded_price": "0.5800",
|
|
60
58
|
"bids": [
|
|
61
|
-
{ "
|
|
62
|
-
{ "
|
|
59
|
+
{ "price": "0.5800", "quantity": "210.00" },
|
|
60
|
+
{ "price": "0.5700", "quantity": "420.00" },
|
|
61
|
+
{ "price": "0.5600", "quantity": "1200.00" }
|
|
63
62
|
],
|
|
64
|
-
"offers": [
|
|
63
|
+
"offers": [
|
|
64
|
+
{ "price": "0.6100", "quantity": "900.00" },
|
|
65
|
+
{ "price": "0.6000", "quantity": "650.00" },
|
|
66
|
+
{ "price": "0.5900", "quantity": "310.00" }
|
|
67
|
+
]
|
|
65
68
|
}
|
|
66
69
|
```
|
|
67
70
|
|
|
@@ -76,4 +79,4 @@ Every field is described in the [API reference](https://docs.stxapp.io/sdks/type
|
|
|
76
79
|
- [Release notes](https://docs.stxapp.io/changelog/)
|
|
77
80
|
- [Support](https://docs.stxapp.io/support/)
|
|
78
81
|
|
|
79
|
-
MIT license. Use of the STX API and exchange is subject to the STX terms of use and privacy policy: United States ([terms of use](https://
|
|
82
|
+
MIT license. Use of the STX API and exchange is subject to the STX terms of use and privacy policy: United States ([terms of use](https://stxapp.io/legal/terms-of-use.pdf), [privacy policy](https://stxapp.io/legal/privacy-policy.pdf)), Ontario ([terms of use](https://stxapp.ca/legal/terms-of-use.pdf), [privacy policy](https://stxapp.ca/legal/privacy-policy.pdf)).
|
|
@@ -986,7 +986,7 @@ function credentialsFromSettings(keyId, privateKey, signer) {
|
|
|
986
986
|
}
|
|
987
987
|
|
|
988
988
|
// src/version.ts
|
|
989
|
-
var VERSION = "0.8.
|
|
989
|
+
var VERSION = "0.8.3";
|
|
990
990
|
var USER_AGENT = `stx-typescript/${VERSION}`;
|
|
991
991
|
var ASYNC_DISPOSE = _nullishCoalesce(Symbol.asyncDispose, () => ( /* @__PURE__ */ Symbol.for("Symbol.asyncDispose")));
|
|
992
992
|
|
|
@@ -2088,7 +2088,7 @@ var STX = (_class3 = class _STX {
|
|
|
2088
2088
|
*
|
|
2089
2089
|
* `action` is `"buy"` or `"sell"`; `orderType` is `"limit"` or `"market"`.
|
|
2090
2090
|
* `price` (dollars, required for a limit order) and `quantity` (contracts)
|
|
2091
|
-
* are decimal strings, e.g. `{ price: "0.
|
|
2091
|
+
* are decimal strings, e.g. `{ price: "0.58", quantity: "100" }`. Numbers are
|
|
2092
2092
|
* refused client-side.
|
|
2093
2093
|
*
|
|
2094
2094
|
* The exchange validates the order: a bad price step or a fractional
|
|
@@ -3365,4 +3365,4 @@ function dropUndefined(payload) {
|
|
|
3365
3365
|
|
|
3366
3366
|
|
|
3367
3367
|
exports.Region = Region; exports.Environment = Environment; exports.geoRejection = geoRejection; exports.STXException = STXException; exports.STXConfigException = STXConfigException; exports.STXAPIException = STXAPIException; exports.STXValidationException = STXValidationException; exports.STXAuthenticationException = STXAuthenticationException; exports.STXForbiddenException = STXForbiddenException; exports.STXInvalidTokenException = STXInvalidTokenException; exports.STXInsufficientScopeException = STXInsufficientScopeException; exports.STXNotFoundException = STXNotFoundException; exports.STXRejectedException = STXRejectedException; exports.STXGeoLocationException = STXGeoLocationException; exports.STXRateLimitException = STXRateLimitException; exports.STXServerException = STXServerException; exports.STXTransportException = STXTransportException; exports.STXChannelException = STXChannelException; exports.STXTimeoutException = STXTimeoutException; exports.STXCombosUnavailableException = STXCombosUnavailableException; exports.STXComboRefusedException = STXComboRefusedException; exports.STXComboPriceMovedException = STXComboPriceMovedException; exports.errorForStatus = errorForStatus; exports.Environments = Environments; exports.HOSTS = HOSTS; exports.environmentNamed = environmentNamed; exports.resolveHost = resolveHost; exports.baseUrlFor = baseUrlFor; exports.socketUrlFor = socketUrlFor; exports.OPERATIONS = OPERATIONS; exports.Stats = Stats; exports.MAX_MARKETS_PER_REQUEST = MAX_MARKETS_PER_REQUEST; exports.isValidLine = isValidLine; exports.Page = Page; exports.RetryPolicy = RetryPolicy; exports.NO_RETRY = NO_RETRY; exports.resolveSettings = resolveSettings; exports.KEY_HEADER = KEY_HEADER; exports.TIMESTAMP_HEADER = TIMESTAMP_HEADER; exports.SIGNATURE_HEADER = SIGNATURE_HEADER; exports.buildMessage = buildMessage; exports.requestPath = requestPath; exports.handshakePath = handshakePath; exports.loadPrivateKey = loadPrivateKey; exports.signerFromPrivateKey = signerFromPrivateKey; exports.ApiKeyCredentials = ApiKeyCredentials; exports.VERSION = VERSION; exports.USER_AGENT = USER_AGENT; exports.TERMINAL_ORDER_STATUSES = TERMINAL_ORDER_STATUSES; exports.AccountView = AccountView; exports.ComboPlayer = ComboPlayer; exports.ComboMaker = ComboMaker; exports.centsToDollars = centsToDollars; exports.toDollarString = toDollarString; exports.toQuantity = toQuantity; exports.convertMarketPayload = convertMarketPayload; exports.convertMarketsFrame = convertMarketsFrame; exports.convertBook = convertBook; exports.convertMarketChannelPayload = convertMarketChannelPayload; exports.SNAPSHOT_EVENTS = SNAPSHOT_EVENTS; exports.ChannelMessage = ChannelMessage; exports.ReconnectPolicy = ReconnectPolicy; exports.Channel = Channel; exports.STXWebSocket = STXWebSocket; exports.orderBody = orderBody; exports.STX = STX;
|
|
3368
|
-
//# sourceMappingURL=chunk-
|
|
3368
|
+
//# sourceMappingURL=chunk-SI3EILHN.cjs.map
|