@stxapp/stx-typescript 0.6.1 → 0.6.2

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.
@@ -2370,9 +2370,9 @@ declare class STXValidationException extends STXAPIException {
2370
2370
  declare class STXAuthenticationException extends STXAPIException {
2371
2371
  }
2372
2372
  /**
2373
- * 403: the key is read-only, or the account may not do this. For an OAuth
2374
- * bearer token refused for scope, `requiredScopes` lists what would satisfy
2375
- * the call (from the `WWW-Authenticate` challenge).
2373
+ * 403: the key is read-only, or the account may not do this. When the server
2374
+ * names the scopes that would satisfy the call (in the `WWW-Authenticate`
2375
+ * challenge), `requiredScopes` lists them.
2376
2376
  */
2377
2377
  declare class STXForbiddenException extends STXAPIException {
2378
2378
  readonly requiredScopes: readonly string[];
@@ -2556,8 +2556,8 @@ declare class ApiKeyCredentials implements AuthProvider {
2556
2556
  toString(): string;
2557
2557
  }
2558
2558
 
2559
- declare const VERSION = "0.6.1";
2560
- declare const USER_AGENT = "stx-typescript/0.6.1";
2559
+ declare const VERSION = "0.6.2";
2560
+ declare const USER_AGENT = "stx-typescript/0.6.2";
2561
2561
  /**
2562
2562
  * `Symbol.asyncDispose` where the runtime has it (Node 20+, Bun), so
2563
2563
  * `await using client = new STX()` works there; a registered stand-in on
@@ -3212,9 +3212,14 @@ declare class STX {
3212
3212
  */
3213
3213
  me(): Promise<Me>;
3214
3214
  /**
3215
- * The user id from `me()`, fetched once and cached. An OAuth token granted
3216
- * without `profile.read` cannot call `me()`; the id then comes from
3217
- * `balance()` (`balance.read`), which carries the same `user_id`.
3215
+ * @internal The cached `me()` when it has both ids, else a fresh `me()`.
3216
+ * Never falls back to `balance()`, so the channel fallbacks can use it.
3217
+ */
3218
+ _identity(): Promise<Me>;
3219
+ /**
3220
+ * The user id from `me()`, fetched once and cached. If `me()` is not
3221
+ * permitted, the id comes from `balance()`, which carries the same
3222
+ * `user_id`.
3218
3223
  */
3219
3224
  userId(): Promise<string>;
3220
3225
  /**
@@ -2370,9 +2370,9 @@ declare class STXValidationException extends STXAPIException {
2370
2370
  declare class STXAuthenticationException extends STXAPIException {
2371
2371
  }
2372
2372
  /**
2373
- * 403: the key is read-only, or the account may not do this. For an OAuth
2374
- * bearer token refused for scope, `requiredScopes` lists what would satisfy
2375
- * the call (from the `WWW-Authenticate` challenge).
2373
+ * 403: the key is read-only, or the account may not do this. When the server
2374
+ * names the scopes that would satisfy the call (in the `WWW-Authenticate`
2375
+ * challenge), `requiredScopes` lists them.
2376
2376
  */
2377
2377
  declare class STXForbiddenException extends STXAPIException {
2378
2378
  readonly requiredScopes: readonly string[];
@@ -2556,8 +2556,8 @@ declare class ApiKeyCredentials implements AuthProvider {
2556
2556
  toString(): string;
2557
2557
  }
2558
2558
 
2559
- declare const VERSION = "0.6.1";
2560
- declare const USER_AGENT = "stx-typescript/0.6.1";
2559
+ declare const VERSION = "0.6.2";
2560
+ declare const USER_AGENT = "stx-typescript/0.6.2";
2561
2561
  /**
2562
2562
  * `Symbol.asyncDispose` where the runtime has it (Node 20+, Bun), so
2563
2563
  * `await using client = new STX()` works there; a registered stand-in on
@@ -3212,9 +3212,14 @@ declare class STX {
3212
3212
  */
3213
3213
  me(): Promise<Me>;
3214
3214
  /**
3215
- * The user id from `me()`, fetched once and cached. An OAuth token granted
3216
- * without `profile.read` cannot call `me()`; the id then comes from
3217
- * `balance()` (`balance.read`), which carries the same `user_id`.
3215
+ * @internal The cached `me()` when it has both ids, else a fresh `me()`.
3216
+ * Never falls back to `balance()`, so the channel fallbacks can use it.
3217
+ */
3218
+ _identity(): Promise<Me>;
3219
+ /**
3220
+ * The user id from `me()`, fetched once and cached. If `me()` is not
3221
+ * permitted, the id comes from `balance()`, which carries the same
3222
+ * `user_id`.
3218
3223
  */
3219
3224
  userId(): Promise<string>;
3220
3225
  /**
package/dist/index.cjs CHANGED
@@ -57,7 +57,7 @@
57
57
 
58
58
 
59
59
 
60
- var _chunk7O5ZGZQIcjs = require('./chunk-7O5ZGZQI.cjs');
60
+ var _chunkWGIYEJBIcjs = require('./chunk-WGIYEJBI.cjs');
61
61
 
62
62
 
63
63
 
@@ -117,5 +117,5 @@ var _chunk7O5ZGZQIcjs = require('./chunk-7O5ZGZQI.cjs');
117
117
 
118
118
 
119
119
 
120
- exports.AccountView = _chunk7O5ZGZQIcjs.AccountView; exports.ApiKeyCredentials = _chunk7O5ZGZQIcjs.ApiKeyCredentials; exports.Channel = _chunk7O5ZGZQIcjs.Channel; exports.ChannelMessage = _chunk7O5ZGZQIcjs.ChannelMessage; exports.Environment = _chunk7O5ZGZQIcjs.Environment; exports.Environments = _chunk7O5ZGZQIcjs.Environments; exports.HOSTS = _chunk7O5ZGZQIcjs.HOSTS; exports.KEY_HEADER = _chunk7O5ZGZQIcjs.KEY_HEADER; exports.NO_RETRY = _chunk7O5ZGZQIcjs.NO_RETRY; exports.OPERATIONS = _chunk7O5ZGZQIcjs.OPERATIONS; exports.Page = _chunk7O5ZGZQIcjs.Page; exports.ReconnectPolicy = _chunk7O5ZGZQIcjs.ReconnectPolicy; exports.Region = _chunk7O5ZGZQIcjs.Region; exports.RetryPolicy = _chunk7O5ZGZQIcjs.RetryPolicy; exports.SIGNATURE_HEADER = _chunk7O5ZGZQIcjs.SIGNATURE_HEADER; exports.SNAPSHOT_EVENTS = _chunk7O5ZGZQIcjs.SNAPSHOT_EVENTS; exports.STX = _chunk7O5ZGZQIcjs.STX; exports.STXAPIException = _chunk7O5ZGZQIcjs.STXAPIException; exports.STXAuthenticationException = _chunk7O5ZGZQIcjs.STXAuthenticationException; exports.STXChannelException = _chunk7O5ZGZQIcjs.STXChannelException; exports.STXConfigException = _chunk7O5ZGZQIcjs.STXConfigException; exports.STXException = _chunk7O5ZGZQIcjs.STXException; exports.STXForbiddenException = _chunk7O5ZGZQIcjs.STXForbiddenException; exports.STXGeoLocationException = _chunk7O5ZGZQIcjs.STXGeoLocationException; exports.STXInsufficientScopeException = _chunk7O5ZGZQIcjs.STXInsufficientScopeException; exports.STXInvalidTokenException = _chunk7O5ZGZQIcjs.STXInvalidTokenException; exports.STXNotFoundException = _chunk7O5ZGZQIcjs.STXNotFoundException; exports.STXRateLimitException = _chunk7O5ZGZQIcjs.STXRateLimitException; exports.STXRejectedException = _chunk7O5ZGZQIcjs.STXRejectedException; exports.STXServerException = _chunk7O5ZGZQIcjs.STXServerException; exports.STXTimeoutException = _chunk7O5ZGZQIcjs.STXTimeoutException; exports.STXTransportException = _chunk7O5ZGZQIcjs.STXTransportException; exports.STXValidationException = _chunk7O5ZGZQIcjs.STXValidationException; exports.STXWebSocket = _chunk7O5ZGZQIcjs.STXWebSocket; exports.TERMINAL_ORDER_STATUSES = _chunk7O5ZGZQIcjs.TERMINAL_ORDER_STATUSES; exports.TIMESTAMP_HEADER = _chunk7O5ZGZQIcjs.TIMESTAMP_HEADER; exports.USER_AGENT = _chunk7O5ZGZQIcjs.USER_AGENT; exports.VERSION = _chunk7O5ZGZQIcjs.VERSION; exports.baseUrlFor = _chunk7O5ZGZQIcjs.baseUrlFor; exports.buildMessage = _chunk7O5ZGZQIcjs.buildMessage; exports.centsToDollars = _chunk7O5ZGZQIcjs.centsToDollars; exports.convertBook = _chunk7O5ZGZQIcjs.convertBook; exports.convertMarketChannelPayload = _chunk7O5ZGZQIcjs.convertMarketChannelPayload; exports.convertMarketPayload = _chunk7O5ZGZQIcjs.convertMarketPayload; exports.convertMarketsFrame = _chunk7O5ZGZQIcjs.convertMarketsFrame; exports.environmentNamed = _chunk7O5ZGZQIcjs.environmentNamed; exports.errorForStatus = _chunk7O5ZGZQIcjs.errorForStatus; exports.geoRejection = _chunk7O5ZGZQIcjs.geoRejection; exports.handshakePath = _chunk7O5ZGZQIcjs.handshakePath; exports.loadPrivateKey = _chunk7O5ZGZQIcjs.loadPrivateKey; exports.orderBody = _chunk7O5ZGZQIcjs.orderBody; exports.requestPath = _chunk7O5ZGZQIcjs.requestPath; exports.resolveHost = _chunk7O5ZGZQIcjs.resolveHost; exports.resolveSettings = _chunk7O5ZGZQIcjs.resolveSettings; exports.signerFromPrivateKey = _chunk7O5ZGZQIcjs.signerFromPrivateKey; exports.socketUrlFor = _chunk7O5ZGZQIcjs.socketUrlFor; exports.toDollarString = _chunk7O5ZGZQIcjs.toDollarString; exports.toQuantity = _chunk7O5ZGZQIcjs.toQuantity;
120
+ exports.AccountView = _chunkWGIYEJBIcjs.AccountView; exports.ApiKeyCredentials = _chunkWGIYEJBIcjs.ApiKeyCredentials; exports.Channel = _chunkWGIYEJBIcjs.Channel; exports.ChannelMessage = _chunkWGIYEJBIcjs.ChannelMessage; exports.Environment = _chunkWGIYEJBIcjs.Environment; exports.Environments = _chunkWGIYEJBIcjs.Environments; exports.HOSTS = _chunkWGIYEJBIcjs.HOSTS; exports.KEY_HEADER = _chunkWGIYEJBIcjs.KEY_HEADER; exports.NO_RETRY = _chunkWGIYEJBIcjs.NO_RETRY; exports.OPERATIONS = _chunkWGIYEJBIcjs.OPERATIONS; exports.Page = _chunkWGIYEJBIcjs.Page; exports.ReconnectPolicy = _chunkWGIYEJBIcjs.ReconnectPolicy; exports.Region = _chunkWGIYEJBIcjs.Region; exports.RetryPolicy = _chunkWGIYEJBIcjs.RetryPolicy; exports.SIGNATURE_HEADER = _chunkWGIYEJBIcjs.SIGNATURE_HEADER; exports.SNAPSHOT_EVENTS = _chunkWGIYEJBIcjs.SNAPSHOT_EVENTS; exports.STX = _chunkWGIYEJBIcjs.STX; exports.STXAPIException = _chunkWGIYEJBIcjs.STXAPIException; exports.STXAuthenticationException = _chunkWGIYEJBIcjs.STXAuthenticationException; exports.STXChannelException = _chunkWGIYEJBIcjs.STXChannelException; exports.STXConfigException = _chunkWGIYEJBIcjs.STXConfigException; exports.STXException = _chunkWGIYEJBIcjs.STXException; exports.STXForbiddenException = _chunkWGIYEJBIcjs.STXForbiddenException; exports.STXGeoLocationException = _chunkWGIYEJBIcjs.STXGeoLocationException; exports.STXInsufficientScopeException = _chunkWGIYEJBIcjs.STXInsufficientScopeException; exports.STXInvalidTokenException = _chunkWGIYEJBIcjs.STXInvalidTokenException; exports.STXNotFoundException = _chunkWGIYEJBIcjs.STXNotFoundException; exports.STXRateLimitException = _chunkWGIYEJBIcjs.STXRateLimitException; exports.STXRejectedException = _chunkWGIYEJBIcjs.STXRejectedException; exports.STXServerException = _chunkWGIYEJBIcjs.STXServerException; exports.STXTimeoutException = _chunkWGIYEJBIcjs.STXTimeoutException; exports.STXTransportException = _chunkWGIYEJBIcjs.STXTransportException; exports.STXValidationException = _chunkWGIYEJBIcjs.STXValidationException; exports.STXWebSocket = _chunkWGIYEJBIcjs.STXWebSocket; exports.TERMINAL_ORDER_STATUSES = _chunkWGIYEJBIcjs.TERMINAL_ORDER_STATUSES; exports.TIMESTAMP_HEADER = _chunkWGIYEJBIcjs.TIMESTAMP_HEADER; exports.USER_AGENT = _chunkWGIYEJBIcjs.USER_AGENT; exports.VERSION = _chunkWGIYEJBIcjs.VERSION; exports.baseUrlFor = _chunkWGIYEJBIcjs.baseUrlFor; exports.buildMessage = _chunkWGIYEJBIcjs.buildMessage; exports.centsToDollars = _chunkWGIYEJBIcjs.centsToDollars; exports.convertBook = _chunkWGIYEJBIcjs.convertBook; exports.convertMarketChannelPayload = _chunkWGIYEJBIcjs.convertMarketChannelPayload; exports.convertMarketPayload = _chunkWGIYEJBIcjs.convertMarketPayload; exports.convertMarketsFrame = _chunkWGIYEJBIcjs.convertMarketsFrame; exports.environmentNamed = _chunkWGIYEJBIcjs.environmentNamed; exports.errorForStatus = _chunkWGIYEJBIcjs.errorForStatus; exports.geoRejection = _chunkWGIYEJBIcjs.geoRejection; exports.handshakePath = _chunkWGIYEJBIcjs.handshakePath; exports.loadPrivateKey = _chunkWGIYEJBIcjs.loadPrivateKey; exports.orderBody = _chunkWGIYEJBIcjs.orderBody; exports.requestPath = _chunkWGIYEJBIcjs.requestPath; exports.resolveHost = _chunkWGIYEJBIcjs.resolveHost; exports.resolveSettings = _chunkWGIYEJBIcjs.resolveSettings; exports.signerFromPrivateKey = _chunkWGIYEJBIcjs.signerFromPrivateKey; exports.socketUrlFor = _chunkWGIYEJBIcjs.socketUrlFor; exports.toDollarString = _chunkWGIYEJBIcjs.toDollarString; exports.toQuantity = _chunkWGIYEJBIcjs.toQuantity;
121
121
  //# sourceMappingURL=index.cjs.map
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-wriBXPDx.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, 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-C0G5lsiP.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-wriBXPDx.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, 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-C0G5lsiP.js';
2
2
  import 'node:crypto';
3
3
 
4
4
  /** The fully resolved configuration the clients consume. */
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ import {
57
57
  socketUrlFor,
58
58
  toDollarString,
59
59
  toQuantity
60
- } from "./chunk-P7ZEHWKM.js";
60
+ } from "./chunk-X7B7WXJ3.js";
61
61
  export {
62
62
  AccountView,
63
63
  ApiKeyCredentials,
package/dist/oauth.cjs CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunk7O5ZGZQIcjs = require('./chunk-7O5ZGZQI.cjs');
10
+ var _chunkWGIYEJBIcjs = require('./chunk-WGIYEJBI.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, _chunk7O5ZGZQIcjs.STXConfigException)("An OAuth base URL is required. Pass { baseUrl } or set STX_HOST.");
27
+ if (!host) throw new (0, _chunkWGIYEJBIcjs.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, _chunk7O5ZGZQIcjs.STXConfigException)("No fetch implementation available. Use Node 18+, or pass { fetch }.");
30
+ throw new (0, _chunkWGIYEJBIcjs.STXConfigException)("No fetch implementation available. Use Node 18+, or pass { fetch }.");
31
31
  }
32
- return { baseUrl: _chunk7O5ZGZQIcjs.baseUrlFor.call(void 0, null, null, host), fetch: fetchImpl };
32
+ return { baseUrl: _chunkWGIYEJBIcjs.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 _chunk7O5ZGZQIcjs.STXAuthenticationException {
40
+ var STXOAuthException = class extends _chunkWGIYEJBIcjs.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 _chunk7O5ZGZQIcjs.STXAuthenticationExcepti
56
56
  this.retryAfter = retryAfter;
57
57
  }
58
58
  };
59
- var STXGrantRevokedException = class extends _chunk7O5ZGZQIcjs.STXAuthenticationException {
59
+ var STXGrantRevokedException = class extends _chunkWGIYEJBIcjs.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, _chunk7O5ZGZQIcjs.STXAPIException)(`HTTP ${status} from ${path}: ${text.slice(0, 500)}`, {
144
+ return new (0, _chunkWGIYEJBIcjs.STXAPIException)(`HTTP ${status} from ${path}: ${text.slice(0, 500)}`, {
145
145
  statusCode: status,
146
146
  body: text,
147
147
  path
@@ -290,7 +290,7 @@ var OAuthClient = (_class = class _OAuthClient {
290
290
  */
291
291
  async beginAuthorization(pending, params = {}) {
292
292
  const redirectUri = _nullishCoalesce(params.redirectUri, () => ( this.redirectUri));
293
- if (!redirectUri) throw new (0, _chunk7O5ZGZQIcjs.STXConfigException)("redirectUri is required to build an authorize URL.");
293
+ if (!redirectUri) throw new (0, _chunkWGIYEJBIcjs.STXConfigException)("redirectUri is required to build an authorize URL.");
294
294
  const auth = await this.authorizationUrl({ ...params, redirectUri });
295
295
  await pending.put(auth.state, {
296
296
  codeVerifier: auth.codeVerifier,
@@ -332,7 +332,7 @@ var OAuthClient = (_class = class _OAuthClient {
332
332
  let memberKey;
333
333
  if (opts.store) {
334
334
  memberKey = typeof opts.memberKey === "function" ? opts.memberKey(entry.data) : opts.memberKey;
335
- if (!memberKey) throw new (0, _chunk7O5ZGZQIcjs.STXConfigException)("Pass memberKey along with store.");
335
+ if (!memberKey) throw new (0, _chunkWGIYEJBIcjs.STXConfigException)("Pass memberKey along with store.");
336
336
  await opts.store.set(memberKey, tokenSetToStored(tokens));
337
337
  }
338
338
  return { tokens, scopes: parseScopes(tokens.scope), data: entry.data, memberKey };
@@ -341,7 +341,7 @@ var OAuthClient = (_class = class _OAuthClient {
341
341
  buildAuthorizeUrl(params) {
342
342
  const redirectUri = _nullishCoalesce(params.redirectUri, () => ( this.redirectUri));
343
343
  if (!redirectUri) {
344
- throw new (0, _chunk7O5ZGZQIcjs.STXConfigException)("redirectUri is required to build an authorize URL.");
344
+ throw new (0, _chunkWGIYEJBIcjs.STXConfigException)("redirectUri is required to build an authorize URL.");
345
345
  }
346
346
  const url = new URL(joinUrl(this.baseUrl, this.endpoints.authorize));
347
347
  const search = {
@@ -363,7 +363,7 @@ var OAuthClient = (_class = class _OAuthClient {
363
363
  exchangeCode(args) {
364
364
  const redirectUri = _nullishCoalesce(args.redirectUri, () => ( this.redirectUri));
365
365
  if (!redirectUri) {
366
- throw new (0, _chunk7O5ZGZQIcjs.STXConfigException)("redirectUri is required to exchange a code.");
366
+ throw new (0, _chunkWGIYEJBIcjs.STXConfigException)("redirectUri is required to exchange a code.");
367
367
  }
368
368
  return this.postToken(
369
369
  new URLSearchParams({
@@ -404,7 +404,7 @@ var OAuthClient = (_class = class _OAuthClient {
404
404
  */
405
405
  clientCredentials(scope) {
406
406
  if (this.isPublic) {
407
- throw new (0, _chunk7O5ZGZQIcjs.STXConfigException)(
407
+ throw new (0, _chunkWGIYEJBIcjs.STXConfigException)(
408
408
  "client_credentials needs a client secret; a public client cannot mint an app token."
409
409
  );
410
410
  }
@@ -508,7 +508,7 @@ var OAuthClient = (_class = class _OAuthClient {
508
508
  */
509
509
  memberClient(store, memberKey, opts = {}) {
510
510
  const { session, ...rest } = opts;
511
- return new (0, _chunk7O5ZGZQIcjs.STX)({
511
+ return new (0, _chunkWGIYEJBIcjs.STX)({
512
512
  ...rest,
513
513
  host: this.baseUrl,
514
514
  fetch: _nullishCoalesce(rest.fetch, () => ( this.fetch)),
@@ -521,7 +521,7 @@ var OAuthClient = (_class = class _OAuthClient {
521
521
  * market channels. Scope defaults to every app scope the client may hold.
522
522
  */
523
523
  appClient(scope, opts = {}) {
524
- return new (0, _chunk7O5ZGZQIcjs.STX)({ ...opts, host: this.baseUrl, fetch: _nullishCoalesce(opts.fetch, () => ( this.fetch)), auth: this.app(scope) });
524
+ return new (0, _chunkWGIYEJBIcjs.STX)({ ...opts, host: this.baseUrl, fetch: _nullishCoalesce(opts.fetch, () => ( this.fetch)), auth: this.app(scope) });
525
525
  }
526
526
  /** @internal The in-flight refresh map for one store; see `OAuthSessionAuth`. */
527
527
  _refreshesFor(store) {
@@ -697,7 +697,7 @@ var OAuthSessionAuth = (_class4 = class {
697
697
  async tokens() {
698
698
  let tokens = await this.load();
699
699
  if (!tokens) {
700
- throw new (0, _chunk7O5ZGZQIcjs.STXConfigException)(`No tokens stored for member "${this.memberKey}". Complete the OAuth flow first.`);
700
+ throw new (0, _chunkWGIYEJBIcjs.STXConfigException)(`No tokens stored for member "${this.memberKey}". Complete the OAuth flow first.`);
701
701
  }
702
702
  if (tokens.refreshToken && tokens.expiresAt !== void 0 && tokens.expiresAt - Date.now() <= this.skewMs) {
703
703
  const refreshed = await this.refresh(tokens.refreshToken);
@@ -879,7 +879,7 @@ async function fetchWellKnown(baseUrl, path, opts) {
879
879
  }
880
880
  }
881
881
  function httpError2(status, text, path) {
882
- return new (0, _chunk7O5ZGZQIcjs.STXAPIException)(`HTTP ${status} from ${path}: ${text.slice(0, 500)}`, {
882
+ return new (0, _chunkWGIYEJBIcjs.STXAPIException)(`HTTP ${status} from ${path}: ${text.slice(0, 500)}`, {
883
883
  statusCode: status,
884
884
  body: text,
885
885
  path
@@ -963,5 +963,5 @@ var MemoryPendingAuthorizationStore = (_class7 = class {constructor() { _class7.
963
963
 
964
964
 
965
965
 
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 = _chunk7O5ZGZQIcjs.STXAuthenticationException; exports.STXForbiddenException = _chunk7O5ZGZQIcjs.STXForbiddenException; exports.STXGrantRevokedException = STXGrantRevokedException; exports.STXInsufficientScopeException = _chunk7O5ZGZQIcjs.STXInsufficientScopeException; exports.STXInvalidTokenException = _chunk7O5ZGZQIcjs.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;
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 = _chunkWGIYEJBIcjs.STXAuthenticationException; exports.STXForbiddenException = _chunkWGIYEJBIcjs.STXForbiddenException; exports.STXGrantRevokedException = STXGrantRevokedException; exports.STXInsufficientScopeException = _chunkWGIYEJBIcjs.STXInsufficientScopeException; exports.STXInvalidTokenException = _chunkWGIYEJBIcjs.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
967
  //# sourceMappingURL=oauth.cjs.map
package/dist/oauth.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { a9 as STXAuthenticationException, g as AuthProvider, h as AuthRequest, aC as WebSocketAuthContext, aj as STXOptions, a7 as STX } from './client-wriBXPDx.cjs';
2
- export { ae as STXForbiddenException, ag as STXInsufficientScopeException, ah as STXInvalidTokenException } from './client-wriBXPDx.cjs';
1
+ import { a9 as STXAuthenticationException, g as AuthProvider, h as AuthRequest, aC as WebSocketAuthContext, aj as STXOptions, a7 as STX } from './client-C0G5lsiP.cjs';
2
+ export { ae as STXForbiddenException, ag as STXInsufficientScopeException, ah as STXInvalidTokenException } from './client-C0G5lsiP.cjs';
3
3
  import 'node:crypto';
4
4
 
5
5
  interface OAuthEndpoints$1 {
package/dist/oauth.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a9 as STXAuthenticationException, g as AuthProvider, h as AuthRequest, aC as WebSocketAuthContext, aj as STXOptions, a7 as STX } from './client-wriBXPDx.js';
2
- export { ae as STXForbiddenException, ag as STXInsufficientScopeException, ah as STXInvalidTokenException } from './client-wriBXPDx.js';
1
+ import { a9 as STXAuthenticationException, g as AuthProvider, h as AuthRequest, aC as WebSocketAuthContext, aj as STXOptions, a7 as STX } from './client-C0G5lsiP.js';
2
+ export { ae as STXForbiddenException, ag as STXInsufficientScopeException, ah as STXInvalidTokenException } from './client-C0G5lsiP.js';
3
3
  import 'node:crypto';
4
4
 
5
5
  interface OAuthEndpoints$1 {
package/dist/oauth.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  STXInsufficientScopeException,
8
8
  STXInvalidTokenException,
9
9
  baseUrlFor
10
- } from "./chunk-P7ZEHWKM.js";
10
+ } from "./chunk-X7B7WXJ3.js";
11
11
 
12
12
  // src/oauth/endpoints.ts
13
13
  var DEFAULT_ENDPOINTS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stxapp/stx-typescript",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "The TypeScript SDK for the STX exchange: markets, trading, your account and live WebSocket channels, with API-key signing and typed responses.",
5
5
  "type": "module",
6
6
  "license": "MIT",