ault-sdk-ts 0.6.0 → 0.7.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 +209 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +196 -62
- package/dist/index.js.map +1 -1
- package/dist/rest/dex-types.generated.d.ts +73 -34
- package/dist/rest/dex.d.ts +2 -0
- package/dist/rest/dex.generated.d.ts +295 -69
- package/dist/rest/pagination.d.ts +45 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -46,6 +46,7 @@ __export(index_exports, {
|
|
|
46
46
|
GetAllTickersResponse: () => GetAllTickersResponse,
|
|
47
47
|
GetBalanceQueryParams: () => GetBalanceQueryParams,
|
|
48
48
|
GetBalanceResponse: () => GetBalanceResponse,
|
|
49
|
+
GetDBReadyResponse: () => GetDBReadyResponse,
|
|
49
50
|
GetHealthResponse: () => GetHealthResponse,
|
|
50
51
|
GetLiveResponse: () => GetLiveResponse,
|
|
51
52
|
GetOHLCVParams: () => GetOHLCVParams,
|
|
@@ -102,6 +103,7 @@ __export(index_exports, {
|
|
|
102
103
|
MarketType: () => MarketType,
|
|
103
104
|
MissingMsgResponseError: () => MissingMsgResponseError,
|
|
104
105
|
NETWORKS: () => NETWORKS,
|
|
106
|
+
NEXT_CURSOR_HEADER: () => NEXT_CURSOR_HEADER,
|
|
105
107
|
NetworkError: () => NetworkError,
|
|
106
108
|
ORDER_ID_LENGTH: () => ORDER_ID_LENGTH,
|
|
107
109
|
OrderId: () => OrderId,
|
|
@@ -137,6 +139,7 @@ __export(index_exports, {
|
|
|
137
139
|
buildEip712TypedData: () => buildEip712TypedData,
|
|
138
140
|
buildFetchOptions: () => buildFetchOptions,
|
|
139
141
|
bytesToBase64: () => bytesToBase64,
|
|
142
|
+
collectPages: () => collectPages,
|
|
140
143
|
computeEvmFeesPerGas: () => computeEvmFeesPerGas,
|
|
141
144
|
computeFeeFreeGas: () => computeFeeFreeGas,
|
|
142
145
|
computeFeeFreeGasCompound: () => computeFeeFreeGasCompound,
|
|
@@ -232,6 +235,7 @@ __export(index_exports, {
|
|
|
232
235
|
getTradeResponseFeeRateRegExp: () => getTradeResponseFeeRateRegExp,
|
|
233
236
|
getTradeResponseInfoAddressOneRegExp: () => getTradeResponseInfoAddressOneRegExp,
|
|
234
237
|
getTradeResponseInfoBlockHeightRegExp: () => getTradeResponseInfoBlockHeightRegExp,
|
|
238
|
+
getTradeResponseInfoEventIndexMax: () => getTradeResponseInfoEventIndexMax,
|
|
235
239
|
getTradeResponseInfoEventIndexMin: () => getTradeResponseInfoEventIndexMin,
|
|
236
240
|
getTradeResponsePriceRegExp: () => getTradeResponsePriceRegExp,
|
|
237
241
|
getTradingFeesResponseMakerRegExp: () => getTradingFeesResponseMakerRegExp,
|
|
@@ -242,9 +246,13 @@ __export(index_exports, {
|
|
|
242
246
|
isValidAultAddress: () => isValidAultAddress,
|
|
243
247
|
isValidEvmAddress: () => isValidEvmAddress,
|
|
244
248
|
isValidValidatorAddress: () => isValidValidatorAddress,
|
|
249
|
+
listCurrenciesResponseInfoContractDecimalsMax: () => listCurrenciesResponseInfoContractDecimalsMax,
|
|
250
|
+
listCurrenciesResponseInfoContractDecimalsMin: () => listCurrenciesResponseInfoContractDecimalsMin,
|
|
245
251
|
listMarketsResponseInfoEscrowAddressOneRegExp: () => listMarketsResponseInfoEscrowAddressOneRegExp,
|
|
246
252
|
listMarketsResponseMakerRegExp: () => listMarketsResponseMakerRegExp,
|
|
247
253
|
listMarketsResponseTakerRegExp: () => listMarketsResponseTakerRegExp,
|
|
254
|
+
listMyTradesQueryBeforeIndexMax: () => listMyTradesQueryBeforeIndexMax,
|
|
255
|
+
listMyTradesQueryBeforeIndexMin: () => listMyTradesQueryBeforeIndexMin,
|
|
248
256
|
listMyTradesQueryLimitDefault: () => listMyTradesQueryLimitDefault,
|
|
249
257
|
listMyTradesQueryLimitMax: () => listMyTradesQueryLimitMax,
|
|
250
258
|
listMyTradesResponseAmountRegExp: () => listMyTradesResponseAmountRegExp,
|
|
@@ -253,6 +261,7 @@ __export(index_exports, {
|
|
|
253
261
|
listMyTradesResponseFeeRateRegExp: () => listMyTradesResponseFeeRateRegExp,
|
|
254
262
|
listMyTradesResponseInfoAddressOneRegExp: () => listMyTradesResponseInfoAddressOneRegExp,
|
|
255
263
|
listMyTradesResponseInfoBlockHeightRegExp: () => listMyTradesResponseInfoBlockHeightRegExp,
|
|
264
|
+
listMyTradesResponseInfoEventIndexMax: () => listMyTradesResponseInfoEventIndexMax,
|
|
256
265
|
listMyTradesResponseInfoEventIndexMin: () => listMyTradesResponseInfoEventIndexMin,
|
|
257
266
|
listMyTradesResponsePriceRegExp: () => listMyTradesResponsePriceRegExp,
|
|
258
267
|
listOrdersQueryAddressOneRegExp: () => listOrdersQueryAddressOneRegExp,
|
|
@@ -270,6 +279,8 @@ __export(index_exports, {
|
|
|
270
279
|
listOrdersResponseInfoRemainingDepositRegExp: () => listOrdersResponseInfoRemainingDepositRegExp,
|
|
271
280
|
listOrdersResponsePriceRegExp: () => listOrdersResponsePriceRegExp,
|
|
272
281
|
listOrdersResponseRemainingRegExp: () => listOrdersResponseRemainingRegExp,
|
|
282
|
+
listTradesQueryBeforeIndexMax: () => listTradesQueryBeforeIndexMax,
|
|
283
|
+
listTradesQueryBeforeIndexMin: () => listTradesQueryBeforeIndexMin,
|
|
273
284
|
listTradesQueryLimitDefault: () => listTradesQueryLimitDefault,
|
|
274
285
|
listTradesQueryLimitMax: () => listTradesQueryLimitMax,
|
|
275
286
|
listTradesResponseAmountRegExp: () => listTradesResponseAmountRegExp,
|
|
@@ -278,6 +289,7 @@ __export(index_exports, {
|
|
|
278
289
|
listTradesResponseFeeRateRegExp: () => listTradesResponseFeeRateRegExp,
|
|
279
290
|
listTradesResponseInfoAddressOneRegExp: () => listTradesResponseInfoAddressOneRegExp,
|
|
280
291
|
listTradesResponseInfoBlockHeightRegExp: () => listTradesResponseInfoBlockHeightRegExp,
|
|
292
|
+
listTradesResponseInfoEventIndexMax: () => listTradesResponseInfoEventIndexMax,
|
|
281
293
|
listTradesResponseInfoEventIndexMin: () => listTradesResponseInfoEventIndexMin,
|
|
282
294
|
listTradesResponsePriceRegExp: () => listTradesResponsePriceRegExp,
|
|
283
295
|
mergeManifests: () => mergeManifests,
|
|
@@ -285,6 +297,7 @@ __export(index_exports, {
|
|
|
285
297
|
normalizeSignature: () => normalizeSignature,
|
|
286
298
|
normalizeSigner: () => normalizeSigner,
|
|
287
299
|
normalizeTxHash: () => normalizeTxHash,
|
|
300
|
+
paginate: () => paginate,
|
|
288
301
|
paginateAll: () => paginateAll,
|
|
289
302
|
parseEvmChainIdFromCosmosChainId: () => parseEvmChainIdFromCosmosChainId,
|
|
290
303
|
pollTxInclusion: () => pollTxInclusion,
|
|
@@ -11699,9 +11712,10 @@ async function dexFetch(url, init) {
|
|
|
11699
11712
|
// src/rest/dex.generated.ts
|
|
11700
11713
|
var dex_generated_exports = {};
|
|
11701
11714
|
__export(dex_generated_exports, {
|
|
11715
|
+
DBReadyResponseDatabase: () => DBReadyResponseDatabase,
|
|
11716
|
+
DBReadyResponseStatus: () => DBReadyResponseStatus,
|
|
11702
11717
|
GetStatsWindow: () => GetStatsWindow,
|
|
11703
11718
|
GetUDFHistoryResolution: () => GetUDFHistoryResolution,
|
|
11704
|
-
HealthResponseDatabase: () => HealthResponseDatabase,
|
|
11705
11719
|
HealthResponseStatus: () => HealthResponseStatus,
|
|
11706
11720
|
ListOrdersStatus: () => ListOrdersStatus,
|
|
11707
11721
|
LiveResponseStatus: () => LiveResponseStatus,
|
|
@@ -11710,6 +11724,7 @@ __export(dex_generated_exports, {
|
|
|
11710
11724
|
OrderInfoChainType: () => OrderInfoChainType,
|
|
11711
11725
|
OrderResponseSide: () => OrderResponseSide,
|
|
11712
11726
|
OrderResponseStatus: () => OrderResponseStatus,
|
|
11727
|
+
OrderResponseTimeInForce: () => OrderResponseTimeInForce,
|
|
11713
11728
|
OrderResponseType: () => OrderResponseType,
|
|
11714
11729
|
RangeQueryDayParameter: () => RangeQueryDayParameter,
|
|
11715
11730
|
RangeQueryParameter: () => RangeQueryParameter,
|
|
@@ -11724,8 +11739,10 @@ __export(dex_generated_exports, {
|
|
|
11724
11739
|
UDFSymbolInfoDataStatus: () => UDFSymbolInfoDataStatus,
|
|
11725
11740
|
getAllTickers: () => getAllTickers,
|
|
11726
11741
|
getBalance: () => getBalance,
|
|
11742
|
+
getDBReady: () => getDBReady,
|
|
11727
11743
|
getGetAllTickersUrl: () => getGetAllTickersUrl,
|
|
11728
11744
|
getGetBalanceUrl: () => getGetBalanceUrl,
|
|
11745
|
+
getGetDBReadyUrl: () => getGetDBReadyUrl,
|
|
11729
11746
|
getGetHealthUrl: () => getGetHealthUrl,
|
|
11730
11747
|
getGetLiveUrl: () => getGetLiveUrl,
|
|
11731
11748
|
getGetOHLCVUrl: () => getGetOHLCVUrl,
|
|
@@ -11795,16 +11812,18 @@ var OrderInfoChainType = {
|
|
|
11795
11812
|
unknown: "unknown"
|
|
11796
11813
|
};
|
|
11797
11814
|
var HealthResponseStatus = {
|
|
11798
|
-
healthy: "healthy"
|
|
11799
|
-
unhealthy: "unhealthy"
|
|
11815
|
+
healthy: "healthy"
|
|
11800
11816
|
};
|
|
11801
|
-
var
|
|
11817
|
+
var ReadyResponseStatus = {
|
|
11818
|
+
ready: "ready"
|
|
11819
|
+
};
|
|
11820
|
+
var DBReadyResponseStatus = {
|
|
11802
11821
|
ok: "ok",
|
|
11803
|
-
|
|
11822
|
+
unavailable: "unavailable"
|
|
11804
11823
|
};
|
|
11805
|
-
var
|
|
11806
|
-
|
|
11807
|
-
|
|
11824
|
+
var DBReadyResponseDatabase = {
|
|
11825
|
+
ok: "ok",
|
|
11826
|
+
unreachable: "unreachable"
|
|
11808
11827
|
};
|
|
11809
11828
|
var LiveResponseStatus = {
|
|
11810
11829
|
alive: "alive"
|
|
@@ -11813,7 +11832,10 @@ var MarketResponseType = {
|
|
|
11813
11832
|
spot: "spot"
|
|
11814
11833
|
};
|
|
11815
11834
|
var StatsResponseWindow = {
|
|
11816
|
-
"24h": "24h"
|
|
11835
|
+
"24h": "24h",
|
|
11836
|
+
"7d": "7d",
|
|
11837
|
+
"30d": "30d",
|
|
11838
|
+
all: "all"
|
|
11817
11839
|
};
|
|
11818
11840
|
var TradeResponseType = {
|
|
11819
11841
|
limit: "limit",
|
|
@@ -11841,6 +11863,9 @@ var OrderResponseType = {
|
|
|
11841
11863
|
twap: "twap",
|
|
11842
11864
|
unknown: "unknown"
|
|
11843
11865
|
};
|
|
11866
|
+
var OrderResponseTimeInForce = {
|
|
11867
|
+
ioc: "ioc"
|
|
11868
|
+
};
|
|
11844
11869
|
var OrderResponseSide = {
|
|
11845
11870
|
buy: "buy",
|
|
11846
11871
|
sell: "sell"
|
|
@@ -11877,7 +11902,10 @@ var RangeQueryDayParameter = {
|
|
|
11877
11902
|
allTime: "allTime"
|
|
11878
11903
|
};
|
|
11879
11904
|
var GetStatsWindow = {
|
|
11880
|
-
"24h": "24h"
|
|
11905
|
+
"24h": "24h",
|
|
11906
|
+
"7d": "7d",
|
|
11907
|
+
"30d": "30d",
|
|
11908
|
+
all: "all"
|
|
11881
11909
|
};
|
|
11882
11910
|
var ListOrdersStatus = {
|
|
11883
11911
|
open: "open",
|
|
@@ -11921,6 +11949,15 @@ var getLive = async (options) => {
|
|
|
11921
11949
|
method: "GET"
|
|
11922
11950
|
});
|
|
11923
11951
|
};
|
|
11952
|
+
var getGetDBReadyUrl = () => {
|
|
11953
|
+
return `/db-ready`;
|
|
11954
|
+
};
|
|
11955
|
+
var getDBReady = async (options) => {
|
|
11956
|
+
return dexFetch(getGetDBReadyUrl(), {
|
|
11957
|
+
...options,
|
|
11958
|
+
method: "GET"
|
|
11959
|
+
});
|
|
11960
|
+
};
|
|
11924
11961
|
var getGetStatusUrl = () => {
|
|
11925
11962
|
return `/api/v1/status`;
|
|
11926
11963
|
};
|
|
@@ -12305,7 +12342,9 @@ function createDexApi(context) {
|
|
|
12305
12342
|
getUDFHistory: bind(context, getUDFHistory),
|
|
12306
12343
|
getUDFQuotes: bind(context, getUDFQuotes),
|
|
12307
12344
|
getUDFMarks: bind(context, getUDFMarks),
|
|
12308
|
-
getUDFTimescaleMarks: bind(context, getUDFTimescaleMarks)
|
|
12345
|
+
getUDFTimescaleMarks: bind(context, getUDFTimescaleMarks),
|
|
12346
|
+
getOpenAPISpec: bind(context, getOpenAPISpec),
|
|
12347
|
+
getDBReady: bind(context, getDBReady)
|
|
12309
12348
|
};
|
|
12310
12349
|
}
|
|
12311
12350
|
|
|
@@ -25367,6 +25406,40 @@ function createParallelQueryApi(lowLevel) {
|
|
|
25367
25406
|
|
|
25368
25407
|
// src/high-level/cloid-lookup.ts
|
|
25369
25408
|
var import_encoding3 = require("@cosmjs/encoding");
|
|
25409
|
+
|
|
25410
|
+
// src/rest/pagination.ts
|
|
25411
|
+
var NEXT_CURSOR_HEADER = "X-Next-Cursor";
|
|
25412
|
+
async function* paginate(fetchPage, params = {}) {
|
|
25413
|
+
let cursor = params.cursor;
|
|
25414
|
+
const seen = new Set(cursor ? [cursor] : []);
|
|
25415
|
+
for (; ; ) {
|
|
25416
|
+
const res = await fetchPage(cursor ? { cursor } : {});
|
|
25417
|
+
if (res.status !== 200 || !Array.isArray(res.data)) {
|
|
25418
|
+
throw new ApiError(`paginated endpoint returned unexpected status ${res.status}`, res.status);
|
|
25419
|
+
}
|
|
25420
|
+
const next = res.headers.get(NEXT_CURSOR_HEADER);
|
|
25421
|
+
if (next && seen.has(next)) {
|
|
25422
|
+
throw new ApiError("pagination cursor repeated; aborting to prevent an infinite loop");
|
|
25423
|
+
}
|
|
25424
|
+
yield { rows: res.data, nextCursor: next };
|
|
25425
|
+
if (!next) return;
|
|
25426
|
+
seen.add(next);
|
|
25427
|
+
cursor = next;
|
|
25428
|
+
}
|
|
25429
|
+
}
|
|
25430
|
+
async function collectPages(fetchPage, max, params = {}) {
|
|
25431
|
+
if (!Number.isInteger(max) || max < 1) {
|
|
25432
|
+
throw new ApiError(`collectPages max must be a positive integer, got ${max}`);
|
|
25433
|
+
}
|
|
25434
|
+
const rows = [];
|
|
25435
|
+
for await (const page of paginate(fetchPage, params)) {
|
|
25436
|
+
rows.push(...page.rows);
|
|
25437
|
+
if (rows.length >= max) return rows.slice(0, max);
|
|
25438
|
+
}
|
|
25439
|
+
return rows;
|
|
25440
|
+
}
|
|
25441
|
+
|
|
25442
|
+
// src/high-level/cloid-lookup.ts
|
|
25370
25443
|
function createCloidLookupApi(lowLevel) {
|
|
25371
25444
|
async function findOrderByCloid(orderer, cloid) {
|
|
25372
25445
|
const addr = normalizeAddress(orderer);
|
|
@@ -25380,20 +25453,30 @@ function createCloidLookupApi(lowLevel) {
|
|
|
25380
25453
|
return { source: "chain-twap", order: chain.twap };
|
|
25381
25454
|
}
|
|
25382
25455
|
const wantHex = (0, import_encoding3.toHex)(bytes);
|
|
25383
|
-
const LIMIT =
|
|
25384
|
-
const
|
|
25385
|
-
|
|
25386
|
-
|
|
25387
|
-
|
|
25388
|
-
|
|
25389
|
-
|
|
25390
|
-
|
|
25456
|
+
const LIMIT = 500;
|
|
25457
|
+
const MAX_PAGES = 10;
|
|
25458
|
+
const orders = [];
|
|
25459
|
+
let exhausted = false;
|
|
25460
|
+
let pages = 0;
|
|
25461
|
+
for await (const page of paginate(
|
|
25462
|
+
(p) => lowLevel.rest.dex.listOrders({ address: addr, cloid: wantHex, limit: LIMIT, ...p })
|
|
25463
|
+
)) {
|
|
25464
|
+
orders.push(...page.rows.filter((o) => o.clientOrderId?.toLowerCase() === wantHex));
|
|
25465
|
+
pages += 1;
|
|
25466
|
+
if (!page.nextCursor) {
|
|
25467
|
+
exhausted = true;
|
|
25468
|
+
break;
|
|
25469
|
+
}
|
|
25470
|
+
if (pages >= MAX_PAGES) break;
|
|
25391
25471
|
}
|
|
25392
|
-
if (
|
|
25472
|
+
if (!exhausted) {
|
|
25393
25473
|
throw new Error(
|
|
25394
|
-
`cloid ${wantHex} has too many historical matches to disambiguate (
|
|
25474
|
+
`cloid ${wantHex} has too many historical matches to disambiguate (> ${MAX_PAGES * LIMIT} rows); dex-api needs a canonical (orderer, cloid) latest lookup`
|
|
25395
25475
|
);
|
|
25396
25476
|
}
|
|
25477
|
+
if (orders.length === 0) {
|
|
25478
|
+
return { source: "none", order: null };
|
|
25479
|
+
}
|
|
25397
25480
|
const order = orders.reduce((latest, next) => {
|
|
25398
25481
|
if (next.timestamp !== latest.timestamp) {
|
|
25399
25482
|
return next.timestamp > latest.timestamp ? next : latest;
|
|
@@ -27763,15 +27846,18 @@ var PageResponseSchema = import_zod3.z.object({
|
|
|
27763
27846
|
// src/rest/dex-types.generated.ts
|
|
27764
27847
|
var zod = __toESM(require("zod"), 1);
|
|
27765
27848
|
var GetHealthResponse = zod.object({
|
|
27766
|
-
status: zod.enum(["healthy"
|
|
27767
|
-
database: zod.enum(["ok", "unreachable"])
|
|
27849
|
+
status: zod.enum(["healthy"])
|
|
27768
27850
|
});
|
|
27769
27851
|
var GetReadyResponse = zod.object({
|
|
27770
|
-
status: zod.enum(["ready"
|
|
27852
|
+
status: zod.enum(["ready"])
|
|
27771
27853
|
});
|
|
27772
27854
|
var GetLiveResponse = zod.object({
|
|
27773
27855
|
status: zod.enum(["alive"])
|
|
27774
27856
|
});
|
|
27857
|
+
var GetDBReadyResponse = zod.object({
|
|
27858
|
+
status: zod.enum(["ok", "unavailable"]),
|
|
27859
|
+
database: zod.enum(["ok", "unreachable"])
|
|
27860
|
+
});
|
|
27775
27861
|
var GetStatusResponse = zod.object({
|
|
27776
27862
|
last_indexed_height: zod.number(),
|
|
27777
27863
|
last_indexed_at: zod.iso.datetime({})
|
|
@@ -27863,6 +27949,8 @@ var ListMarketsResponseItem = zod.object({
|
|
|
27863
27949
|
)
|
|
27864
27950
|
});
|
|
27865
27951
|
var ListMarketsResponse = zod.array(ListMarketsResponseItem);
|
|
27952
|
+
var listCurrenciesResponseInfoContractDecimalsMin = 0;
|
|
27953
|
+
var listCurrenciesResponseInfoContractDecimalsMax = 255;
|
|
27866
27954
|
var ListCurrenciesResponse = zod.record(
|
|
27867
27955
|
zod.string(),
|
|
27868
27956
|
zod.object({
|
|
@@ -27873,7 +27961,9 @@ var ListCurrenciesResponse = zod.record(
|
|
|
27873
27961
|
deposit: zod.boolean().nullish(),
|
|
27874
27962
|
withdraw: zod.boolean().nullish(),
|
|
27875
27963
|
fee: zod.number().nullish(),
|
|
27876
|
-
precision: zod.number()
|
|
27964
|
+
precision: zod.number().describe(
|
|
27965
|
+
"The DEX trading precision \u2014 always 18: every amount on every\nendpoint (balances, orders, trades, portfolio) is normalized to\n18-decimal units regardless of the token contract's own\ndecimals. The raw contract decimals are available in\n`info.contractDecimals`.\n"
|
|
27966
|
+
),
|
|
27877
27967
|
limits: zod.object({
|
|
27878
27968
|
amount: zod.object({
|
|
27879
27969
|
min: zod.number().nullish(),
|
|
@@ -27885,7 +27975,11 @@ var ListCurrenciesResponse = zod.record(
|
|
|
27885
27975
|
}).optional()
|
|
27886
27976
|
}),
|
|
27887
27977
|
networks: zod.looseObject({}).optional(),
|
|
27888
|
-
info: zod.
|
|
27978
|
+
info: zod.object({
|
|
27979
|
+
contractDecimals: zod.number().min(listCurrenciesResponseInfoContractDecimalsMin).max(listCurrenciesResponseInfoContractDecimalsMax).describe(
|
|
27980
|
+
"The token contract's own decimals (raw ERC20 decimals). Amounts\non the API are NOT in these units \u2014 see `precision`.\n"
|
|
27981
|
+
)
|
|
27982
|
+
})
|
|
27889
27983
|
})
|
|
27890
27984
|
);
|
|
27891
27985
|
var GetTickerParams = zod.object({
|
|
@@ -27979,11 +28073,20 @@ var GetOrderbookResponse = zod.object({
|
|
|
27979
28073
|
var ListTradesParams = zod.object({
|
|
27980
28074
|
symbol: zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
27981
28075
|
});
|
|
27982
|
-
var listTradesQueryLimitDefault =
|
|
28076
|
+
var listTradesQueryLimitDefault = 100;
|
|
27983
28077
|
var listTradesQueryLimitMax = 500;
|
|
28078
|
+
var listTradesQueryBeforeIndexMin = 0;
|
|
28079
|
+
var listTradesQueryBeforeIndexMax = 4294967295;
|
|
27984
28080
|
var ListTradesQueryParams = zod.object({
|
|
27985
28081
|
limit: zod.number().min(1).max(listTradesQueryLimitMax).default(listTradesQueryLimitDefault),
|
|
27986
|
-
since: zod.number().optional().describe("Unix timestamp in milliseconds")
|
|
28082
|
+
since: zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
28083
|
+
cursor: zod.string().optional().describe(
|
|
28084
|
+
'Opaque pagination cursor. Take it verbatim from the previous page\'s\n`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and\nrepeat every other query parameter; the cursor is bound to that\nfilter set and a different one is rejected with 400. `limit` may\nchange between pages. No `X-Next-Cursor` on a response means the\nfeed is exhausted. Clients must not build or parse cursors.\n'
|
|
28085
|
+
),
|
|
28086
|
+
before_height: zod.number().min(1).optional().describe(
|
|
28087
|
+
"Deprecated in favour of `cursor`; still honoured, and ignored when\n`cursor` is also present.\n\nComposite pagination cursor, upper half. Returns only trades\nstrictly older (in feed order) than the row identified by\n(`before_height`, `before_index`) \u2014 take both values from the\nlast row's `info.block_height` / `info.event_index`. Must be\npassed together with `before_index`. Unlike `since`, the cursor\ncannot skip or repeat trades when many share one timestamp.\n"
|
|
28088
|
+
),
|
|
28089
|
+
before_index: zod.number().min(listTradesQueryBeforeIndexMin).max(listTradesQueryBeforeIndexMax).optional().describe("Composite pagination cursor, lower half. See `before_height`.")
|
|
27987
28090
|
});
|
|
27988
28091
|
var listTradesResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
27989
28092
|
var listTradesResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -27993,6 +28096,7 @@ var listTradesResponseFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
|
27993
28096
|
var listTradesResponseInfoAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
27994
28097
|
var listTradesResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
27995
28098
|
var listTradesResponseInfoEventIndexMin = 0;
|
|
28099
|
+
var listTradesResponseInfoEventIndexMax = 4294967295;
|
|
27996
28100
|
var ListTradesResponseItem = zod.object({
|
|
27997
28101
|
id: zod.string(),
|
|
27998
28102
|
order: zod.string().nullish(),
|
|
@@ -28002,10 +28106,11 @@ var ListTradesResponseItem = zod.object({
|
|
|
28002
28106
|
type: zod.union([
|
|
28003
28107
|
zod.literal("limit"),
|
|
28004
28108
|
zod.literal("market"),
|
|
28109
|
+
zod.literal("twap"),
|
|
28005
28110
|
zod.literal("unknown"),
|
|
28006
28111
|
zod.literal(null)
|
|
28007
28112
|
]).nullish().describe(
|
|
28008
|
-
"Order type resolved via JOIN to orders table. Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize."
|
|
28113
|
+
"Order type resolved via JOIN to orders table. `twap` marks a TWAP slice execution (chain code 2). Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize."
|
|
28009
28114
|
),
|
|
28010
28115
|
cloid: zod.string().nullish().describe(
|
|
28011
28116
|
"Client order id (hex, 8 bytes) resolved via JOIN to orders table. Null when the order carried none, the row predates cloid indexing, or on the public trades feed (cloids are private to the orderer)."
|
|
@@ -28039,8 +28144,8 @@ var ListTradesResponseItem = zod.object({
|
|
|
28039
28144
|
"Atto-precision amount the orderer received for this fill,\nsuffixed with the chain denom. Empty string when the chain did\nnot record this side.\n"
|
|
28040
28145
|
),
|
|
28041
28146
|
block_height: zod.string().regex(listTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
28042
|
-
event_index: zod.number().min(listTradesResponseInfoEventIndexMin).describe(
|
|
28043
|
-
"The trade's event position within its block.
|
|
28147
|
+
event_index: zod.number().min(listTradesResponseInfoEventIndexMin).max(listTradesResponseInfoEventIndexMax).describe(
|
|
28148
|
+
"The trade's event position within its block. With `block_height`\nit forms the row's composite pagination cursor: pass the last\nrow's pair as `before_height`/`before_index` to fetch the next\n(older) page.\n"
|
|
28044
28149
|
)
|
|
28045
28150
|
}).describe(
|
|
28046
28151
|
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
@@ -28066,6 +28171,7 @@ var getTradeResponseFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
|
28066
28171
|
var getTradeResponseInfoAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
28067
28172
|
var getTradeResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
28068
28173
|
var getTradeResponseInfoEventIndexMin = 0;
|
|
28174
|
+
var getTradeResponseInfoEventIndexMax = 4294967295;
|
|
28069
28175
|
var GetTradeResponse = zod.object({
|
|
28070
28176
|
id: zod.string(),
|
|
28071
28177
|
order: zod.string().nullish(),
|
|
@@ -28075,10 +28181,11 @@ var GetTradeResponse = zod.object({
|
|
|
28075
28181
|
type: zod.union([
|
|
28076
28182
|
zod.literal("limit"),
|
|
28077
28183
|
zod.literal("market"),
|
|
28184
|
+
zod.literal("twap"),
|
|
28078
28185
|
zod.literal("unknown"),
|
|
28079
28186
|
zod.literal(null)
|
|
28080
28187
|
]).nullish().describe(
|
|
28081
|
-
"Order type resolved via JOIN to orders table. Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize."
|
|
28188
|
+
"Order type resolved via JOIN to orders table. `twap` marks a TWAP slice execution (chain code 2). Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize."
|
|
28082
28189
|
),
|
|
28083
28190
|
cloid: zod.string().nullish().describe(
|
|
28084
28191
|
"Client order id (hex, 8 bytes) resolved via JOIN to orders table. Null when the order carried none, the row predates cloid indexing, or on the public trades feed (cloids are private to the orderer)."
|
|
@@ -28112,8 +28219,8 @@ var GetTradeResponse = zod.object({
|
|
|
28112
28219
|
"Atto-precision amount the orderer received for this fill,\nsuffixed with the chain denom. Empty string when the chain did\nnot record this side.\n"
|
|
28113
28220
|
),
|
|
28114
28221
|
block_height: zod.string().regex(getTradeResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
28115
|
-
event_index: zod.number().min(getTradeResponseInfoEventIndexMin).describe(
|
|
28116
|
-
"The trade's event position within its block.
|
|
28222
|
+
event_index: zod.number().min(getTradeResponseInfoEventIndexMin).max(getTradeResponseInfoEventIndexMax).describe(
|
|
28223
|
+
"The trade's event position within its block. With `block_height`\nit forms the row's composite pagination cursor: pass the last\nrow's pair as `before_height`/`before_index` to fetch the next\n(older) page.\n"
|
|
28117
28224
|
)
|
|
28118
28225
|
}).describe(
|
|
28119
28226
|
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
@@ -28135,7 +28242,7 @@ var GetTradingFeesResponse = zod.record(
|
|
|
28135
28242
|
})
|
|
28136
28243
|
);
|
|
28137
28244
|
var GetStatsQueryParams = zod.object({
|
|
28138
|
-
window: zod.enum(["24h"]).optional().describe("
|
|
28245
|
+
window: zod.enum(["24h", "7d", "30d", "all"]).optional().describe("Precomputed reporting window. Defaults to `24h`.")
|
|
28139
28246
|
});
|
|
28140
28247
|
var getStatsResponseTotalsQuoteVolumeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28141
28248
|
var getStatsResponseTotalsEstimatedFeeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -28147,7 +28254,7 @@ var getStatsResponseMarketsItemBaseVolumeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$
|
|
|
28147
28254
|
var getStatsResponseMarketsItemEstimatedFeeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28148
28255
|
var getStatsResponseMarketsItemTakerFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28149
28256
|
var GetStatsResponse = zod.object({
|
|
28150
|
-
window: zod.enum(["24h"]),
|
|
28257
|
+
window: zod.enum(["24h", "7d", "30d", "all"]),
|
|
28151
28258
|
totals: zod.object({
|
|
28152
28259
|
quoteVolume: zod.string().regex(getStatsResponseTotalsQuoteVolumeRegExp).nullable().describe(
|
|
28153
28260
|
"Total quote volume over the window as a canonical decimal string.\nNull when contributing markets span more than one quote (then\n`estimatedFee` and `quoteAsset` are null too).\n"
|
|
@@ -28162,12 +28269,12 @@ var GetStatsResponse = zod.object({
|
|
|
28162
28269
|
traderCount: zod.number().describe("Distinct trading addresses in the window."),
|
|
28163
28270
|
activeMarkets: zod.number().describe("Number of markets with at least one fill in the window."),
|
|
28164
28271
|
dailyActiveUsers: zod.number().nullable().describe(
|
|
28165
|
-
"Distinct trading addresses
|
|
28272
|
+
"Distinct trading addresses over 24 hours. An alias of\n`traderCount` for the `24h` response and null for longer windows;\nseparate so a precise DAU source can diverge later.\n"
|
|
28166
28273
|
),
|
|
28167
28274
|
averageSlippageBps: zod.string().regex(getStatsResponseTotalsAverageSlippageBpsRegExp).nullable().describe(
|
|
28168
28275
|
"Volume-weighted taker slippage (fill vs book-mid) in bps as a\ndecimal string. Null with no benchmarkable taker fill or when\nfills span more than one quote.\n"
|
|
28169
28276
|
),
|
|
28170
|
-
depositUsdcVolume24h: zod.string().regex(getStatsResponseTotalsDepositUsdcVolume24hRegExp).nullable().describe("
|
|
28277
|
+
depositUsdcVolume24h: zod.string().regex(getStatsResponseTotalsDepositUsdcVolume24hRegExp).nullable().describe("24h USDC deposit volume when available; null for longer windows."),
|
|
28171
28278
|
builderCodesFee24h: zod.string().regex(getStatsResponseTotalsBuilderCodesFee24hRegExp).nullable().describe("Reserved. Currently always null.")
|
|
28172
28279
|
}).describe("Protocol-wide aggregates for the window."),
|
|
28173
28280
|
markets: zod.array(
|
|
@@ -28189,8 +28296,8 @@ var listOrdersQueryAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
|
28189
28296
|
var listOrdersQueryAddressTwoRegExp = new RegExp("^0x[a-f0-9]{40}$");
|
|
28190
28297
|
var listOrdersQueryMarketIdRegExp = new RegExp("^[0-9a-fA-F]+$");
|
|
28191
28298
|
var listOrdersQueryCloidRegExp = new RegExp("^([0-9a-fA-F]{16})?$");
|
|
28192
|
-
var listOrdersQueryLimitDefault =
|
|
28193
|
-
var listOrdersQueryLimitMax =
|
|
28299
|
+
var listOrdersQueryLimitDefault = 100;
|
|
28300
|
+
var listOrdersQueryLimitMax = 500;
|
|
28194
28301
|
var ListOrdersQueryParams = zod.object({
|
|
28195
28302
|
address: zod.union([
|
|
28196
28303
|
zod.string().regex(listOrdersQueryAddressOneRegExp).describe(
|
|
@@ -28209,7 +28316,10 @@ var ListOrdersQueryParams = zod.object({
|
|
|
28209
28316
|
"Client order id (cloid) to filter by, as a hex string. A\nnon-empty value must decode to exactly 8 bytes (16 hex chars);\nanything else returns 400. An absent or empty (`cloid=`) value\napplies no cloid filter, matching how `market_id` behaves.\nCombined with `address`, a set cloid returns the orders carrying\nit. cloid uniqueness is only enforced for currently-resting\norders, so closed orders that reused the cloid may also match and\nmore than one order can be returned.\n"
|
|
28210
28317
|
),
|
|
28211
28318
|
since: zod.number().optional().describe("Return orders created after this Unix timestamp (milliseconds)"),
|
|
28212
|
-
limit: zod.number().min(1).max(listOrdersQueryLimitMax).default(listOrdersQueryLimitDefault)
|
|
28319
|
+
limit: zod.number().min(1).max(listOrdersQueryLimitMax).default(listOrdersQueryLimitDefault),
|
|
28320
|
+
cursor: zod.string().optional().describe(
|
|
28321
|
+
'Opaque pagination cursor. Take it verbatim from the previous page\'s\n`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and\nrepeat every other query parameter; the cursor is bound to that\nfilter set and a different one is rejected with 400. `limit` may\nchange between pages. No `X-Next-Cursor` on a response means the\nfeed is exhausted. Clients must not build or parse cursors.\n'
|
|
28322
|
+
)
|
|
28213
28323
|
});
|
|
28214
28324
|
var listOrdersResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28215
28325
|
var listOrdersResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -28230,8 +28340,12 @@ var ListOrdersResponseItem = zod.object({
|
|
|
28230
28340
|
lastTradeTimestamp: zod.number().nullish().describe("Timestamp (ms) of the last trade executed against this order. Null if no trades."),
|
|
28231
28341
|
status: zod.enum(["open", "closed", "canceled", "unknown"]).describe("`unknown` is the fallback for a chain status code the API doesn't recognize."),
|
|
28232
28342
|
symbol: zod.string(),
|
|
28233
|
-
type: zod.enum(["limit", "market", "twap", "unknown"]).describe(
|
|
28234
|
-
|
|
28343
|
+
type: zod.enum(["limit", "market", "twap", "unknown"]).describe(
|
|
28344
|
+
"`unknown` is the fallback for a chain type code the API doesn't recognize. A `twap` row (chain order_type=2) is a TWAP slice execution \u2014 the TWAP parent lives in `twap_orders` and is not returned by the order endpoints."
|
|
28345
|
+
),
|
|
28346
|
+
timeInForce: zod.union([zod.literal("ioc"), zod.literal(null)]).nullable().describe(
|
|
28347
|
+
"CCXT-collapsed time-in-force. `ioc` for an immediate-or-cancel\norder (chain TIF code 1); null for the default (GTT/GTC) or an\nunrecognized code. Always present (never omitted). The WS\n`orderUpdates` payload exposes the same `ioc`-or-absent value.\n"
|
|
28348
|
+
),
|
|
28235
28349
|
side: zod.enum(["buy", "sell"]),
|
|
28236
28350
|
price: zod.string().regex(listOrdersResponsePriceRegExp),
|
|
28237
28351
|
average: zod.string().nullish().describe("Average execution price as decimal string. Null when filled is 0."),
|
|
@@ -28273,10 +28387,10 @@ var ListOrdersResponseItem = zod.object({
|
|
|
28273
28387
|
"Granular chain-level status \u2014 the WS view exposes the same\nstring. The CCXT view at `OrderResponse.status` collapses these\ninto open | closed | canceled. `unknown` is the fallback for a\nchain code the API doesn't recognize.\n"
|
|
28274
28388
|
),
|
|
28275
28389
|
chain_type: zod.enum(["limit", "market", "twap", "unknown"]).describe(
|
|
28276
|
-
"Granular chain-level order type.
|
|
28390
|
+
"Granular chain-level order type. Mirrors the dbindexer\n`orders.order_type` column (0=limit, 1=market, 2=twap). TWAP\nslice executions are stored as individual order rows and surface\nhere as `twap`. `unknown` is the fallback for a chain code the\nAPI doesn't recognize.\n"
|
|
28277
28391
|
),
|
|
28278
|
-
close_reason: zod.string().
|
|
28279
|
-
"Free-form chain close reason for a terminal order \u2014 e.g.\n`completed`, `canceled`, `expired`, `ioc_canceled`, `
|
|
28392
|
+
close_reason: zod.string().nullable().describe(
|
|
28393
|
+
"Free-form chain close reason for a terminal order \u2014 e.g.\n`completed`, `canceled`, `expired`, `ioc_canceled`,\n`self_trade`, `post_only_rejected`, `replaced`. Null while the\norder is still live. Lets consumers tell an IOC-cancelled or\nself-trade-prevented close apart from the generic `canceled` close.\n"
|
|
28280
28394
|
)
|
|
28281
28395
|
}).describe(
|
|
28282
28396
|
"Exchange-specific extension on `OrderResponse`. Mirrors the\n`info` map populated in `internal/domain/order/service.go`.\n"
|
|
@@ -28307,8 +28421,12 @@ var GetOrderResponse = zod.object({
|
|
|
28307
28421
|
lastTradeTimestamp: zod.number().nullish().describe("Timestamp (ms) of the last trade executed against this order. Null if no trades."),
|
|
28308
28422
|
status: zod.enum(["open", "closed", "canceled", "unknown"]).describe("`unknown` is the fallback for a chain status code the API doesn't recognize."),
|
|
28309
28423
|
symbol: zod.string(),
|
|
28310
|
-
type: zod.enum(["limit", "market", "twap", "unknown"]).describe(
|
|
28311
|
-
|
|
28424
|
+
type: zod.enum(["limit", "market", "twap", "unknown"]).describe(
|
|
28425
|
+
"`unknown` is the fallback for a chain type code the API doesn't recognize. A `twap` row (chain order_type=2) is a TWAP slice execution \u2014 the TWAP parent lives in `twap_orders` and is not returned by the order endpoints."
|
|
28426
|
+
),
|
|
28427
|
+
timeInForce: zod.union([zod.literal("ioc"), zod.literal(null)]).nullable().describe(
|
|
28428
|
+
"CCXT-collapsed time-in-force. `ioc` for an immediate-or-cancel\norder (chain TIF code 1); null for the default (GTT/GTC) or an\nunrecognized code. Always present (never omitted). The WS\n`orderUpdates` payload exposes the same `ioc`-or-absent value.\n"
|
|
28429
|
+
),
|
|
28312
28430
|
side: zod.enum(["buy", "sell"]),
|
|
28313
28431
|
price: zod.string().regex(getOrderResponsePriceRegExp),
|
|
28314
28432
|
average: zod.string().nullish().describe("Average execution price as decimal string. Null when filled is 0."),
|
|
@@ -28350,10 +28468,10 @@ var GetOrderResponse = zod.object({
|
|
|
28350
28468
|
"Granular chain-level status \u2014 the WS view exposes the same\nstring. The CCXT view at `OrderResponse.status` collapses these\ninto open | closed | canceled. `unknown` is the fallback for a\nchain code the API doesn't recognize.\n"
|
|
28351
28469
|
),
|
|
28352
28470
|
chain_type: zod.enum(["limit", "market", "twap", "unknown"]).describe(
|
|
28353
|
-
"Granular chain-level order type.
|
|
28471
|
+
"Granular chain-level order type. Mirrors the dbindexer\n`orders.order_type` column (0=limit, 1=market, 2=twap). TWAP\nslice executions are stored as individual order rows and surface\nhere as `twap`. `unknown` is the fallback for a chain code the\nAPI doesn't recognize.\n"
|
|
28354
28472
|
),
|
|
28355
|
-
close_reason: zod.string().
|
|
28356
|
-
"Free-form chain close reason for a terminal order \u2014 e.g.\n`completed`, `canceled`, `expired`, `ioc_canceled`, `
|
|
28473
|
+
close_reason: zod.string().nullable().describe(
|
|
28474
|
+
"Free-form chain close reason for a terminal order \u2014 e.g.\n`completed`, `canceled`, `expired`, `ioc_canceled`,\n`self_trade`, `post_only_rejected`, `replaced`. Null while the\norder is still live. Lets consumers tell an IOC-cancelled or\nself-trade-prevented close apart from the generic `canceled` close.\n"
|
|
28357
28475
|
)
|
|
28358
28476
|
}).describe(
|
|
28359
28477
|
"Exchange-specific extension on `OrderResponse`. Mirrors the\n`info` map populated in `internal/domain/order/service.go`.\n"
|
|
@@ -28361,13 +28479,22 @@ var GetOrderResponse = zod.object({
|
|
|
28361
28479
|
}).describe(
|
|
28362
28480
|
"All numeric fields (price, amount, filled, remaining, cost,\nfee.cost, fee.rate, average, triggerPrice, stopPrice) are canonical\ndecimal strings.\n"
|
|
28363
28481
|
);
|
|
28364
|
-
var listMyTradesQueryLimitDefault =
|
|
28482
|
+
var listMyTradesQueryLimitDefault = 100;
|
|
28365
28483
|
var listMyTradesQueryLimitMax = 500;
|
|
28484
|
+
var listMyTradesQueryBeforeIndexMin = 0;
|
|
28485
|
+
var listMyTradesQueryBeforeIndexMax = 4294967295;
|
|
28366
28486
|
var ListMyTradesQueryParams = zod.object({
|
|
28367
28487
|
address: zod.string().describe("Blockchain address of the trader"),
|
|
28368
28488
|
symbol: zod.string().optional().describe("Symbol to filter by (e.g., AULT/USDT)"),
|
|
28369
28489
|
since: zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
28370
|
-
limit: zod.number().min(1).max(listMyTradesQueryLimitMax).default(listMyTradesQueryLimitDefault)
|
|
28490
|
+
limit: zod.number().min(1).max(listMyTradesQueryLimitMax).default(listMyTradesQueryLimitDefault),
|
|
28491
|
+
cursor: zod.string().optional().describe(
|
|
28492
|
+
'Opaque pagination cursor. Take it verbatim from the previous page\'s\n`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and\nrepeat every other query parameter; the cursor is bound to that\nfilter set and a different one is rejected with 400. `limit` may\nchange between pages. No `X-Next-Cursor` on a response means the\nfeed is exhausted. Clients must not build or parse cursors.\n'
|
|
28493
|
+
),
|
|
28494
|
+
before_height: zod.number().min(1).optional().describe(
|
|
28495
|
+
"Deprecated in favour of `cursor`; still honoured, and ignored when\n`cursor` is also present.\n\nComposite pagination cursor, upper half. Returns only trades\nstrictly older (in feed order) than the row identified by\n(`before_height`, `before_index`) \u2014 take both values from the\nlast row's `info.block_height` / `info.event_index`. Must be\npassed together with `before_index`. Unlike `since`, the cursor\ncannot skip or repeat trades when many share one timestamp.\n"
|
|
28496
|
+
),
|
|
28497
|
+
before_index: zod.number().min(listMyTradesQueryBeforeIndexMin).max(listMyTradesQueryBeforeIndexMax).optional().describe("Composite pagination cursor, lower half. See `before_height`.")
|
|
28371
28498
|
});
|
|
28372
28499
|
var listMyTradesResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28373
28500
|
var listMyTradesResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -28377,6 +28504,7 @@ var listMyTradesResponseFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
|
28377
28504
|
var listMyTradesResponseInfoAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
28378
28505
|
var listMyTradesResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
28379
28506
|
var listMyTradesResponseInfoEventIndexMin = 0;
|
|
28507
|
+
var listMyTradesResponseInfoEventIndexMax = 4294967295;
|
|
28380
28508
|
var ListMyTradesResponseItem = zod.object({
|
|
28381
28509
|
id: zod.string(),
|
|
28382
28510
|
order: zod.string().nullish(),
|
|
@@ -28386,10 +28514,11 @@ var ListMyTradesResponseItem = zod.object({
|
|
|
28386
28514
|
type: zod.union([
|
|
28387
28515
|
zod.literal("limit"),
|
|
28388
28516
|
zod.literal("market"),
|
|
28517
|
+
zod.literal("twap"),
|
|
28389
28518
|
zod.literal("unknown"),
|
|
28390
28519
|
zod.literal(null)
|
|
28391
28520
|
]).nullish().describe(
|
|
28392
|
-
"Order type resolved via JOIN to orders table. Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize."
|
|
28521
|
+
"Order type resolved via JOIN to orders table. `twap` marks a TWAP slice execution (chain code 2). Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize."
|
|
28393
28522
|
),
|
|
28394
28523
|
cloid: zod.string().nullish().describe(
|
|
28395
28524
|
"Client order id (hex, 8 bytes) resolved via JOIN to orders table. Null when the order carried none, the row predates cloid indexing, or on the public trades feed (cloids are private to the orderer)."
|
|
@@ -28423,8 +28552,8 @@ var ListMyTradesResponseItem = zod.object({
|
|
|
28423
28552
|
"Atto-precision amount the orderer received for this fill,\nsuffixed with the chain denom. Empty string when the chain did\nnot record this side.\n"
|
|
28424
28553
|
),
|
|
28425
28554
|
block_height: zod.string().regex(listMyTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
28426
|
-
event_index: zod.number().min(listMyTradesResponseInfoEventIndexMin).describe(
|
|
28427
|
-
"The trade's event position within its block.
|
|
28555
|
+
event_index: zod.number().min(listMyTradesResponseInfoEventIndexMin).max(listMyTradesResponseInfoEventIndexMax).describe(
|
|
28556
|
+
"The trade's event position within its block. With `block_height`\nit forms the row's composite pagination cursor: pass the last\nrow's pair as `before_height`/`before_index` to fetch the next\n(older) page.\n"
|
|
28428
28557
|
)
|
|
28429
28558
|
}).describe(
|
|
28430
28559
|
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
@@ -28453,12 +28582,17 @@ var GetOHLCVParams = zod.object({
|
|
|
28453
28582
|
symbol: zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
28454
28583
|
});
|
|
28455
28584
|
var getOHLCVQueryTimeframeDefault = `1m`;
|
|
28456
|
-
var getOHLCVQueryLimitDefault =
|
|
28585
|
+
var getOHLCVQueryLimitDefault = 500;
|
|
28457
28586
|
var getOHLCVQueryLimitMax = 1e3;
|
|
28458
28587
|
var GetOHLCVQueryParams = zod.object({
|
|
28459
28588
|
timeframe: zod.string().default(getOHLCVQueryTimeframeDefault).describe("Timeframe: 1m, 5m, 15m, 30m, 1h, 4h, 1d. Also accepts TV format: 1, 5, 15, 60, 1D"),
|
|
28460
|
-
limit: zod.number().min(1).max(getOHLCVQueryLimitMax).default(getOHLCVQueryLimitDefault)
|
|
28461
|
-
|
|
28589
|
+
limit: zod.number().min(1).max(getOHLCVQueryLimitMax).default(getOHLCVQueryLimitDefault).describe(
|
|
28590
|
+
"Bars per page, oldest first within the page. Without `since` the\npage holds the newest `limit` bars and the cursor walks back in\ntime; with `since` it holds the first `limit` bars from `since`\nand the cursor walks forward.\n"
|
|
28591
|
+
),
|
|
28592
|
+
since: zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
28593
|
+
cursor: zod.string().optional().describe(
|
|
28594
|
+
'Opaque pagination cursor. Take it verbatim from the previous page\'s\n`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and\nrepeat every other query parameter; the cursor is bound to that\nfilter set and a different one is rejected with 400. `limit` may\nchange between pages. No `X-Next-Cursor` on a response means the\nfeed is exhausted. Clients must not build or parse cursors.\n'
|
|
28595
|
+
)
|
|
28462
28596
|
});
|
|
28463
28597
|
var GetOHLCVResponseItem = zod.tuple([
|
|
28464
28598
|
zod.number().describe("timestamp in milliseconds"),
|
|
@@ -28536,7 +28670,7 @@ var GetUDFHistoryQueryParams = zod.object({
|
|
|
28536
28670
|
resolution: zod.enum(["1", "5", "15", "30", "60", "1D", "1W", "1M"]),
|
|
28537
28671
|
from: zod.number().describe("Unix seconds"),
|
|
28538
28672
|
to: zod.number().describe("Unix seconds"),
|
|
28539
|
-
countback: zod.number().min(1).max(getUDFHistoryQueryCountbackMax).optional()
|
|
28673
|
+
countback: zod.number().min(1).max(getUDFHistoryQueryCountbackMax).optional().describe("Values above 1000 are clamped to 1000 server-side.")
|
|
28540
28674
|
});
|
|
28541
28675
|
var GetUDFHistoryResponse = zod.object({
|
|
28542
28676
|
s: zod.enum(["ok", "no_data", "error"]),
|
|
@@ -28550,7 +28684,7 @@ var GetUDFHistoryResponse = zod.object({
|
|
|
28550
28684
|
nextTime: zod.number().optional().describe('Unix seconds of next available bar (when s = "no_data")')
|
|
28551
28685
|
});
|
|
28552
28686
|
var GetUDFQuotesQueryParams = zod.object({
|
|
28553
|
-
symbols: zod.string().describe("Comma-separated list of symbols")
|
|
28687
|
+
symbols: zod.string().describe("Comma-separated list of symbols, at most 100 (400 above that)")
|
|
28554
28688
|
});
|
|
28555
28689
|
var GetUDFQuotesResponse = zod.object({
|
|
28556
28690
|
s: zod.enum(["ok", "error"]),
|
|
@@ -28613,7 +28747,7 @@ function createDexWs(url, options) {
|
|
|
28613
28747
|
}
|
|
28614
28748
|
|
|
28615
28749
|
// src/index.ts
|
|
28616
|
-
var SDK_VERSION = "0.
|
|
28750
|
+
var SDK_VERSION = "0.7.0";
|
|
28617
28751
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28618
28752
|
0 && (module.exports = {
|
|
28619
28753
|
AGENT_DEFAULTS,
|
|
@@ -28632,6 +28766,7 @@ var SDK_VERSION = "0.6.0";
|
|
|
28632
28766
|
GetAllTickersResponse,
|
|
28633
28767
|
GetBalanceQueryParams,
|
|
28634
28768
|
GetBalanceResponse,
|
|
28769
|
+
GetDBReadyResponse,
|
|
28635
28770
|
GetHealthResponse,
|
|
28636
28771
|
GetLiveResponse,
|
|
28637
28772
|
GetOHLCVParams,
|
|
@@ -28688,6 +28823,7 @@ var SDK_VERSION = "0.6.0";
|
|
|
28688
28823
|
MarketType,
|
|
28689
28824
|
MissingMsgResponseError,
|
|
28690
28825
|
NETWORKS,
|
|
28826
|
+
NEXT_CURSOR_HEADER,
|
|
28691
28827
|
NetworkError,
|
|
28692
28828
|
ORDER_ID_LENGTH,
|
|
28693
28829
|
OrderId,
|
|
@@ -28723,6 +28859,7 @@ var SDK_VERSION = "0.6.0";
|
|
|
28723
28859
|
buildEip712TypedData,
|
|
28724
28860
|
buildFetchOptions,
|
|
28725
28861
|
bytesToBase64,
|
|
28862
|
+
collectPages,
|
|
28726
28863
|
computeEvmFeesPerGas,
|
|
28727
28864
|
computeFeeFreeGas,
|
|
28728
28865
|
computeFeeFreeGasCompound,
|
|
@@ -28818,6 +28955,7 @@ var SDK_VERSION = "0.6.0";
|
|
|
28818
28955
|
getTradeResponseFeeRateRegExp,
|
|
28819
28956
|
getTradeResponseInfoAddressOneRegExp,
|
|
28820
28957
|
getTradeResponseInfoBlockHeightRegExp,
|
|
28958
|
+
getTradeResponseInfoEventIndexMax,
|
|
28821
28959
|
getTradeResponseInfoEventIndexMin,
|
|
28822
28960
|
getTradeResponsePriceRegExp,
|
|
28823
28961
|
getTradingFeesResponseMakerRegExp,
|
|
@@ -28828,9 +28966,13 @@ var SDK_VERSION = "0.6.0";
|
|
|
28828
28966
|
isValidAultAddress,
|
|
28829
28967
|
isValidEvmAddress,
|
|
28830
28968
|
isValidValidatorAddress,
|
|
28969
|
+
listCurrenciesResponseInfoContractDecimalsMax,
|
|
28970
|
+
listCurrenciesResponseInfoContractDecimalsMin,
|
|
28831
28971
|
listMarketsResponseInfoEscrowAddressOneRegExp,
|
|
28832
28972
|
listMarketsResponseMakerRegExp,
|
|
28833
28973
|
listMarketsResponseTakerRegExp,
|
|
28974
|
+
listMyTradesQueryBeforeIndexMax,
|
|
28975
|
+
listMyTradesQueryBeforeIndexMin,
|
|
28834
28976
|
listMyTradesQueryLimitDefault,
|
|
28835
28977
|
listMyTradesQueryLimitMax,
|
|
28836
28978
|
listMyTradesResponseAmountRegExp,
|
|
@@ -28839,6 +28981,7 @@ var SDK_VERSION = "0.6.0";
|
|
|
28839
28981
|
listMyTradesResponseFeeRateRegExp,
|
|
28840
28982
|
listMyTradesResponseInfoAddressOneRegExp,
|
|
28841
28983
|
listMyTradesResponseInfoBlockHeightRegExp,
|
|
28984
|
+
listMyTradesResponseInfoEventIndexMax,
|
|
28842
28985
|
listMyTradesResponseInfoEventIndexMin,
|
|
28843
28986
|
listMyTradesResponsePriceRegExp,
|
|
28844
28987
|
listOrdersQueryAddressOneRegExp,
|
|
@@ -28856,6 +28999,8 @@ var SDK_VERSION = "0.6.0";
|
|
|
28856
28999
|
listOrdersResponseInfoRemainingDepositRegExp,
|
|
28857
29000
|
listOrdersResponsePriceRegExp,
|
|
28858
29001
|
listOrdersResponseRemainingRegExp,
|
|
29002
|
+
listTradesQueryBeforeIndexMax,
|
|
29003
|
+
listTradesQueryBeforeIndexMin,
|
|
28859
29004
|
listTradesQueryLimitDefault,
|
|
28860
29005
|
listTradesQueryLimitMax,
|
|
28861
29006
|
listTradesResponseAmountRegExp,
|
|
@@ -28864,6 +29009,7 @@ var SDK_VERSION = "0.6.0";
|
|
|
28864
29009
|
listTradesResponseFeeRateRegExp,
|
|
28865
29010
|
listTradesResponseInfoAddressOneRegExp,
|
|
28866
29011
|
listTradesResponseInfoBlockHeightRegExp,
|
|
29012
|
+
listTradesResponseInfoEventIndexMax,
|
|
28867
29013
|
listTradesResponseInfoEventIndexMin,
|
|
28868
29014
|
listTradesResponsePriceRegExp,
|
|
28869
29015
|
mergeManifests,
|
|
@@ -28871,6 +29017,7 @@ var SDK_VERSION = "0.6.0";
|
|
|
28871
29017
|
normalizeSignature,
|
|
28872
29018
|
normalizeSigner,
|
|
28873
29019
|
normalizeTxHash,
|
|
29020
|
+
paginate,
|
|
28874
29021
|
paginateAll,
|
|
28875
29022
|
parseEvmChainIdFromCosmosChainId,
|
|
28876
29023
|
pollTxInclusion,
|