ault-sdk-ts 0.0.2-alpha.21 → 0.0.2-alpha.22

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.js CHANGED
@@ -10614,6 +10614,7 @@ async function dexFetch(url, init) {
10614
10614
  // src/rest/dex.generated.ts
10615
10615
  var dex_generated_exports = {};
10616
10616
  __export(dex_generated_exports, {
10617
+ GetStatsWindow: () => GetStatsWindow,
10617
10618
  GetUDFHistoryResolution: () => GetUDFHistoryResolution,
10618
10619
  HealthResponseDatabase: () => HealthResponseDatabase,
10619
10620
  HealthResponseStatus: () => HealthResponseStatus,
@@ -10626,6 +10627,7 @@ __export(dex_generated_exports, {
10626
10627
  OrderResponseStatus: () => OrderResponseStatus,
10627
10628
  OrderResponseType: () => OrderResponseType,
10628
10629
  ReadyResponseStatus: () => ReadyResponseStatus,
10630
+ StatsResponseWindow: () => StatsResponseWindow,
10629
10631
  TradeResponseSide: () => TradeResponseSide,
10630
10632
  TradeResponseTakerOrMaker: () => TradeResponseTakerOrMaker,
10631
10633
  TradeResponseType: () => TradeResponseType,
@@ -10645,6 +10647,7 @@ __export(dex_generated_exports, {
10645
10647
  getGetOrderbookUrl: () => getGetOrderbookUrl,
10646
10648
  getGetReadyUrl: () => getGetReadyUrl,
10647
10649
  getGetSDKManifestUrl: () => getGetSDKManifestUrl,
10650
+ getGetStatsUrl: () => getGetStatsUrl,
10648
10651
  getGetStatusUrl: () => getGetStatusUrl,
10649
10652
  getGetTickerUrl: () => getGetTickerUrl,
10650
10653
  getGetTradingFeesUrl: () => getGetTradingFeesUrl,
@@ -10669,6 +10672,7 @@ __export(dex_generated_exports, {
10669
10672
  getReady: () => getReady,
10670
10673
  getSDKManifest: () => getSDKManifest,
10671
10674
  getSearchUDFSymbolsUrl: () => getSearchUDFSymbolsUrl,
10675
+ getStats: () => getStats,
10672
10676
  getStatus: () => getStatus,
10673
10677
  getTicker: () => getTicker,
10674
10678
  getTradingFees: () => getTradingFees,
@@ -10718,6 +10722,9 @@ var LiveResponseStatus = {
10718
10722
  var MarketResponseType = {
10719
10723
  spot: "spot"
10720
10724
  };
10725
+ var StatsResponseWindow = {
10726
+ "24h": "24h"
10727
+ };
10721
10728
  var TradeResponseType = {
10722
10729
  limit: "limit",
10723
10730
  market: "market"
@@ -10761,6 +10768,9 @@ var UDFQuoteDataS = {
10761
10768
  ok: "ok",
10762
10769
  error: "error"
10763
10770
  };
10771
+ var GetStatsWindow = {
10772
+ "24h": "24h"
10773
+ };
10764
10774
  var ListOrdersStatus = {
10765
10775
  open: "open",
10766
10776
  closed: "closed",
@@ -10898,6 +10908,22 @@ var getTradingFees = async (options) => {
10898
10908
  method: "GET"
10899
10909
  });
10900
10910
  };
10911
+ var getGetStatsUrl = (params) => {
10912
+ const normalizedParams = new URLSearchParams();
10913
+ Object.entries(params || {}).forEach(([key, value]) => {
10914
+ if (value !== void 0) {
10915
+ normalizedParams.append(key, value === null ? "null" : value.toString());
10916
+ }
10917
+ });
10918
+ const stringifiedParams = normalizedParams.toString();
10919
+ return stringifiedParams.length > 0 ? `/api/v1/stats?${stringifiedParams}` : `/api/v1/stats`;
10920
+ };
10921
+ var getStats = async (params, options) => {
10922
+ return dexFetch(getGetStatsUrl(params), {
10923
+ ...options,
10924
+ method: "GET"
10925
+ });
10926
+ };
10901
10927
  var getListOrdersUrl = (params) => {
10902
10928
  const normalizedParams = new URLSearchParams();
10903
10929
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -11120,6 +11146,7 @@ function createDexApi(context) {
11120
11146
  getOrder: bind(context, getOrder),
11121
11147
  listMyTrades: bind(context, listMyTrades),
11122
11148
  getBalance: bind(context, getBalance),
11149
+ getStats: bind(context, getStats),
11123
11150
  getUDFConfig: bind(context, getUDFConfig),
11124
11151
  getUDFTime: bind(context, getUDFTime),
11125
11152
  getUDFSymbol: bind(context, getUDFSymbol),
@@ -23989,6 +24016,57 @@ var GetTradingFeesResponse = zod.record(
23989
24016
  info: zod.looseObject({})
23990
24017
  })
23991
24018
  );
24019
+ var GetStatsQueryParams = zod.object({
24020
+ window: zod.enum(["24h"]).optional().describe("Rolling window. Only `24h` is supported; defaults to `24h`.")
24021
+ });
24022
+ var getStatsResponseTotalsQuoteVolumeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24023
+ var getStatsResponseTotalsEstimatedFeeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24024
+ var getStatsResponseTotalsAverageSlippageBpsRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24025
+ var getStatsResponseTotalsDepositUsdcVolume24hRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24026
+ var getStatsResponseTotalsBuilderCodesFee24hRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24027
+ var getStatsResponseMarketsItemQuoteVolumeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24028
+ var getStatsResponseMarketsItemBaseVolumeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24029
+ var getStatsResponseMarketsItemEstimatedFeeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24030
+ var getStatsResponseMarketsItemTakerFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
24031
+ var GetStatsResponse = zod.object({
24032
+ window: zod.enum(["24h"]),
24033
+ totals: zod.object({
24034
+ quoteVolume: zod.string().regex(getStatsResponseTotalsQuoteVolumeRegExp).nullable().describe(
24035
+ "Total quote volume over the window as a canonical decimal string.\nNull when the markets that had volume span more than one quote\nasset, since summing notionals in different quotes is meaningless \u2014\n`quoteVolume`, `estimatedFee`, and `quoteAsset` are null together in\nthat case.\n"
24036
+ ),
24037
+ quoteAsset: zod.string().nullable().describe(
24038
+ 'The shared quote asset ticker of the markets that had volume in the\nwindow. Null in two cases: when those markets span more than one\nquote (then `quoteVolume` and `estimatedFee` are also null), or when\nno market had volume in the window (an idle window \u2014 then\n`quoteVolume` and `estimatedFee` are "0" rather than null, since a\nzero total is well-defined regardless of quote). To distinguish the\ntwo null causes, read `quoteVolume`: null means multi-quote, "0"\nmeans idle.\n'
24039
+ ),
24040
+ estimatedFee: zod.string().regex(getStatsResponseTotalsEstimatedFeeRegExp).nullable().describe(
24041
+ "Estimated total fees (`\u03A3 quoteVolume \xD7 takerFeeRate`) as a canonical\ndecimal string. An estimate from the fee schedule, not booked\nrevenue. Null when the markets that had volume span more than one\nquote (see `quoteVolume`).\n"
24042
+ ),
24043
+ tradeCount: zod.number().describe("Number of fills (maker legs) in the window."),
24044
+ traderCount: zod.number().describe("Distinct trading addresses in the window."),
24045
+ activeMarkets: zod.number().describe("Number of markets with at least one fill in the window."),
24046
+ dailyActiveUsers: zod.number().nullable().describe(
24047
+ "Distinct trading addresses in the window (active-traders\napproximation). Currently an exact alias of `traderCount`; carried\nas a separate nullable field so a future precise DAU source can\ndiverge without an API change. Never null today.\n"
24048
+ ),
24049
+ averageSlippageBps: zod.string().regex(getStatsResponseTotalsAverageSlippageBpsRegExp).nullable().describe(
24050
+ "Volume-weighted taker slippage (fill vs book-mid) in basis points as\na canonical decimal string. Null when the window has no taker fill\nwith a snapshot to benchmark against, or when benchmarked fills span\nmore than one quote asset (the weights are quote-denominated, so a\nsingle figure across quotes would mix notionals).\n"
24051
+ ),
24052
+ depositUsdcVolume24h: zod.string().regex(getStatsResponseTotalsDepositUsdcVolume24hRegExp).nullable().describe("Reserved. Currently always null."),
24053
+ builderCodesFee24h: zod.string().regex(getStatsResponseTotalsBuilderCodesFee24hRegExp).nullable().describe("Reserved. Currently always null.")
24054
+ }).describe("Protocol-wide aggregates for the window."),
24055
+ markets: zod.array(
24056
+ zod.object({
24057
+ symbol: zod.string(),
24058
+ base: zod.string(),
24059
+ quote: zod.string(),
24060
+ quoteVolume: zod.string().regex(getStatsResponseMarketsItemQuoteVolumeRegExp),
24061
+ baseVolume: zod.string().regex(getStatsResponseMarketsItemBaseVolumeRegExp),
24062
+ estimatedFee: zod.string().regex(getStatsResponseMarketsItemEstimatedFeeRegExp),
24063
+ tradeCount: zod.number(),
24064
+ takerFeeRate: zod.string().regex(getStatsResponseMarketsItemTakerFeeRateRegExp)
24065
+ }).describe("Per-market aggregates for the window.")
24066
+ )
24067
+ }).describe(
24068
+ "Protocol stats overview for a rolling window. Monetary fields are\ncanonical decimal strings; counts are integers.\n"
24069
+ );
23992
24070
  var listOrdersQueryAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
23993
24071
  var listOrdersQueryAddressTwoRegExp = new RegExp("^0x[a-f0-9]{40}$");
23994
24072
  var listOrdersQueryMarketIdRegExp = new RegExp("^[0-9a-fA-F]+$");
@@ -24045,7 +24123,7 @@ var ListOrdersResponseItem = zod.object({
24045
24123
  currency: zod.string().optional().describe('Quote currency ticker (e.g., "USDT")'),
24046
24124
  rate: zod.string().regex(listOrdersResponseFeeRateRegExp).optional().describe("Fee rate from the market, decimal string.")
24047
24125
  }).optional().describe(
24048
- "Fee for the order. `cost` is `cost * taker_fee_rate` \u2014 applied to\nthe realized cost above, so it is more accurate than the previous\n`filled * price * taker_fee_rate` approximation. The rate is the\nmarket's taker rate; per-trade maker/taker resolution depends on\nthe dbindexer `is_taker` column landing first.\n"
24126
+ "Fee for the order. `cost` is `cost * taker_fee_rate` \u2014 applied to\nthe realized cost above, so it is more accurate than the previous\n`filled * price * taker_fee_rate` approximation. The rate is the\nmarket's taker rate; this stays an estimate because the indexer\nrecords no realized per-trade fee amount to sum.\n"
24049
24127
  ),
24050
24128
  reduceOnly: zod.boolean().optional(),
24051
24129
  postOnly: zod.boolean().optional(),
@@ -24109,7 +24187,7 @@ var GetOrderResponse = zod.object({
24109
24187
  currency: zod.string().optional().describe('Quote currency ticker (e.g., "USDT")'),
24110
24188
  rate: zod.string().regex(getOrderResponseFeeRateRegExp).optional().describe("Fee rate from the market, decimal string.")
24111
24189
  }).optional().describe(
24112
- "Fee for the order. `cost` is `cost * taker_fee_rate` \u2014 applied to\nthe realized cost above, so it is more accurate than the previous\n`filled * price * taker_fee_rate` approximation. The rate is the\nmarket's taker rate; per-trade maker/taker resolution depends on\nthe dbindexer `is_taker` column landing first.\n"
24190
+ "Fee for the order. `cost` is `cost * taker_fee_rate` \u2014 applied to\nthe realized cost above, so it is more accurate than the previous\n`filled * price * taker_fee_rate` approximation. The rate is the\nmarket's taker rate; this stays an estimate because the indexer\nrecords no realized per-trade fee amount to sum.\n"
24113
24191
  ),
24114
24192
  reduceOnly: zod.boolean().optional(),
24115
24193
  postOnly: zod.boolean().optional(),
@@ -24365,7 +24443,7 @@ function createDexWs(url, options) {
24365
24443
  }
24366
24444
 
24367
24445
  // src/index.ts
24368
- var SDK_VERSION = "0.0.2-alpha.21";
24446
+ var SDK_VERSION = "0.0.2-alpha.22";
24369
24447
  export {
24370
24448
  AGENT_DEFAULTS,
24371
24449
  AULT_SIGNER_MARKER,
@@ -24396,6 +24474,8 @@ export {
24396
24474
  GetOrderbookResponse,
24397
24475
  GetReadyResponse,
24398
24476
  GetSDKManifestResponse,
24477
+ GetStatsQueryParams,
24478
+ GetStatsResponse,
24399
24479
  GetStatusResponse,
24400
24480
  GetTickerParams,
24401
24481
  GetTickerResponse,
@@ -24541,6 +24621,15 @@ export {
24541
24621
  getOrderbookQueryLimitDefault,
24542
24622
  getOrderbookQueryLimitMax,
24543
24623
  getOrderbookResponseMarketIdRegExp,
24624
+ getStatsResponseMarketsItemBaseVolumeRegExp,
24625
+ getStatsResponseMarketsItemEstimatedFeeRegExp,
24626
+ getStatsResponseMarketsItemQuoteVolumeRegExp,
24627
+ getStatsResponseMarketsItemTakerFeeRateRegExp,
24628
+ getStatsResponseTotalsAverageSlippageBpsRegExp,
24629
+ getStatsResponseTotalsBuilderCodesFee24hRegExp,
24630
+ getStatsResponseTotalsDepositUsdcVolume24hRegExp,
24631
+ getStatsResponseTotalsEstimatedFeeRegExp,
24632
+ getStatsResponseTotalsQuoteVolumeRegExp,
24544
24633
  getTradingFeesResponseMakerRegExp,
24545
24634
  getTradingFeesResponseTakerRegExp,
24546
24635
  getUDFHistoryQueryCountbackMax,