@stxapp/stx-typescript 0.7.0 → 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/dist/index.cjs CHANGED
@@ -57,10 +57,10 @@
57
57
 
58
58
 
59
59
 
60
- var _chunkASOLCDBGcjs = require('./chunk-ASOLCDBG.cjs');
61
60
 
62
61
 
63
62
 
63
+ var _chunkL2DEU7R6cjs = require('./chunk-L2DEU7R6.cjs');
64
64
 
65
65
 
66
66
 
@@ -117,5 +117,11 @@ var _chunkASOLCDBGcjs = require('./chunk-ASOLCDBG.cjs');
117
117
 
118
118
 
119
119
 
120
- exports.AccountView = _chunkASOLCDBGcjs.AccountView; exports.ApiKeyCredentials = _chunkASOLCDBGcjs.ApiKeyCredentials; exports.Channel = _chunkASOLCDBGcjs.Channel; exports.ChannelMessage = _chunkASOLCDBGcjs.ChannelMessage; exports.Environment = _chunkASOLCDBGcjs.Environment; exports.Environments = _chunkASOLCDBGcjs.Environments; exports.HOSTS = _chunkASOLCDBGcjs.HOSTS; exports.KEY_HEADER = _chunkASOLCDBGcjs.KEY_HEADER; exports.NO_RETRY = _chunkASOLCDBGcjs.NO_RETRY; exports.OPERATIONS = _chunkASOLCDBGcjs.OPERATIONS; exports.Page = _chunkASOLCDBGcjs.Page; exports.ReconnectPolicy = _chunkASOLCDBGcjs.ReconnectPolicy; exports.Region = _chunkASOLCDBGcjs.Region; exports.RetryPolicy = _chunkASOLCDBGcjs.RetryPolicy; exports.SIGNATURE_HEADER = _chunkASOLCDBGcjs.SIGNATURE_HEADER; exports.SNAPSHOT_EVENTS = _chunkASOLCDBGcjs.SNAPSHOT_EVENTS; exports.STX = _chunkASOLCDBGcjs.STX; exports.STXAPIException = _chunkASOLCDBGcjs.STXAPIException; exports.STXAuthenticationException = _chunkASOLCDBGcjs.STXAuthenticationException; exports.STXChannelException = _chunkASOLCDBGcjs.STXChannelException; exports.STXConfigException = _chunkASOLCDBGcjs.STXConfigException; exports.STXException = _chunkASOLCDBGcjs.STXException; exports.STXForbiddenException = _chunkASOLCDBGcjs.STXForbiddenException; exports.STXGeoLocationException = _chunkASOLCDBGcjs.STXGeoLocationException; exports.STXInsufficientScopeException = _chunkASOLCDBGcjs.STXInsufficientScopeException; exports.STXInvalidTokenException = _chunkASOLCDBGcjs.STXInvalidTokenException; exports.STXNotFoundException = _chunkASOLCDBGcjs.STXNotFoundException; exports.STXRateLimitException = _chunkASOLCDBGcjs.STXRateLimitException; exports.STXRejectedException = _chunkASOLCDBGcjs.STXRejectedException; exports.STXServerException = _chunkASOLCDBGcjs.STXServerException; exports.STXTimeoutException = _chunkASOLCDBGcjs.STXTimeoutException; exports.STXTransportException = _chunkASOLCDBGcjs.STXTransportException; exports.STXValidationException = _chunkASOLCDBGcjs.STXValidationException; exports.STXWebSocket = _chunkASOLCDBGcjs.STXWebSocket; exports.TERMINAL_ORDER_STATUSES = _chunkASOLCDBGcjs.TERMINAL_ORDER_STATUSES; exports.TIMESTAMP_HEADER = _chunkASOLCDBGcjs.TIMESTAMP_HEADER; exports.USER_AGENT = _chunkASOLCDBGcjs.USER_AGENT; exports.VERSION = _chunkASOLCDBGcjs.VERSION; exports.baseUrlFor = _chunkASOLCDBGcjs.baseUrlFor; exports.buildMessage = _chunkASOLCDBGcjs.buildMessage; exports.centsToDollars = _chunkASOLCDBGcjs.centsToDollars; exports.convertBook = _chunkASOLCDBGcjs.convertBook; exports.convertMarketChannelPayload = _chunkASOLCDBGcjs.convertMarketChannelPayload; exports.convertMarketPayload = _chunkASOLCDBGcjs.convertMarketPayload; exports.convertMarketsFrame = _chunkASOLCDBGcjs.convertMarketsFrame; exports.environmentNamed = _chunkASOLCDBGcjs.environmentNamed; exports.errorForStatus = _chunkASOLCDBGcjs.errorForStatus; exports.geoRejection = _chunkASOLCDBGcjs.geoRejection; exports.handshakePath = _chunkASOLCDBGcjs.handshakePath; exports.loadPrivateKey = _chunkASOLCDBGcjs.loadPrivateKey; exports.orderBody = _chunkASOLCDBGcjs.orderBody; exports.requestPath = _chunkASOLCDBGcjs.requestPath; exports.resolveHost = _chunkASOLCDBGcjs.resolveHost; exports.resolveSettings = _chunkASOLCDBGcjs.resolveSettings; exports.signerFromPrivateKey = _chunkASOLCDBGcjs.signerFromPrivateKey; exports.socketUrlFor = _chunkASOLCDBGcjs.socketUrlFor; exports.toDollarString = _chunkASOLCDBGcjs.toDollarString; exports.toQuantity = _chunkASOLCDBGcjs.toQuantity;
120
+
121
+
122
+
123
+
124
+
125
+
126
+ exports.AccountView = _chunkL2DEU7R6cjs.AccountView; exports.ApiKeyCredentials = _chunkL2DEU7R6cjs.ApiKeyCredentials; exports.Channel = _chunkL2DEU7R6cjs.Channel; exports.ChannelMessage = _chunkL2DEU7R6cjs.ChannelMessage; exports.Environment = _chunkL2DEU7R6cjs.Environment; exports.Environments = _chunkL2DEU7R6cjs.Environments; exports.HOSTS = _chunkL2DEU7R6cjs.HOSTS; exports.KEY_HEADER = _chunkL2DEU7R6cjs.KEY_HEADER; exports.MAX_MARKETS_PER_REQUEST = _chunkL2DEU7R6cjs.MAX_MARKETS_PER_REQUEST; exports.NO_RETRY = _chunkL2DEU7R6cjs.NO_RETRY; exports.OPERATIONS = _chunkL2DEU7R6cjs.OPERATIONS; exports.Page = _chunkL2DEU7R6cjs.Page; exports.ReconnectPolicy = _chunkL2DEU7R6cjs.ReconnectPolicy; exports.Region = _chunkL2DEU7R6cjs.Region; exports.RetryPolicy = _chunkL2DEU7R6cjs.RetryPolicy; exports.SIGNATURE_HEADER = _chunkL2DEU7R6cjs.SIGNATURE_HEADER; exports.SNAPSHOT_EVENTS = _chunkL2DEU7R6cjs.SNAPSHOT_EVENTS; exports.STX = _chunkL2DEU7R6cjs.STX; exports.STXAPIException = _chunkL2DEU7R6cjs.STXAPIException; exports.STXAuthenticationException = _chunkL2DEU7R6cjs.STXAuthenticationException; exports.STXChannelException = _chunkL2DEU7R6cjs.STXChannelException; exports.STXConfigException = _chunkL2DEU7R6cjs.STXConfigException; exports.STXException = _chunkL2DEU7R6cjs.STXException; exports.STXForbiddenException = _chunkL2DEU7R6cjs.STXForbiddenException; exports.STXGeoLocationException = _chunkL2DEU7R6cjs.STXGeoLocationException; exports.STXInsufficientScopeException = _chunkL2DEU7R6cjs.STXInsufficientScopeException; exports.STXInvalidTokenException = _chunkL2DEU7R6cjs.STXInvalidTokenException; exports.STXNotFoundException = _chunkL2DEU7R6cjs.STXNotFoundException; exports.STXRateLimitException = _chunkL2DEU7R6cjs.STXRateLimitException; exports.STXRejectedException = _chunkL2DEU7R6cjs.STXRejectedException; exports.STXServerException = _chunkL2DEU7R6cjs.STXServerException; exports.STXTimeoutException = _chunkL2DEU7R6cjs.STXTimeoutException; exports.STXTransportException = _chunkL2DEU7R6cjs.STXTransportException; exports.STXValidationException = _chunkL2DEU7R6cjs.STXValidationException; exports.STXWebSocket = _chunkL2DEU7R6cjs.STXWebSocket; exports.Stats = _chunkL2DEU7R6cjs.Stats; exports.TERMINAL_ORDER_STATUSES = _chunkL2DEU7R6cjs.TERMINAL_ORDER_STATUSES; exports.TIMESTAMP_HEADER = _chunkL2DEU7R6cjs.TIMESTAMP_HEADER; exports.USER_AGENT = _chunkL2DEU7R6cjs.USER_AGENT; exports.VERSION = _chunkL2DEU7R6cjs.VERSION; exports.baseUrlFor = _chunkL2DEU7R6cjs.baseUrlFor; exports.buildMessage = _chunkL2DEU7R6cjs.buildMessage; exports.centsToDollars = _chunkL2DEU7R6cjs.centsToDollars; exports.convertBook = _chunkL2DEU7R6cjs.convertBook; exports.convertMarketChannelPayload = _chunkL2DEU7R6cjs.convertMarketChannelPayload; exports.convertMarketPayload = _chunkL2DEU7R6cjs.convertMarketPayload; exports.convertMarketsFrame = _chunkL2DEU7R6cjs.convertMarketsFrame; exports.environmentNamed = _chunkL2DEU7R6cjs.environmentNamed; exports.errorForStatus = _chunkL2DEU7R6cjs.errorForStatus; exports.geoRejection = _chunkL2DEU7R6cjs.geoRejection; exports.handshakePath = _chunkL2DEU7R6cjs.handshakePath; exports.isValidLine = _chunkL2DEU7R6cjs.isValidLine; exports.loadPrivateKey = _chunkL2DEU7R6cjs.loadPrivateKey; exports.orderBody = _chunkL2DEU7R6cjs.orderBody; exports.requestPath = _chunkL2DEU7R6cjs.requestPath; exports.resolveHost = _chunkL2DEU7R6cjs.resolveHost; exports.resolveSettings = _chunkL2DEU7R6cjs.resolveSettings; exports.signerFromPrivateKey = _chunkL2DEU7R6cjs.signerFromPrivateKey; exports.socketUrlFor = _chunkL2DEU7R6cjs.socketUrlFor; exports.toDollarString = _chunkL2DEU7R6cjs.toDollarString; exports.toQuantity = _chunkL2DEU7R6cjs.toQuantity;
121
127
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/tssdk/tssdk/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,m7GAAC","file":"/home/runner/work/tssdk/tssdk/dist/index.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/tssdk/tssdk/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,8lHAAC","file":"/home/runner/work/tssdk/tssdk/dist/index.cjs"}
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AcceptTermsOptions, a as AccountChange, b as AccountChangeKind, c as AccountState, d as AccountView, e as AccountViewOptions, f as ApiKeyCredentials, g as AuthProvider, h as AuthRequest, B as Balance, i as BatchOrderResult, j as BookLevel, C as Cancellation, k as Channel, l as ChannelMessage, E as Environment, m as Environments, n as Error, o as Event, p as EventsQuery, F as FeeTransaction, q as FetchLike, r as Fill, s as FillsQuery, G as GeoCheckResult, t as GeoLocationProvider, u as GeoOption, v as GeoRejection, H as HOSTS, K as KEY_HEADER, L as Logger, M as Market, w as MarketFilter, x as MarketStat, y as MarketStatsQuery, z as MarketsQuery, D as Me, I as MessageHandler, N as NO_RETRY, J as NewOrder, O as NewOrderInput, P as OPERATIONS, Q as Operation, R as OperationId, S as Order, T as OrderOptions, U as OrdersQuery, V as Page, W as PageQuery, X as PaymentTransaction, Y as Position, Z as PrivateKeyInput, _ as RecentTrade, $ as ReconnectPolicy, a0 as ReconnectPolicyOptions, a1 as Region, a2 as ResponseEvent, a3 as RetryPolicy, a4 as RetryPolicyOptions, a5 as SIGNATURE_HEADER, a6 as SNAPSHOT_EVENTS, a7 as STX, a8 as STXAPIException, a9 as STXAuthenticationException, aa as STXChannelException, ab as STXConfigException, ac as STXEnvironment, ad as STXException, ae as STXForbiddenException, af as STXGeoLocationException, ag as STXInsufficientScopeException, ah as STXInvalidTokenException, ai as STXNotFoundException, aj as STXOptions, ak as STXRateLimitException, al as STXRejectedException, am as STXServerException, an as STXTimeoutException, ao as STXTransportException, ap as STXValidationException, aq as STXWebSocket, ar as STXWebSocketOptions, as as Settlement, at as SettlementsQuery, au as Signer, av as StatDetail, aw as StrList, ax as TERMINAL_ORDER_STATUSES, ay as TIMESTAMP_HEADER, az as Transaction, aA as USER_AGENT, aB as VERSION, aC as WebSocketAuthContext, aD as baseUrlFor, aE as buildMessage, aF as environmentNamed, aG as errorForStatus, aH as geoRejection, aI as handshakePath, aJ as loadPrivateKey, aK as models, aL as orderBody, aM as requestPath, aN as resolveHost, aO as signerFromPrivateKey, aP as socketUrlFor } from './client-CA1d-osT.cjs';
1
+ export { A as AcceptTermsOptions, a as AccountChange, b as AccountChangeKind, c as AccountState, d as AccountView, e as AccountViewOptions, f as ApiKeyCredentials, g as AuthProvider, h as AuthRequest, B as Balance, i as BatchOrderResult, j as BookLevel, C as Cancellation, k as Channel, l as ChannelMessage, m as CreateMarketResult, n as CreateMarketsOptions, E as Environment, o as Environments, p as Error, q as Event, r as EventPlayer, s as EventPlayers, t as EventStat, u as EventTeam, v as EventsQuery, F as FeeTransaction, w as FetchLike, x as Fill, y as FillsQuery, G as GeoCheckResult, z as GeoLocationProvider, D as GeoOption, H as GeoRejection, I as HOSTS, K as KEY_HEADER, J as KnownStat, L as Leaderboard, M as LeaderboardEntry, N as LeaderboardStanding, O as Logger, P as MAX_MARKETS_PER_REQUEST, Q as Market, R as MarketFilter, S as MarketRejectionReason, T as MarketRequestEcho, U as MarketStat, V as MarketStatsQuery, W as MarketsQuery, X as Me, Y as MessageHandler, Z as NO_RETRY, _ as NewMarketInput, $ as NewOrder, a0 as NewOrderInput, a1 as OPERATIONS, a2 as Operation, a3 as OperationId, a4 as Order, a5 as OrderOptions, a6 as OrdersQuery, a7 as Page, a8 as PageQuery, a9 as PaymentTransaction, aa as Position, ab as PrivateKeyInput, ac as ProfileUpdate, ad as RecentTrade, ae as ReconnectPolicy, af as ReconnectPolicyOptions, ag as Region, ah as ResponseEvent, ai as RetryPolicy, aj as RetryPolicyOptions, ak as SIGNATURE_HEADER, al as SNAPSHOT_EVENTS, am as STX, an as STXAPIException, ao as STXAuthenticationException, ap as STXChannelException, aq as STXConfigException, ar as STXEnvironment, as as STXException, at as STXForbiddenException, au as STXGeoLocationException, av as STXInsufficientScopeException, aw as STXInvalidTokenException, ax as STXNotFoundException, ay as STXOptions, az as STXRateLimitException, aA as STXRejectedException, aB as STXServerException, aC as STXTimeoutException, aD as STXTransportException, aE as STXValidationException, aF as STXWebSocket, aG as STXWebSocketOptions, aH as Settlement, aI as SettlementsQuery, aJ as Signer, aK as Stat, aL as StatDetail, aM as Stats, aN as StrList, aO as TERMINAL_ORDER_STATUSES, aP as TIMESTAMP_HEADER, aQ as Transaction, aR as USER_AGENT, aS as VERSION, aT as WebSocketAuthContext, aU as baseUrlFor, aV as buildMessage, aW as environmentNamed, aX as errorForStatus, aY as geoRejection, aZ as handshakePath, a_ as isValidLine, a$ as loadPrivateKey, b0 as models, b1 as orderBody, b2 as requestPath, b3 as resolveHost, b4 as signerFromPrivateKey, b5 as socketUrlFor } from './client-E5Lg6k8d.cjs';
2
2
  import 'node:crypto';
3
3
 
4
4
  /** The fully resolved configuration the clients consume. */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AcceptTermsOptions, a as AccountChange, b as AccountChangeKind, c as AccountState, d as AccountView, e as AccountViewOptions, f as ApiKeyCredentials, g as AuthProvider, h as AuthRequest, B as Balance, i as BatchOrderResult, j as BookLevel, C as Cancellation, k as Channel, l as ChannelMessage, E as Environment, m as Environments, n as Error, o as Event, p as EventsQuery, F as FeeTransaction, q as FetchLike, r as Fill, s as FillsQuery, G as GeoCheckResult, t as GeoLocationProvider, u as GeoOption, v as GeoRejection, H as HOSTS, K as KEY_HEADER, L as Logger, M as Market, w as MarketFilter, x as MarketStat, y as MarketStatsQuery, z as MarketsQuery, D as Me, I as MessageHandler, N as NO_RETRY, J as NewOrder, O as NewOrderInput, P as OPERATIONS, Q as Operation, R as OperationId, S as Order, T as OrderOptions, U as OrdersQuery, V as Page, W as PageQuery, X as PaymentTransaction, Y as Position, Z as PrivateKeyInput, _ as RecentTrade, $ as ReconnectPolicy, a0 as ReconnectPolicyOptions, a1 as Region, a2 as ResponseEvent, a3 as RetryPolicy, a4 as RetryPolicyOptions, a5 as SIGNATURE_HEADER, a6 as SNAPSHOT_EVENTS, a7 as STX, a8 as STXAPIException, a9 as STXAuthenticationException, aa as STXChannelException, ab as STXConfigException, ac as STXEnvironment, ad as STXException, ae as STXForbiddenException, af as STXGeoLocationException, ag as STXInsufficientScopeException, ah as STXInvalidTokenException, ai as STXNotFoundException, aj as STXOptions, ak as STXRateLimitException, al as STXRejectedException, am as STXServerException, an as STXTimeoutException, ao as STXTransportException, ap as STXValidationException, aq as STXWebSocket, ar as STXWebSocketOptions, as as Settlement, at as SettlementsQuery, au as Signer, av as StatDetail, aw as StrList, ax as TERMINAL_ORDER_STATUSES, ay as TIMESTAMP_HEADER, az as Transaction, aA as USER_AGENT, aB as VERSION, aC as WebSocketAuthContext, aD as baseUrlFor, aE as buildMessage, aF as environmentNamed, aG as errorForStatus, aH as geoRejection, aI as handshakePath, aJ as loadPrivateKey, aK as models, aL as orderBody, aM as requestPath, aN as resolveHost, aO as signerFromPrivateKey, aP as socketUrlFor } from './client-CA1d-osT.js';
1
+ export { A as AcceptTermsOptions, a as AccountChange, b as AccountChangeKind, c as AccountState, d as AccountView, e as AccountViewOptions, f as ApiKeyCredentials, g as AuthProvider, h as AuthRequest, B as Balance, i as BatchOrderResult, j as BookLevel, C as Cancellation, k as Channel, l as ChannelMessage, m as CreateMarketResult, n as CreateMarketsOptions, E as Environment, o as Environments, p as Error, q as Event, r as EventPlayer, s as EventPlayers, t as EventStat, u as EventTeam, v as EventsQuery, F as FeeTransaction, w as FetchLike, x as Fill, y as FillsQuery, G as GeoCheckResult, z as GeoLocationProvider, D as GeoOption, H as GeoRejection, I as HOSTS, K as KEY_HEADER, J as KnownStat, L as Leaderboard, M as LeaderboardEntry, N as LeaderboardStanding, O as Logger, P as MAX_MARKETS_PER_REQUEST, Q as Market, R as MarketFilter, S as MarketRejectionReason, T as MarketRequestEcho, U as MarketStat, V as MarketStatsQuery, W as MarketsQuery, X as Me, Y as MessageHandler, Z as NO_RETRY, _ as NewMarketInput, $ as NewOrder, a0 as NewOrderInput, a1 as OPERATIONS, a2 as Operation, a3 as OperationId, a4 as Order, a5 as OrderOptions, a6 as OrdersQuery, a7 as Page, a8 as PageQuery, a9 as PaymentTransaction, aa as Position, ab as PrivateKeyInput, ac as ProfileUpdate, ad as RecentTrade, ae as ReconnectPolicy, af as ReconnectPolicyOptions, ag as Region, ah as ResponseEvent, ai as RetryPolicy, aj as RetryPolicyOptions, ak as SIGNATURE_HEADER, al as SNAPSHOT_EVENTS, am as STX, an as STXAPIException, ao as STXAuthenticationException, ap as STXChannelException, aq as STXConfigException, ar as STXEnvironment, as as STXException, at as STXForbiddenException, au as STXGeoLocationException, av as STXInsufficientScopeException, aw as STXInvalidTokenException, ax as STXNotFoundException, ay as STXOptions, az as STXRateLimitException, aA as STXRejectedException, aB as STXServerException, aC as STXTimeoutException, aD as STXTransportException, aE as STXValidationException, aF as STXWebSocket, aG as STXWebSocketOptions, aH as Settlement, aI as SettlementsQuery, aJ as Signer, aK as Stat, aL as StatDetail, aM as Stats, aN as StrList, aO as TERMINAL_ORDER_STATUSES, aP as TIMESTAMP_HEADER, aQ as Transaction, aR as USER_AGENT, aS as VERSION, aT as WebSocketAuthContext, aU as baseUrlFor, aV as buildMessage, aW as environmentNamed, aX as errorForStatus, aY as geoRejection, aZ as handshakePath, a_ as isValidLine, a$ as loadPrivateKey, b0 as models, b1 as orderBody, b2 as requestPath, b3 as resolveHost, b4 as signerFromPrivateKey, b5 as socketUrlFor } from './client-E5Lg6k8d.js';
2
2
  import 'node:crypto';
3
3
 
4
4
  /** The fully resolved configuration the clients consume. */
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  Environments,
8
8
  HOSTS,
9
9
  KEY_HEADER,
10
+ MAX_MARKETS_PER_REQUEST,
10
11
  NO_RETRY,
11
12
  OPERATIONS,
12
13
  Page,
@@ -33,6 +34,7 @@ import {
33
34
  STXTransportException,
34
35
  STXValidationException,
35
36
  STXWebSocket,
37
+ Stats,
36
38
  TERMINAL_ORDER_STATUSES,
37
39
  TIMESTAMP_HEADER,
38
40
  USER_AGENT,
@@ -48,6 +50,7 @@ import {
48
50
  errorForStatus,
49
51
  geoRejection,
50
52
  handshakePath,
53
+ isValidLine,
51
54
  loadPrivateKey,
52
55
  orderBody,
53
56
  requestPath,
@@ -57,7 +60,7 @@ import {
57
60
  socketUrlFor,
58
61
  toDollarString,
59
62
  toQuantity
60
- } from "./chunk-CDXZOW53.js";
63
+ } from "./chunk-H7XZDE2U.js";
61
64
  export {
62
65
  AccountView,
63
66
  ApiKeyCredentials,
@@ -67,6 +70,7 @@ export {
67
70
  Environments,
68
71
  HOSTS,
69
72
  KEY_HEADER,
73
+ MAX_MARKETS_PER_REQUEST,
70
74
  NO_RETRY,
71
75
  OPERATIONS,
72
76
  Page,
@@ -93,6 +97,7 @@ export {
93
97
  STXTransportException,
94
98
  STXValidationException,
95
99
  STXWebSocket,
100
+ Stats,
96
101
  TERMINAL_ORDER_STATUSES,
97
102
  TIMESTAMP_HEADER,
98
103
  USER_AGENT,
@@ -108,6 +113,7 @@ export {
108
113
  errorForStatus,
109
114
  geoRejection,
110
115
  handshakePath,
116
+ isValidLine,
111
117
  loadPrivateKey,
112
118
  orderBody,
113
119
  requestPath,
package/dist/oauth.cjs CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkASOLCDBGcjs = require('./chunk-ASOLCDBG.cjs');
10
+ var _chunkL2DEU7R6cjs = require('./chunk-L2DEU7R6.cjs');
11
11
 
12
12
  // src/oauth/endpoints.ts
13
13
  var DEFAULT_ENDPOINTS = {
@@ -24,12 +24,12 @@ var WELL_KNOWN = {
24
24
  function resolveOAuthConfig(input) {
25
25
  const env = _nullishCoalesce(_optionalChain([globalThis, 'access', _ => _.process, 'optionalAccess', _2 => _2.env]), () => ( {}));
26
26
  const host = _nullishCoalesce(_nullishCoalesce(input.baseUrl, () => ( env.STX_HOST)), () => ( env.STX_BASE_URL));
27
- if (!host) throw new (0, _chunkASOLCDBGcjs.STXConfigException)("An OAuth base URL is required. Pass { baseUrl } or set STX_HOST.");
27
+ if (!host) throw new (0, _chunkL2DEU7R6cjs.STXConfigException)("An OAuth base URL is required. Pass { baseUrl } or set STX_HOST.");
28
28
  const fetchImpl = _nullishCoalesce(input.fetch, () => ( globalThis.fetch));
29
29
  if (typeof fetchImpl !== "function") {
30
- throw new (0, _chunkASOLCDBGcjs.STXConfigException)("No fetch implementation available. Use Node 18+, or pass { fetch }.");
30
+ throw new (0, _chunkL2DEU7R6cjs.STXConfigException)("No fetch implementation available. Use Node 18+, or pass { fetch }.");
31
31
  }
32
- return { baseUrl: _chunkASOLCDBGcjs.baseUrlFor.call(void 0, null, null, host), fetch: fetchImpl };
32
+ return { baseUrl: _chunkL2DEU7R6cjs.baseUrlFor.call(void 0, null, null, host), fetch: fetchImpl };
33
33
  }
34
34
  function joinUrl(baseUrl, path) {
35
35
  if (/^https?:\/\//i.test(path)) return path;
@@ -37,7 +37,7 @@ function joinUrl(baseUrl, path) {
37
37
  }
38
38
 
39
39
  // src/oauth/errors.ts
40
- var STXOAuthException = class extends _chunkASOLCDBGcjs.STXAuthenticationException {
40
+ var STXOAuthException = class extends _chunkL2DEU7R6cjs.STXAuthenticationException {
41
41
  /** The RFC error code: `invalid_client`, `invalid_grant`, `invalid_scope`, ... */
42
42
 
43
43
 
@@ -56,7 +56,7 @@ var STXOAuthException = class extends _chunkASOLCDBGcjs.STXAuthenticationExcepti
56
56
  this.retryAfter = retryAfter;
57
57
  }
58
58
  };
59
- var STXGrantRevokedException = class extends _chunkASOLCDBGcjs.STXAuthenticationException {
59
+ var STXGrantRevokedException = class extends _chunkL2DEU7R6cjs.STXAuthenticationException {
60
60
  constructor(message = "OAuth grant revoked: the member must re-authorize.") {
61
61
  super(message, { statusCode: 400 });
62
62
  }
@@ -141,7 +141,7 @@ function rfcError(text) {
141
141
  }
142
142
  }
143
143
  function httpError(status, text, path) {
144
- return new (0, _chunkASOLCDBGcjs.STXAPIException)(`HTTP ${status} from ${path}: ${text.slice(0, 500)}`, {
144
+ return new (0, _chunkL2DEU7R6cjs.STXAPIException)(`HTTP ${status} from ${path}: ${text.slice(0, 500)}`, {
145
145
  statusCode: status,
146
146
  body: text,
147
147
  path
@@ -168,8 +168,10 @@ var MemberScopes = {
168
168
  var AppScopes = {
169
169
  /** The market catalog (`GET /api/v1/markets`) and the market data channels. */
170
170
  MARKET_DATA: "market_data",
171
- /** The event catalog (`GET /api/v1/events`) and the `events` channel. */
172
- EVENTS: "events"
171
+ /** The event catalog (`GET /api/v1/events`, an event's players) and the `events` channel. */
172
+ EVENTS: "events",
173
+ /** Create markets (`POST /api/v1/markets`). Granted by STX only. */
174
+ MARKETS_WRITE: "markets.write"
173
175
  };
174
176
  var Scopes = { ...MemberScopes, ...AppScopes };
175
177
  var ALL_MEMBER_SCOPES = Object.values(MemberScopes);
@@ -290,7 +292,7 @@ var OAuthClient = (_class = class _OAuthClient {
290
292
  */
291
293
  async beginAuthorization(pending, params = {}) {
292
294
  const redirectUri = _nullishCoalesce(params.redirectUri, () => ( this.redirectUri));
293
- if (!redirectUri) throw new (0, _chunkASOLCDBGcjs.STXConfigException)("redirectUri is required to build an authorize URL.");
295
+ if (!redirectUri) throw new (0, _chunkL2DEU7R6cjs.STXConfigException)("redirectUri is required to build an authorize URL.");
294
296
  const auth = await this.authorizationUrl({ ...params, redirectUri });
295
297
  await pending.put(auth.state, {
296
298
  codeVerifier: auth.codeVerifier,
@@ -332,7 +334,7 @@ var OAuthClient = (_class = class _OAuthClient {
332
334
  let memberKey;
333
335
  if (opts.store) {
334
336
  memberKey = typeof opts.memberKey === "function" ? opts.memberKey(entry.data) : opts.memberKey;
335
- if (!memberKey) throw new (0, _chunkASOLCDBGcjs.STXConfigException)("Pass memberKey along with store.");
337
+ if (!memberKey) throw new (0, _chunkL2DEU7R6cjs.STXConfigException)("Pass memberKey along with store.");
336
338
  await opts.store.set(memberKey, tokenSetToStored(tokens));
337
339
  }
338
340
  return { tokens, scopes: parseScopes(tokens.scope), data: entry.data, memberKey };
@@ -341,7 +343,7 @@ var OAuthClient = (_class = class _OAuthClient {
341
343
  buildAuthorizeUrl(params) {
342
344
  const redirectUri = _nullishCoalesce(params.redirectUri, () => ( this.redirectUri));
343
345
  if (!redirectUri) {
344
- throw new (0, _chunkASOLCDBGcjs.STXConfigException)("redirectUri is required to build an authorize URL.");
346
+ throw new (0, _chunkL2DEU7R6cjs.STXConfigException)("redirectUri is required to build an authorize URL.");
345
347
  }
346
348
  const url = new URL(joinUrl(this.baseUrl, this.endpoints.authorize));
347
349
  const search = {
@@ -363,7 +365,7 @@ var OAuthClient = (_class = class _OAuthClient {
363
365
  exchangeCode(args) {
364
366
  const redirectUri = _nullishCoalesce(args.redirectUri, () => ( this.redirectUri));
365
367
  if (!redirectUri) {
366
- throw new (0, _chunkASOLCDBGcjs.STXConfigException)("redirectUri is required to exchange a code.");
368
+ throw new (0, _chunkL2DEU7R6cjs.STXConfigException)("redirectUri is required to exchange a code.");
367
369
  }
368
370
  return this.postToken(
369
371
  new URLSearchParams({
@@ -404,7 +406,7 @@ var OAuthClient = (_class = class _OAuthClient {
404
406
  */
405
407
  clientCredentials(scope) {
406
408
  if (this.isPublic) {
407
- throw new (0, _chunkASOLCDBGcjs.STXConfigException)(
409
+ throw new (0, _chunkL2DEU7R6cjs.STXConfigException)(
408
410
  "client_credentials needs a client secret; a public client cannot mint an app token."
409
411
  );
410
412
  }
@@ -508,7 +510,7 @@ var OAuthClient = (_class = class _OAuthClient {
508
510
  */
509
511
  memberClient(store, memberKey, opts = {}) {
510
512
  const { session, ...rest } = opts;
511
- return new (0, _chunkASOLCDBGcjs.STX)({
513
+ return new (0, _chunkL2DEU7R6cjs.STX)({
512
514
  ...rest,
513
515
  host: this.baseUrl,
514
516
  fetch: _nullishCoalesce(rest.fetch, () => ( this.fetch)),
@@ -521,7 +523,7 @@ var OAuthClient = (_class = class _OAuthClient {
521
523
  * market channels. Scope defaults to every app scope the client may hold.
522
524
  */
523
525
  appClient(scope, opts = {}) {
524
- return new (0, _chunkASOLCDBGcjs.STX)({ ...opts, host: this.baseUrl, fetch: _nullishCoalesce(opts.fetch, () => ( this.fetch)), auth: this.app(scope) });
526
+ return new (0, _chunkL2DEU7R6cjs.STX)({ ...opts, host: this.baseUrl, fetch: _nullishCoalesce(opts.fetch, () => ( this.fetch)), auth: this.app(scope) });
525
527
  }
526
528
  /** @internal The in-flight refresh map for one store; see `OAuthSessionAuth`. */
527
529
  _refreshesFor(store) {
@@ -697,7 +699,7 @@ var OAuthSessionAuth = (_class4 = class {
697
699
  async tokens() {
698
700
  let tokens = await this.load();
699
701
  if (!tokens) {
700
- throw new (0, _chunkASOLCDBGcjs.STXConfigException)(`No tokens stored for member "${this.memberKey}". Complete the OAuth flow first.`);
702
+ throw new (0, _chunkL2DEU7R6cjs.STXConfigException)(`No tokens stored for member "${this.memberKey}". Complete the OAuth flow first.`);
701
703
  }
702
704
  if (tokens.refreshToken && tokens.expiresAt !== void 0 && tokens.expiresAt - Date.now() <= this.skewMs) {
703
705
  const refreshed = await this.refresh(tokens.refreshToken);
@@ -879,7 +881,7 @@ async function fetchWellKnown(baseUrl, path, opts) {
879
881
  }
880
882
  }
881
883
  function httpError2(status, text, path) {
882
- return new (0, _chunkASOLCDBGcjs.STXAPIException)(`HTTP ${status} from ${path}: ${text.slice(0, 500)}`, {
884
+ return new (0, _chunkL2DEU7R6cjs.STXAPIException)(`HTTP ${status} from ${path}: ${text.slice(0, 500)}`, {
883
885
  statusCode: status,
884
886
  body: text,
885
887
  path
@@ -963,5 +965,5 @@ var MemoryPendingAuthorizationStore = (_class7 = class {constructor() { _class7.
963
965
 
964
966
 
965
967
 
966
- exports.ALL_APP_SCOPES = ALL_APP_SCOPES; exports.ALL_MEMBER_SCOPES = ALL_MEMBER_SCOPES; exports.AppScopes = AppScopes; exports.AppTokenProvider = AppTokenProvider; exports.DEFAULT_ENDPOINTS = DEFAULT_ENDPOINTS; exports.LEGACY_SCOPES = LEGACY_SCOPES; exports.MemberScopes = MemberScopes; exports.MemoryPendingAuthorizationStore = MemoryPendingAuthorizationStore; exports.MemoryTokenStore = MemoryTokenStore; exports.OAuthAppAuth = OAuthAppAuth; exports.OAuthBearerAuth = OAuthBearerAuth; exports.OAuthClient = OAuthClient; exports.OAuthSessionAuth = OAuthSessionAuth; exports.STXAuthenticationException = _chunkASOLCDBGcjs.STXAuthenticationException; exports.STXForbiddenException = _chunkASOLCDBGcjs.STXForbiddenException; exports.STXGrantRevokedException = STXGrantRevokedException; exports.STXInsufficientScopeException = _chunkASOLCDBGcjs.STXInsufficientScopeException; exports.STXInvalidTokenException = _chunkASOLCDBGcjs.STXInvalidTokenException; exports.STXOAuthException = STXOAuthException; exports.Scopes = Scopes; exports.WELL_KNOWN = WELL_KNOWN; exports.base64url = base64url; exports.canonicalScope = canonicalScope; exports.codeChallengeS256 = codeChallengeS256; exports.createPkce = createPkce; exports.discoverMetadata = discoverMetadata; exports.discoverProtectedResource = discoverProtectedResource; exports.formatScopes = formatScopes; exports.generateCodeVerifier = generateCodeVerifier; exports.generateState = generateState; exports.isAppScope = isAppScope; exports.isMemberScope = isMemberScope; exports.joinUrl = joinUrl; exports.parseScopes = parseScopes; exports.parseTokenResponse = parseTokenResponse; exports.readCallback = readCallback; exports.registerClient = registerClient; exports.rfcError = rfcError; exports.tokenSetToStored = tokenSetToStored;
968
+ exports.ALL_APP_SCOPES = ALL_APP_SCOPES; exports.ALL_MEMBER_SCOPES = ALL_MEMBER_SCOPES; exports.AppScopes = AppScopes; exports.AppTokenProvider = AppTokenProvider; exports.DEFAULT_ENDPOINTS = DEFAULT_ENDPOINTS; exports.LEGACY_SCOPES = LEGACY_SCOPES; exports.MemberScopes = MemberScopes; exports.MemoryPendingAuthorizationStore = MemoryPendingAuthorizationStore; exports.MemoryTokenStore = MemoryTokenStore; exports.OAuthAppAuth = OAuthAppAuth; exports.OAuthBearerAuth = OAuthBearerAuth; exports.OAuthClient = OAuthClient; exports.OAuthSessionAuth = OAuthSessionAuth; exports.STXAuthenticationException = _chunkL2DEU7R6cjs.STXAuthenticationException; exports.STXForbiddenException = _chunkL2DEU7R6cjs.STXForbiddenException; exports.STXGrantRevokedException = STXGrantRevokedException; exports.STXInsufficientScopeException = _chunkL2DEU7R6cjs.STXInsufficientScopeException; exports.STXInvalidTokenException = _chunkL2DEU7R6cjs.STXInvalidTokenException; exports.STXOAuthException = STXOAuthException; exports.Scopes = Scopes; exports.WELL_KNOWN = WELL_KNOWN; exports.base64url = base64url; exports.canonicalScope = canonicalScope; exports.codeChallengeS256 = codeChallengeS256; exports.createPkce = createPkce; exports.discoverMetadata = discoverMetadata; exports.discoverProtectedResource = discoverProtectedResource; exports.formatScopes = formatScopes; exports.generateCodeVerifier = generateCodeVerifier; exports.generateState = generateState; exports.isAppScope = isAppScope; exports.isMemberScope = isMemberScope; exports.joinUrl = joinUrl; exports.parseScopes = parseScopes; exports.parseTokenResponse = parseTokenResponse; exports.readCallback = readCallback; exports.registerClient = registerClient; exports.rfcError = rfcError; exports.tokenSetToStored = tokenSetToStored;
967
969
  //# sourceMappingURL=oauth.cjs.map