ault-sdk-ts 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/core/http.d.ts +8 -0
- package/dist/core/user-agent.d.ts +15 -0
- package/dist/index.cjs +558 -723
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +549 -723
- package/dist/index.js.map +1 -1
- package/dist/rest/dex-types.generated.d.ts +62 -1
- package/dist/rest/dex.generated.d.ts +81 -11
- package/dist/ws/types.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,6 +4,16 @@ var __export = (target, all) => {
|
|
|
4
4
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
+
// src/core/user-agent.ts
|
|
8
|
+
var SDK_VERSION = "0.8.0";
|
|
9
|
+
var USER_AGENT = `ault-sdk-ts/${SDK_VERSION}`;
|
|
10
|
+
function isServerRuntime() {
|
|
11
|
+
if (typeof document !== "undefined") return false;
|
|
12
|
+
if (typeof globalThis.Deno !== "undefined") return false;
|
|
13
|
+
const versions = globalThis.process?.versions;
|
|
14
|
+
return Boolean(versions?.node || versions?.bun);
|
|
15
|
+
}
|
|
16
|
+
|
|
7
17
|
// src/proto/gen/google/protobuf/duration.ts
|
|
8
18
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
19
|
function createBaseDuration() {
|
|
@@ -207,7 +217,8 @@ var DEFAULT_OPTIONS = {
|
|
|
207
217
|
exponentialBackoff: true,
|
|
208
218
|
retryableMethods: ["GET", "HEAD", "OPTIONS"],
|
|
209
219
|
retryableStatuses: [...DEFAULT_RETRYABLE_STATUSES],
|
|
210
|
-
retryOnTimeout: false
|
|
220
|
+
retryOnTimeout: false,
|
|
221
|
+
userAgent: USER_AGENT
|
|
211
222
|
};
|
|
212
223
|
function ensureFetch(fetchFn) {
|
|
213
224
|
const resolved = fetchFn ?? globalThis.fetch;
|
|
@@ -252,6 +263,21 @@ async function fetchWithTimeout(fetchFn, url, options, timeout) {
|
|
|
252
263
|
removeAbortListener?.();
|
|
253
264
|
}
|
|
254
265
|
}
|
|
266
|
+
function withUserAgent(options, userAgent) {
|
|
267
|
+
if (!isServerRuntime()) return options;
|
|
268
|
+
const entries = [];
|
|
269
|
+
const raw = options.headers;
|
|
270
|
+
if (Array.isArray(raw)) {
|
|
271
|
+
entries.push(...raw.map(([k, v]) => [k, v]));
|
|
272
|
+
} else if (raw && typeof raw.forEach === "function") {
|
|
273
|
+
raw.forEach((value, key) => entries.push([key, value]));
|
|
274
|
+
} else if (raw) {
|
|
275
|
+
entries.push(...Object.entries(raw));
|
|
276
|
+
}
|
|
277
|
+
if (entries.some(([k]) => k.toLowerCase() === "user-agent")) return options;
|
|
278
|
+
entries.push(["user-agent", userAgent]);
|
|
279
|
+
return { ...options, headers: entries };
|
|
280
|
+
}
|
|
255
281
|
function calculateDelay(attempt, baseDelay, exponential) {
|
|
256
282
|
if (exponential) {
|
|
257
283
|
const exponentialDelay = baseDelay * Math.pow(2, attempt);
|
|
@@ -268,11 +294,12 @@ async function fetchWithRetry(url, options = {}, fetchOptions = {}, fetchFn) {
|
|
|
268
294
|
const method = (options.method || "GET").toUpperCase();
|
|
269
295
|
const canRetry = opts.retryableMethods.includes(method);
|
|
270
296
|
const resolvedFetch = ensureFetch(fetchFn);
|
|
297
|
+
const init = withUserAgent(options, opts.userAgent);
|
|
271
298
|
const isAbortError = (error) => error instanceof Error && error.name === "AbortError";
|
|
272
299
|
let lastError = null;
|
|
273
300
|
for (let attempt = 0; attempt <= opts.retries; attempt++) {
|
|
274
301
|
try {
|
|
275
|
-
const response = await fetchWithTimeout(resolvedFetch, url,
|
|
302
|
+
const response = await fetchWithTimeout(resolvedFetch, url, init, opts.timeout);
|
|
276
303
|
if (!response.ok && canRetry && opts.retryableStatuses.includes(response.status) && attempt < opts.retries) {
|
|
277
304
|
const delay = calculateDelay(attempt, opts.retryDelay, opts.exponentialBackoff);
|
|
278
305
|
await sleep(delay);
|
|
@@ -11435,6 +11462,7 @@ __export(dex_generated_exports, {
|
|
|
11435
11462
|
OrderResponseStatus: () => OrderResponseStatus,
|
|
11436
11463
|
OrderResponseTimeInForce: () => OrderResponseTimeInForce,
|
|
11437
11464
|
OrderResponseType: () => OrderResponseType,
|
|
11465
|
+
OrderTwapInfoDepositAsset: () => OrderTwapInfoDepositAsset,
|
|
11438
11466
|
RangeQueryDayParameter: () => RangeQueryDayParameter,
|
|
11439
11467
|
RangeQueryParameter: () => RangeQueryParameter,
|
|
11440
11468
|
ReadyResponseStatus: () => ReadyResponseStatus,
|
|
@@ -11520,6 +11548,10 @@ var OrderInfoChainType = {
|
|
|
11520
11548
|
twap: "twap",
|
|
11521
11549
|
unknown: "unknown"
|
|
11522
11550
|
};
|
|
11551
|
+
var OrderTwapInfoDepositAsset = {
|
|
11552
|
+
base: "base",
|
|
11553
|
+
quote: "quote"
|
|
11554
|
+
};
|
|
11523
11555
|
var HealthResponseStatus = {
|
|
11524
11556
|
healthy: "healthy"
|
|
11525
11557
|
};
|
|
@@ -12133,22 +12165,31 @@ function frameMatches(sub, data) {
|
|
|
12133
12165
|
}
|
|
12134
12166
|
}
|
|
12135
12167
|
var isowsModulePromise = null;
|
|
12136
|
-
function wrapCtor(Ctor) {
|
|
12137
|
-
return (url, protocols) =>
|
|
12168
|
+
function wrapCtor(Ctor, userAgent) {
|
|
12169
|
+
return (url, protocols) => {
|
|
12170
|
+
if (protocols !== void 0) return new Ctor(url, protocols);
|
|
12171
|
+
if (isServerRuntime()) {
|
|
12172
|
+
try {
|
|
12173
|
+
return new Ctor(url, { headers: { "User-Agent": userAgent } });
|
|
12174
|
+
} catch {
|
|
12175
|
+
}
|
|
12176
|
+
}
|
|
12177
|
+
return new Ctor(url);
|
|
12178
|
+
};
|
|
12138
12179
|
}
|
|
12139
12180
|
function currentGlobalCtor() {
|
|
12140
12181
|
return typeof globalThis !== "undefined" && typeof globalThis.WebSocket === "function" ? globalThis.WebSocket : null;
|
|
12141
12182
|
}
|
|
12142
|
-
function getDefaultWebSocketFactory() {
|
|
12183
|
+
function getDefaultWebSocketFactory(userAgent) {
|
|
12143
12184
|
const G = currentGlobalCtor();
|
|
12144
|
-
if (G) return wrapCtor(G);
|
|
12185
|
+
if (G) return wrapCtor(G, userAgent);
|
|
12145
12186
|
if (!isowsModulePromise) {
|
|
12146
12187
|
isowsModulePromise = import("isows");
|
|
12147
12188
|
}
|
|
12148
12189
|
return isowsModulePromise.then((mod) => {
|
|
12149
12190
|
const G2 = currentGlobalCtor();
|
|
12150
|
-
if (G2) return wrapCtor(G2);
|
|
12151
|
-
return wrapCtor(mod.WebSocket);
|
|
12191
|
+
if (G2) return wrapCtor(G2, userAgent);
|
|
12192
|
+
return wrapCtor(mod.WebSocket, userAgent);
|
|
12152
12193
|
});
|
|
12153
12194
|
}
|
|
12154
12195
|
var DexWsClient = class {
|
|
@@ -12176,7 +12217,8 @@ var DexWsClient = class {
|
|
|
12176
12217
|
reconnect: opts?.reconnect ?? true,
|
|
12177
12218
|
maxReconnectAttempts: opts?.maxReconnectAttempts ?? Infinity,
|
|
12178
12219
|
reconnectDelay: opts?.reconnectDelay ?? 1e3,
|
|
12179
|
-
maxReconnectDelay: opts?.maxReconnectDelay ?? 3e4
|
|
12220
|
+
maxReconnectDelay: opts?.maxReconnectDelay ?? 3e4,
|
|
12221
|
+
userAgent: opts?.userAgent ?? USER_AGENT
|
|
12180
12222
|
};
|
|
12181
12223
|
this.userFactory = opts?.createWebSocket;
|
|
12182
12224
|
}
|
|
@@ -12394,7 +12436,7 @@ var DexWsClient = class {
|
|
|
12394
12436
|
}
|
|
12395
12437
|
resolveFactory() {
|
|
12396
12438
|
if (this.userFactory) return this.userFactory;
|
|
12397
|
-
return getDefaultWebSocketFactory();
|
|
12439
|
+
return getDefaultWebSocketFactory(this.options.userAgent);
|
|
12398
12440
|
}
|
|
12399
12441
|
handleMessage(raw) {
|
|
12400
12442
|
let msg2;
|
|
@@ -27726,247 +27768,201 @@ var PageResponseSchema = z3.object({
|
|
|
27726
27768
|
// src/rest/dex-types.generated.ts
|
|
27727
27769
|
import * as zod from "zod";
|
|
27728
27770
|
var GetHealthResponse = zod.object({
|
|
27729
|
-
status: zod.enum(["healthy"])
|
|
27771
|
+
"status": zod.enum(["healthy"])
|
|
27730
27772
|
});
|
|
27731
27773
|
var GetReadyResponse = zod.object({
|
|
27732
|
-
status: zod.enum(["ready"])
|
|
27774
|
+
"status": zod.enum(["ready"])
|
|
27733
27775
|
});
|
|
27734
27776
|
var GetLiveResponse = zod.object({
|
|
27735
|
-
status: zod.enum(["alive"])
|
|
27777
|
+
"status": zod.enum(["alive"])
|
|
27736
27778
|
});
|
|
27737
27779
|
var GetDBReadyResponse = zod.object({
|
|
27738
|
-
status: zod.enum(["ok", "unavailable"]),
|
|
27739
|
-
database: zod.enum(["ok", "unreachable"])
|
|
27780
|
+
"status": zod.enum(["ok", "unavailable"]),
|
|
27781
|
+
"database": zod.enum(["ok", "unreachable"])
|
|
27740
27782
|
});
|
|
27741
27783
|
var GetStatusResponse = zod.object({
|
|
27742
|
-
last_indexed_height: zod.number(),
|
|
27743
|
-
last_indexed_at: zod.iso.datetime({})
|
|
27784
|
+
"last_indexed_height": zod.number(),
|
|
27785
|
+
"last_indexed_at": zod.iso.datetime({})
|
|
27744
27786
|
});
|
|
27745
27787
|
var GetSDKManifestResponse = zod.object({
|
|
27746
|
-
schemaVersion: zod.number().min(1).describe(
|
|
27747
|
-
|
|
27748
|
-
),
|
|
27749
|
-
|
|
27750
|
-
|
|
27751
|
-
),
|
|
27752
|
-
eip712: zod.record(zod.string(), zod.unknown()).optional().describe(
|
|
27753
|
-
"EIP-712 fee-related defaults (e.g. fee amount, gas limit). Shape\nis operator-controlled.\n"
|
|
27754
|
-
),
|
|
27755
|
-
urls: zod.record(zod.string(), zod.unknown()).optional().describe("Env-specific URL overrides (e.g. `rest`, `rpc`, `ws`).\n")
|
|
27756
|
-
}).describe(
|
|
27757
|
-
"Per-environment SDK manifest. The dex-api treats this as an opaque\noperator-supplied document apart from `schemaVersion`; the named\nsections below describe what SDKs currently look for, but unknown\ntop-level fields are preserved verbatim so a forward-compat manifest\nflows through without a server release.\n"
|
|
27758
|
-
);
|
|
27788
|
+
"schemaVersion": zod.number().min(1).describe("Manifest schema version. Server rejects values `< 1` at boot;\nfuture majors (e.g. `2`) pass through and are interpreted by\nthe SDK.\n"),
|
|
27789
|
+
"gas": zod.record(zod.string(), zod.unknown()).optional().describe("Module gas constants overridden for this env (keyed by message\ntype, e.g. `LIMIT_ORDER`). Values are integers.\n"),
|
|
27790
|
+
"eip712": zod.record(zod.string(), zod.unknown()).optional().describe("EIP-712 fee-related defaults (e.g. fee amount, gas limit). Shape\nis operator-controlled.\n"),
|
|
27791
|
+
"urls": zod.record(zod.string(), zod.unknown()).optional().describe("Env-specific URL overrides (e.g. `rest`, `rpc`, `ws`).\n")
|
|
27792
|
+
}).describe("Per-environment SDK manifest. The dex-api treats this as an opaque\noperator-supplied document apart from `schemaVersion`; the named\nsections below describe what SDKs currently look for, but unknown\ntop-level fields are preserved verbatim so a forward-compat manifest\nflows through without a server release.\n");
|
|
27759
27793
|
var listMarketsResponseTakerRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
27760
27794
|
var listMarketsResponseMakerRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
27761
27795
|
var listMarketsResponseInfoEscrowAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
27762
27796
|
var ListMarketsResponseItem = zod.object({
|
|
27763
|
-
id: zod.string(),
|
|
27764
|
-
symbol: zod.string(),
|
|
27765
|
-
base: zod.string(),
|
|
27766
|
-
quote: zod.string(),
|
|
27767
|
-
baseId: zod.string().describe("On-chain denom"),
|
|
27768
|
-
quoteId: zod.string(),
|
|
27769
|
-
active: zod.boolean(),
|
|
27770
|
-
type: zod.enum(["spot"]),
|
|
27771
|
-
spot: zod.boolean(),
|
|
27772
|
-
margin: zod.boolean().optional(),
|
|
27773
|
-
future: zod.boolean().optional(),
|
|
27774
|
-
swap: zod.boolean().optional(),
|
|
27775
|
-
option: zod.boolean().optional(),
|
|
27776
|
-
contract: zod.boolean().optional(),
|
|
27777
|
-
settle: zod.string().nullish(),
|
|
27778
|
-
settleId: zod.string().nullish(),
|
|
27779
|
-
contractSize: zod.number().nullish(),
|
|
27780
|
-
linear: zod.boolean().nullish(),
|
|
27781
|
-
inverse: zod.boolean().nullish(),
|
|
27782
|
-
expiry: zod.number().nullish(),
|
|
27783
|
-
expiryDatetime: zod.string().nullish(),
|
|
27784
|
-
strike: zod.number().nullish(),
|
|
27785
|
-
optionType: zod.string().nullish(),
|
|
27786
|
-
feeSide: zod.string().optional(),
|
|
27787
|
-
taker: zod.string().regex(listMarketsResponseTakerRegExp).describe(
|
|
27788
|
-
|
|
27789
|
-
),
|
|
27790
|
-
|
|
27791
|
-
|
|
27792
|
-
|
|
27793
|
-
|
|
27794
|
-
|
|
27795
|
-
price: zod.number().optional(),
|
|
27796
|
-
cost: zod.number().optional()
|
|
27797
|
+
"id": zod.string(),
|
|
27798
|
+
"symbol": zod.string(),
|
|
27799
|
+
"base": zod.string(),
|
|
27800
|
+
"quote": zod.string(),
|
|
27801
|
+
"baseId": zod.string().describe("On-chain denom"),
|
|
27802
|
+
"quoteId": zod.string(),
|
|
27803
|
+
"active": zod.boolean(),
|
|
27804
|
+
"type": zod.enum(["spot"]),
|
|
27805
|
+
"spot": zod.boolean(),
|
|
27806
|
+
"margin": zod.boolean().optional(),
|
|
27807
|
+
"future": zod.boolean().optional(),
|
|
27808
|
+
"swap": zod.boolean().optional(),
|
|
27809
|
+
"option": zod.boolean().optional(),
|
|
27810
|
+
"contract": zod.boolean().optional(),
|
|
27811
|
+
"settle": zod.string().nullish(),
|
|
27812
|
+
"settleId": zod.string().nullish(),
|
|
27813
|
+
"contractSize": zod.number().nullish(),
|
|
27814
|
+
"linear": zod.boolean().nullish(),
|
|
27815
|
+
"inverse": zod.boolean().nullish(),
|
|
27816
|
+
"expiry": zod.number().nullish(),
|
|
27817
|
+
"expiryDatetime": zod.string().nullish(),
|
|
27818
|
+
"strike": zod.number().nullish(),
|
|
27819
|
+
"optionType": zod.string().nullish(),
|
|
27820
|
+
"feeSide": zod.string().optional(),
|
|
27821
|
+
"taker": zod.string().regex(listMarketsResponseTakerRegExp).describe("Taker fee rate as a canonical decimal string. Strings preserve\nprecision past 2^53 raw units and avoid float-rounding noise.\n"),
|
|
27822
|
+
"maker": zod.string().regex(listMarketsResponseMakerRegExp).describe("Maker fee rate as a canonical decimal string."),
|
|
27823
|
+
"percentage": zod.boolean().optional(),
|
|
27824
|
+
"tierBased": zod.boolean().optional(),
|
|
27825
|
+
"precision": zod.object({
|
|
27826
|
+
"amount": zod.number().optional(),
|
|
27827
|
+
"price": zod.number().optional(),
|
|
27828
|
+
"cost": zod.number().optional()
|
|
27797
27829
|
}),
|
|
27798
|
-
limits: zod.object({
|
|
27799
|
-
leverage: zod.object({
|
|
27800
|
-
min: zod.number().nullish(),
|
|
27801
|
-
max: zod.number().nullish()
|
|
27830
|
+
"limits": zod.object({
|
|
27831
|
+
"leverage": zod.object({
|
|
27832
|
+
"min": zod.number().nullish(),
|
|
27833
|
+
"max": zod.number().nullish()
|
|
27802
27834
|
}).optional(),
|
|
27803
|
-
amount: zod.object({
|
|
27804
|
-
min: zod.number().nullish(),
|
|
27805
|
-
max: zod.number().nullish()
|
|
27835
|
+
"amount": zod.object({
|
|
27836
|
+
"min": zod.number().nullish(),
|
|
27837
|
+
"max": zod.number().nullish()
|
|
27806
27838
|
}).optional(),
|
|
27807
|
-
price: zod.object({
|
|
27808
|
-
min: zod.number().nullish(),
|
|
27809
|
-
max: zod.number().nullish()
|
|
27839
|
+
"price": zod.object({
|
|
27840
|
+
"min": zod.number().nullish(),
|
|
27841
|
+
"max": zod.number().nullish()
|
|
27810
27842
|
}).optional(),
|
|
27811
|
-
cost: zod.object({
|
|
27812
|
-
min: zod.number().nullish(),
|
|
27813
|
-
max: zod.number().nullish()
|
|
27843
|
+
"cost": zod.object({
|
|
27844
|
+
"min": zod.number().nullish(),
|
|
27845
|
+
"max": zod.number().nullish()
|
|
27814
27846
|
}).optional()
|
|
27815
27847
|
}),
|
|
27816
|
-
created: zod.number().nullish(),
|
|
27817
|
-
info: zod.object({
|
|
27818
|
-
escrow_address: zod.string().regex(listMarketsResponseInfoEscrowAddressOneRegExp).describe(
|
|
27819
|
-
|
|
27820
|
-
).optional().describe(
|
|
27821
|
-
|
|
27822
|
-
),
|
|
27823
|
-
block_height: zod.number().optional().describe("Height of the block at which the market was registered."),
|
|
27824
|
-
market_type: zod.number().optional().describe(
|
|
27825
|
-
"On-chain market type code (e.g. spot). Stable across the\nlifecycle of the market; `MarketResponse.type` carries the\nCCXT label.\n"
|
|
27826
|
-
)
|
|
27827
|
-
}).describe(
|
|
27828
|
-
"Exchange-specific extension on `MarketResponse`. Mirrors the\n`Info` map populated in `internal/domain/market/service.go`.\n"
|
|
27829
|
-
)
|
|
27848
|
+
"created": zod.number().nullish(),
|
|
27849
|
+
"info": zod.object({
|
|
27850
|
+
"escrow_address": zod.string().regex(listMarketsResponseInfoEscrowAddressOneRegExp).describe("Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n").optional().describe("Bech32 address of the per-market escrow account that holds\nuser deposits while orders are resting.\n"),
|
|
27851
|
+
"block_height": zod.number().optional().describe("Height of the block at which the market was registered."),
|
|
27852
|
+
"market_type": zod.number().optional().describe("On-chain market type code (e.g. spot). Stable across the\nlifecycle of the market; `MarketResponse.type` carries the\nCCXT label.\n")
|
|
27853
|
+
}).describe("Exchange-specific extension on `MarketResponse`. Mirrors the\n`Info` map populated in `internal/domain/market/service.go`.\n")
|
|
27830
27854
|
});
|
|
27831
27855
|
var ListMarketsResponse = zod.array(ListMarketsResponseItem);
|
|
27832
27856
|
var listCurrenciesResponseInfoContractDecimalsMin = 0;
|
|
27833
27857
|
var listCurrenciesResponseInfoContractDecimalsMax = 255;
|
|
27834
|
-
var ListCurrenciesResponse = zod.record(
|
|
27835
|
-
zod.string(),
|
|
27836
|
-
zod.
|
|
27837
|
-
|
|
27838
|
-
|
|
27839
|
-
|
|
27840
|
-
|
|
27841
|
-
|
|
27842
|
-
|
|
27843
|
-
|
|
27844
|
-
|
|
27845
|
-
"
|
|
27846
|
-
|
|
27847
|
-
|
|
27848
|
-
|
|
27849
|
-
|
|
27850
|
-
|
|
27851
|
-
|
|
27852
|
-
|
|
27853
|
-
|
|
27854
|
-
|
|
27855
|
-
|
|
27856
|
-
}),
|
|
27857
|
-
networks: zod.looseObject({}).optional(),
|
|
27858
|
-
info: zod.object({
|
|
27859
|
-
contractDecimals: zod.number().min(listCurrenciesResponseInfoContractDecimalsMin).max(listCurrenciesResponseInfoContractDecimalsMax).describe(
|
|
27860
|
-
"The token contract's own decimals (raw ERC20 decimals). Amounts\non the API are NOT in these units \u2014 see `precision`.\n"
|
|
27861
|
-
)
|
|
27862
|
-
})
|
|
27858
|
+
var ListCurrenciesResponse = zod.record(zod.string(), zod.object({
|
|
27859
|
+
"id": zod.string().describe("On-chain denom"),
|
|
27860
|
+
"code": zod.string().describe("Ticker symbol"),
|
|
27861
|
+
"name": zod.string().nullish(),
|
|
27862
|
+
"active": zod.boolean(),
|
|
27863
|
+
"deposit": zod.boolean().nullish(),
|
|
27864
|
+
"withdraw": zod.boolean().nullish(),
|
|
27865
|
+
"fee": zod.number().nullish(),
|
|
27866
|
+
"precision": zod.number().describe("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"),
|
|
27867
|
+
"limits": zod.object({
|
|
27868
|
+
"amount": zod.object({
|
|
27869
|
+
"min": zod.number().nullish(),
|
|
27870
|
+
"max": zod.number().nullish()
|
|
27871
|
+
}).optional(),
|
|
27872
|
+
"withdraw": zod.object({
|
|
27873
|
+
"min": zod.number().nullish(),
|
|
27874
|
+
"max": zod.number().nullish()
|
|
27875
|
+
}).optional()
|
|
27876
|
+
}),
|
|
27877
|
+
"networks": zod.looseObject({}).optional(),
|
|
27878
|
+
"info": zod.object({
|
|
27879
|
+
"contractDecimals": zod.number().min(listCurrenciesResponseInfoContractDecimalsMin).max(listCurrenciesResponseInfoContractDecimalsMax).describe("The token contract's own decimals (raw ERC20 decimals). Amounts\non the API are NOT in these units \u2014 see `precision`.\n")
|
|
27863
27880
|
})
|
|
27864
|
-
);
|
|
27881
|
+
}));
|
|
27865
27882
|
var GetTickerParams = zod.object({
|
|
27866
|
-
symbol: zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
27883
|
+
"symbol": zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
27867
27884
|
});
|
|
27868
27885
|
var GetTickerResponse = zod.object({
|
|
27869
|
-
symbol: zod.string(),
|
|
27870
|
-
high: zod.string().nullish(),
|
|
27871
|
-
low: zod.string().nullish(),
|
|
27872
|
-
bid: zod.string().nullish(),
|
|
27873
|
-
bidVolume: zod.string().nullish().describe("Volume at the best bid price level. Extracted from the orderbook snapshot."),
|
|
27874
|
-
ask: zod.string().nullish(),
|
|
27875
|
-
askVolume: zod.string().nullish().describe("Volume at the best ask price level. Extracted from the orderbook snapshot."),
|
|
27876
|
-
vwap: zod.string().nullish().describe("Volume-weighted average price: quoteVolume / baseVolume"),
|
|
27877
|
-
open: zod.string().nullish(),
|
|
27878
|
-
close: zod.string().nullish(),
|
|
27879
|
-
last: zod.string().nullish(),
|
|
27880
|
-
previousClose: zod.string().nullish().describe("Close price of the last bar before the 24h window."),
|
|
27881
|
-
change: zod.string().nullish(),
|
|
27882
|
-
percentage: zod.string().nullish(),
|
|
27883
|
-
average: zod.string().nullish().describe("Simple average: (open + last) / 2"),
|
|
27884
|
-
baseVolume: zod.string(),
|
|
27885
|
-
quoteVolume: zod.string().nullish(),
|
|
27886
|
-
timestamp: zod.number().describe("Milliseconds"),
|
|
27887
|
-
datetime: zod.iso.datetime({}),
|
|
27888
|
-
info: zod.looseObject({})
|
|
27889
|
-
}).describe(
|
|
27890
|
-
|
|
27891
|
-
)
|
|
27892
|
-
|
|
27893
|
-
zod.string(),
|
|
27894
|
-
zod.
|
|
27895
|
-
|
|
27896
|
-
|
|
27897
|
-
|
|
27898
|
-
|
|
27899
|
-
|
|
27900
|
-
|
|
27901
|
-
|
|
27902
|
-
|
|
27903
|
-
|
|
27904
|
-
|
|
27905
|
-
|
|
27906
|
-
|
|
27907
|
-
|
|
27908
|
-
|
|
27909
|
-
|
|
27910
|
-
|
|
27911
|
-
|
|
27912
|
-
timestamp: zod.number().describe("Milliseconds"),
|
|
27913
|
-
datetime: zod.iso.datetime({}),
|
|
27914
|
-
info: zod.looseObject({})
|
|
27915
|
-
}).describe(
|
|
27916
|
-
"24h ticker stats. All numeric fields are canonical decimal strings\nso quantities at any magnitude survive the JSON round-trip without\nrounding through float64. Pointer-style fields (high/low/bid/etc.)\nare nullable when no data is available for that field.\n"
|
|
27917
|
-
)
|
|
27918
|
-
);
|
|
27886
|
+
"symbol": zod.string(),
|
|
27887
|
+
"high": zod.string().nullish(),
|
|
27888
|
+
"low": zod.string().nullish(),
|
|
27889
|
+
"bid": zod.string().nullish(),
|
|
27890
|
+
"bidVolume": zod.string().nullish().describe("Volume at the best bid price level. Extracted from the orderbook snapshot."),
|
|
27891
|
+
"ask": zod.string().nullish(),
|
|
27892
|
+
"askVolume": zod.string().nullish().describe("Volume at the best ask price level. Extracted from the orderbook snapshot."),
|
|
27893
|
+
"vwap": zod.string().nullish().describe("Volume-weighted average price: quoteVolume / baseVolume"),
|
|
27894
|
+
"open": zod.string().nullish(),
|
|
27895
|
+
"close": zod.string().nullish(),
|
|
27896
|
+
"last": zod.string().nullish(),
|
|
27897
|
+
"previousClose": zod.string().nullish().describe("Close price of the last bar before the 24h window."),
|
|
27898
|
+
"change": zod.string().nullish(),
|
|
27899
|
+
"percentage": zod.string().nullish(),
|
|
27900
|
+
"average": zod.string().nullish().describe("Simple average: (open + last) / 2"),
|
|
27901
|
+
"baseVolume": zod.string(),
|
|
27902
|
+
"quoteVolume": zod.string().nullish(),
|
|
27903
|
+
"timestamp": zod.number().describe("Milliseconds"),
|
|
27904
|
+
"datetime": zod.iso.datetime({}),
|
|
27905
|
+
"info": zod.looseObject({})
|
|
27906
|
+
}).describe("24h ticker stats. All numeric fields are canonical decimal strings\nso quantities at any magnitude survive the JSON round-trip without\nrounding through float64. Pointer-style fields (high/low/bid/etc.)\nare nullable when no data is available for that field.\n");
|
|
27907
|
+
var GetAllTickersResponse = zod.record(zod.string(), zod.object({
|
|
27908
|
+
"symbol": zod.string(),
|
|
27909
|
+
"high": zod.string().nullish(),
|
|
27910
|
+
"low": zod.string().nullish(),
|
|
27911
|
+
"bid": zod.string().nullish(),
|
|
27912
|
+
"bidVolume": zod.string().nullish().describe("Volume at the best bid price level. Extracted from the orderbook snapshot."),
|
|
27913
|
+
"ask": zod.string().nullish(),
|
|
27914
|
+
"askVolume": zod.string().nullish().describe("Volume at the best ask price level. Extracted from the orderbook snapshot."),
|
|
27915
|
+
"vwap": zod.string().nullish().describe("Volume-weighted average price: quoteVolume / baseVolume"),
|
|
27916
|
+
"open": zod.string().nullish(),
|
|
27917
|
+
"close": zod.string().nullish(),
|
|
27918
|
+
"last": zod.string().nullish(),
|
|
27919
|
+
"previousClose": zod.string().nullish().describe("Close price of the last bar before the 24h window."),
|
|
27920
|
+
"change": zod.string().nullish(),
|
|
27921
|
+
"percentage": zod.string().nullish(),
|
|
27922
|
+
"average": zod.string().nullish().describe("Simple average: (open + last) / 2"),
|
|
27923
|
+
"baseVolume": zod.string(),
|
|
27924
|
+
"quoteVolume": zod.string().nullish(),
|
|
27925
|
+
"timestamp": zod.number().describe("Milliseconds"),
|
|
27926
|
+
"datetime": zod.iso.datetime({}),
|
|
27927
|
+
"info": zod.looseObject({})
|
|
27928
|
+
}).describe("24h ticker stats. All numeric fields are canonical decimal strings\nso quantities at any magnitude survive the JSON round-trip without\nrounding through float64. Pointer-style fields (high/low/bid/etc.)\nare nullable when no data is available for that field.\n"));
|
|
27919
27929
|
var GetOrderbookParams = zod.object({
|
|
27920
|
-
symbol: zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
27930
|
+
"symbol": zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
27921
27931
|
});
|
|
27922
27932
|
var getOrderbookQueryLimitDefault = 20;
|
|
27923
27933
|
var getOrderbookQueryLimitMax = 20;
|
|
27924
27934
|
var GetOrderbookQueryParams = zod.object({
|
|
27925
|
-
limit: zod.number().min(1).max(getOrderbookQueryLimitMax).default(getOrderbookQueryLimitDefault)
|
|
27935
|
+
"limit": zod.number().min(1).max(getOrderbookQueryLimitMax).default(getOrderbookQueryLimitDefault)
|
|
27926
27936
|
});
|
|
27927
27937
|
var getOrderbookResponseMarketIdRegExp = new RegExp("^[0-9a-f]{2,510}$");
|
|
27928
27938
|
var GetOrderbookResponse = zod.object({
|
|
27929
|
-
symbol: zod.string(),
|
|
27930
|
-
market_id: zod.string().regex(getOrderbookResponseMarketIdRegExp).describe(
|
|
27931
|
-
|
|
27932
|
-
|
|
27933
|
-
|
|
27934
|
-
|
|
27935
|
-
|
|
27936
|
-
|
|
27937
|
-
|
|
27938
|
-
).describe(
|
|
27939
|
-
|
|
27940
|
-
),
|
|
27941
|
-
|
|
27942
|
-
zod.tuple([
|
|
27943
|
-
zod.string().describe("price, decimal string"),
|
|
27944
|
-
zod.string().describe("quantity, decimal string")
|
|
27945
|
-
])
|
|
27946
|
-
).describe(
|
|
27947
|
-
"Ask levels as `[price, qty]` decimal-string tuples. Ordered by\nprice ascending \u2014 index 0 is the best ask. Matches the WS\n`book` topic, so consumers that switch between REST snapshots\nand WS deltas don't need to re-sort.\n"
|
|
27948
|
-
),
|
|
27949
|
-
timestamp: zod.number(),
|
|
27950
|
-
datetime: zod.iso.datetime({}),
|
|
27951
|
-
nonce: zod.number()
|
|
27939
|
+
"symbol": zod.string(),
|
|
27940
|
+
"market_id": zod.string().regex(getOrderbookResponseMarketIdRegExp).describe("Hex-encoded chain market identifier (no `0x` prefix). Provided so\nconsumers can round-trip back to chain proto endpoints which key\non the binary market id without re-resolving the symbol map.\nLayout on the chain side is `MarketType (1 byte) | baseDenom |\n\\\\x00 | quoteDenom`, with the full id stored as `VARBINARY(255)`\nin the indexer; the hex form is therefore variable-length, even\nfor short-denom test markets that hit the lower bound.\n"),
|
|
27941
|
+
"bids": zod.array(zod.tuple([
|
|
27942
|
+
zod.string().describe("price, decimal string"),
|
|
27943
|
+
zod.string().describe("quantity, decimal string")
|
|
27944
|
+
])).describe("Bid levels as `[price, qty]` decimal-string tuples. Ordered by\nprice descending \u2014 index 0 is the best bid. Matches the WS\n`book` topic (`docs/websocket-api.md`), so consumers that switch\nbetween REST snapshots and WS deltas don't need to re-sort.\n"),
|
|
27945
|
+
"asks": zod.array(zod.tuple([
|
|
27946
|
+
zod.string().describe("price, decimal string"),
|
|
27947
|
+
zod.string().describe("quantity, decimal string")
|
|
27948
|
+
])).describe("Ask levels as `[price, qty]` decimal-string tuples. Ordered by\nprice ascending \u2014 index 0 is the best ask. Matches the WS\n`book` topic, so consumers that switch between REST snapshots\nand WS deltas don't need to re-sort.\n"),
|
|
27949
|
+
"timestamp": zod.number(),
|
|
27950
|
+
"datetime": zod.iso.datetime({}),
|
|
27951
|
+
"nonce": zod.number()
|
|
27952
27952
|
});
|
|
27953
27953
|
var ListTradesParams = zod.object({
|
|
27954
|
-
symbol: zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
27954
|
+
"symbol": zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
27955
27955
|
});
|
|
27956
27956
|
var listTradesQueryLimitDefault = 100;
|
|
27957
27957
|
var listTradesQueryLimitMax = 500;
|
|
27958
27958
|
var listTradesQueryBeforeIndexMin = 0;
|
|
27959
27959
|
var listTradesQueryBeforeIndexMax = 4294967295;
|
|
27960
27960
|
var ListTradesQueryParams = zod.object({
|
|
27961
|
-
limit: zod.number().min(1).max(listTradesQueryLimitMax).default(listTradesQueryLimitDefault),
|
|
27962
|
-
since: zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
27963
|
-
cursor: zod.string().optional().describe(
|
|
27964
|
-
|
|
27965
|
-
),
|
|
27966
|
-
before_height: zod.number().min(1).optional().describe(
|
|
27967
|
-
"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"
|
|
27968
|
-
),
|
|
27969
|
-
before_index: zod.number().min(listTradesQueryBeforeIndexMin).max(listTradesQueryBeforeIndexMax).optional().describe("Composite pagination cursor, lower half. See `before_height`.")
|
|
27961
|
+
"limit": zod.number().min(1).max(listTradesQueryLimitMax).default(listTradesQueryLimitDefault),
|
|
27962
|
+
"since": zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
27963
|
+
"cursor": zod.string().optional().describe('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'),
|
|
27964
|
+
"before_height": zod.number().min(1).optional().describe("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"),
|
|
27965
|
+
"before_index": zod.number().min(listTradesQueryBeforeIndexMin).max(listTradesQueryBeforeIndexMax).optional().describe("Composite pagination cursor, lower half. See `before_height`.")
|
|
27970
27966
|
});
|
|
27971
27967
|
var listTradesResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
27972
27968
|
var listTradesResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -27978,70 +27974,36 @@ var listTradesResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
|
27978
27974
|
var listTradesResponseInfoEventIndexMin = 0;
|
|
27979
27975
|
var listTradesResponseInfoEventIndexMax = 4294967295;
|
|
27980
27976
|
var ListTradesResponseItem = zod.object({
|
|
27981
|
-
id: zod.string(),
|
|
27982
|
-
order: zod.string().nullish(),
|
|
27983
|
-
timestamp: zod.number(),
|
|
27984
|
-
datetime: zod.iso.datetime({}),
|
|
27985
|
-
symbol: zod.string(),
|
|
27986
|
-
type: zod.union([
|
|
27987
|
-
|
|
27988
|
-
|
|
27989
|
-
|
|
27990
|
-
|
|
27991
|
-
|
|
27992
|
-
|
|
27993
|
-
|
|
27994
|
-
|
|
27995
|
-
|
|
27996
|
-
"
|
|
27997
|
-
),
|
|
27998
|
-
|
|
27999
|
-
|
|
28000
|
-
"
|
|
28001
|
-
|
|
28002
|
-
|
|
28003
|
-
|
|
28004
|
-
|
|
28005
|
-
|
|
28006
|
-
cost: zod.string().regex(listTradesResponseFeeCostRegExp).optional().describe("Fee cost in `currency` units, decimal string."),
|
|
28007
|
-
currency: zod.string().optional().describe(
|
|
28008
|
-
'Ticker of the fee denom (e.g., "USDT", or "AULT" for a base-denom fee). The quote ticker for the rate-estimated fallback.'
|
|
28009
|
-
),
|
|
28010
|
-
rate: zod.string().regex(listTradesResponseFeeRateRegExp).optional().describe(
|
|
28011
|
-
"This leg's fee rate from the market, decimal string: the maker rate for the maker leg, the taker rate otherwise."
|
|
28012
|
-
)
|
|
28013
|
-
}).optional().describe(
|
|
28014
|
-
"Fee charged on the fill. When the indexer recorded a realized fee, cost and currency report it verbatim; the currency follows the denom the filled leg received, which is the base asset on a taker buy, not always the quote. For rows that predate fee indexing, cost falls back to the estimate amount * price * rate in the quote currency, where rate is this leg's rate (maker_fee_rate for the maker leg, otherwise taker_fee_rate)."
|
|
28015
|
-
),
|
|
28016
|
-
info: zod.object({
|
|
28017
|
-
address: zod.string().regex(listTradesResponseInfoAddressOneRegExp).describe(
|
|
28018
|
-
"Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n"
|
|
28019
|
-
).describe("Bech32 address of the orderer that owns this leg of the fill."),
|
|
28020
|
-
paid: zod.string().describe(
|
|
28021
|
-
'Atto-precision amount the orderer paid for this fill, suffixed\nwith the chain denom (e.g. `"1500000000000000000uusdt"`). Empty\nstring when the chain did not record this side.\n'
|
|
28022
|
-
),
|
|
28023
|
-
received: zod.string().describe(
|
|
28024
|
-
"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"
|
|
28025
|
-
),
|
|
28026
|
-
block_height: zod.string().regex(listTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
28027
|
-
event_index: zod.number().min(listTradesResponseInfoEventIndexMin).max(listTradesResponseInfoEventIndexMax).describe(
|
|
28028
|
-
"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"
|
|
28029
|
-
)
|
|
28030
|
-
}).describe(
|
|
28031
|
-
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
28032
|
-
)
|
|
28033
|
-
}).describe(
|
|
28034
|
-
"All numeric fields are canonical decimal strings \u2014 quantities at any\nmagnitude survive the JSON round-trip without rounding through\nfloat64. Consumers parse with their own bigdecimal.\n"
|
|
28035
|
-
);
|
|
27977
|
+
"id": zod.string(),
|
|
27978
|
+
"order": zod.string().nullish(),
|
|
27979
|
+
"timestamp": zod.number(),
|
|
27980
|
+
"datetime": zod.iso.datetime({}),
|
|
27981
|
+
"symbol": zod.string(),
|
|
27982
|
+
"type": zod.union([zod.literal("limit"), zod.literal("market"), zod.literal("twap"), zod.literal("unknown"), zod.literal(null)]).nullish().describe("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."),
|
|
27983
|
+
"cloid": zod.string().nullish().describe("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)."),
|
|
27984
|
+
"side": zod.enum(["buy", "sell"]),
|
|
27985
|
+
"takerOrMaker": zod.enum(["taker", "maker"]).optional().describe("Which leg of the match this fill is. Each match writes a maker leg and a taker leg; the public market feed returns only the maker leg so a market's trades aren't double-counted, while the per-orderer feed returns whichever leg belongs to that orderer."),
|
|
27986
|
+
"price": zod.string().regex(listTradesResponsePriceRegExp),
|
|
27987
|
+
"amount": zod.string().regex(listTradesResponseAmountRegExp),
|
|
27988
|
+
"cost": zod.string().regex(listTradesResponseCostRegExp).describe("price * amount"),
|
|
27989
|
+
"fee": zod.object({
|
|
27990
|
+
"cost": zod.string().regex(listTradesResponseFeeCostRegExp).optional().describe("Fee cost in `currency` units, decimal string."),
|
|
27991
|
+
"currency": zod.string().optional().describe('Ticker of the fee denom (e.g., "USDT", or "AULT" for a base-denom fee). The quote ticker for the rate-estimated fallback.'),
|
|
27992
|
+
"rate": zod.string().regex(listTradesResponseFeeRateRegExp).optional().describe("This leg's fee rate from the market, decimal string: the maker rate for the maker leg, the taker rate otherwise.")
|
|
27993
|
+
}).optional().describe("Fee charged on the fill. When the indexer recorded a realized fee, cost and currency report it verbatim; the currency follows the denom the filled leg received, which is the base asset on a taker buy, not always the quote. For rows that predate fee indexing, cost falls back to the estimate amount * price * rate in the quote currency, where rate is this leg's rate (maker_fee_rate for the maker leg, otherwise taker_fee_rate)."),
|
|
27994
|
+
"info": zod.object({
|
|
27995
|
+
"address": zod.string().regex(listTradesResponseInfoAddressOneRegExp).describe("Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n").describe("Bech32 address of the orderer that owns this leg of the fill."),
|
|
27996
|
+
"paid": zod.string().describe('Atto-precision amount the orderer paid for this fill, suffixed\nwith the chain denom (e.g. `"1500000000000000000uusdt"`). Empty\nstring when the chain did not record this side.\n'),
|
|
27997
|
+
"received": zod.string().describe("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"),
|
|
27998
|
+
"block_height": zod.string().regex(listTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
27999
|
+
"event_index": zod.number().min(listTradesResponseInfoEventIndexMin).max(listTradesResponseInfoEventIndexMax).describe("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")
|
|
28000
|
+
}).describe("Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n")
|
|
28001
|
+
}).describe("All numeric fields are canonical decimal strings \u2014 quantities at any\nmagnitude survive the JSON round-trip without rounding through\nfloat64. Consumers parse with their own bigdecimal.\n");
|
|
28036
28002
|
var ListTradesResponse = zod.array(ListTradesResponseItem);
|
|
28037
28003
|
var getTradePathIdMax = 114;
|
|
28038
|
-
var getTradePathIdRegExp = new RegExp(
|
|
28039
|
-
"^(0|[1-9][0-9]*)-[0-9a-f]{32}-(0|[1-9][0-9]*)(\\.[0-9]*[1-9])?$"
|
|
28040
|
-
);
|
|
28004
|
+
var getTradePathIdRegExp = new RegExp("^(0|[1-9][0-9]*)-[0-9a-f]{32}-(0|[1-9][0-9]*)(\\.[0-9]*[1-9])?$");
|
|
28041
28005
|
var GetTradeParams = zod.object({
|
|
28042
|
-
id: zod.string().max(getTradePathIdMax).regex(getTradePathIdRegExp).describe(
|
|
28043
|
-
"Synthesized trade id in the form\n`<block_height>-<hex(order_id)>-<open_quantity>`, taken verbatim from\na REST trade object's `id` field (not the WebSocket `tid`).\n"
|
|
28044
|
-
)
|
|
28006
|
+
"id": zod.string().max(getTradePathIdMax).regex(getTradePathIdRegExp).describe("Synthesized trade id in the form\n`<block_height>-<hex(order_id)>-<open_quantity>`, taken verbatim from\na REST trade object's `id` field (not the WebSocket `tid`).\n")
|
|
28045
28007
|
});
|
|
28046
28008
|
var getTradeResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28047
28009
|
var getTradeResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -28053,76 +28015,43 @@ var getTradeResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
|
28053
28015
|
var getTradeResponseInfoEventIndexMin = 0;
|
|
28054
28016
|
var getTradeResponseInfoEventIndexMax = 4294967295;
|
|
28055
28017
|
var GetTradeResponse = zod.object({
|
|
28056
|
-
id: zod.string(),
|
|
28057
|
-
order: zod.string().nullish(),
|
|
28058
|
-
timestamp: zod.number(),
|
|
28059
|
-
datetime: zod.iso.datetime({}),
|
|
28060
|
-
symbol: zod.string(),
|
|
28061
|
-
type: zod.union([
|
|
28062
|
-
|
|
28063
|
-
|
|
28064
|
-
|
|
28065
|
-
|
|
28066
|
-
|
|
28067
|
-
|
|
28068
|
-
|
|
28069
|
-
|
|
28070
|
-
|
|
28071
|
-
"
|
|
28072
|
-
),
|
|
28073
|
-
|
|
28074
|
-
|
|
28075
|
-
"
|
|
28076
|
-
|
|
28077
|
-
|
|
28078
|
-
|
|
28079
|
-
|
|
28080
|
-
|
|
28081
|
-
cost: zod.string().regex(getTradeResponseFeeCostRegExp).optional().describe("Fee cost in `currency` units, decimal string."),
|
|
28082
|
-
currency: zod.string().optional().describe(
|
|
28083
|
-
'Ticker of the fee denom (e.g., "USDT", or "AULT" for a base-denom fee). The quote ticker for the rate-estimated fallback.'
|
|
28084
|
-
),
|
|
28085
|
-
rate: zod.string().regex(getTradeResponseFeeRateRegExp).optional().describe(
|
|
28086
|
-
"This leg's fee rate from the market, decimal string: the maker rate for the maker leg, the taker rate otherwise."
|
|
28087
|
-
)
|
|
28088
|
-
}).optional().describe(
|
|
28089
|
-
"Fee charged on the fill. When the indexer recorded a realized fee, cost and currency report it verbatim; the currency follows the denom the filled leg received, which is the base asset on a taker buy, not always the quote. For rows that predate fee indexing, cost falls back to the estimate amount * price * rate in the quote currency, where rate is this leg's rate (maker_fee_rate for the maker leg, otherwise taker_fee_rate)."
|
|
28090
|
-
),
|
|
28091
|
-
info: zod.object({
|
|
28092
|
-
address: zod.string().regex(getTradeResponseInfoAddressOneRegExp).describe(
|
|
28093
|
-
"Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n"
|
|
28094
|
-
).describe("Bech32 address of the orderer that owns this leg of the fill."),
|
|
28095
|
-
paid: zod.string().describe(
|
|
28096
|
-
'Atto-precision amount the orderer paid for this fill, suffixed\nwith the chain denom (e.g. `"1500000000000000000uusdt"`). Empty\nstring when the chain did not record this side.\n'
|
|
28097
|
-
),
|
|
28098
|
-
received: zod.string().describe(
|
|
28099
|
-
"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"
|
|
28100
|
-
),
|
|
28101
|
-
block_height: zod.string().regex(getTradeResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
28102
|
-
event_index: zod.number().min(getTradeResponseInfoEventIndexMin).max(getTradeResponseInfoEventIndexMax).describe(
|
|
28103
|
-
"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"
|
|
28104
|
-
)
|
|
28105
|
-
}).describe(
|
|
28106
|
-
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
28107
|
-
)
|
|
28108
|
-
}).describe(
|
|
28109
|
-
"All numeric fields are canonical decimal strings \u2014 quantities at any\nmagnitude survive the JSON round-trip without rounding through\nfloat64. Consumers parse with their own bigdecimal.\n"
|
|
28110
|
-
);
|
|
28018
|
+
"id": zod.string(),
|
|
28019
|
+
"order": zod.string().nullish(),
|
|
28020
|
+
"timestamp": zod.number(),
|
|
28021
|
+
"datetime": zod.iso.datetime({}),
|
|
28022
|
+
"symbol": zod.string(),
|
|
28023
|
+
"type": zod.union([zod.literal("limit"), zod.literal("market"), zod.literal("twap"), zod.literal("unknown"), zod.literal(null)]).nullish().describe("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."),
|
|
28024
|
+
"cloid": zod.string().nullish().describe("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)."),
|
|
28025
|
+
"side": zod.enum(["buy", "sell"]),
|
|
28026
|
+
"takerOrMaker": zod.enum(["taker", "maker"]).optional().describe("Which leg of the match this fill is. Each match writes a maker leg and a taker leg; the public market feed returns only the maker leg so a market's trades aren't double-counted, while the per-orderer feed returns whichever leg belongs to that orderer."),
|
|
28027
|
+
"price": zod.string().regex(getTradeResponsePriceRegExp),
|
|
28028
|
+
"amount": zod.string().regex(getTradeResponseAmountRegExp),
|
|
28029
|
+
"cost": zod.string().regex(getTradeResponseCostRegExp).describe("price * amount"),
|
|
28030
|
+
"fee": zod.object({
|
|
28031
|
+
"cost": zod.string().regex(getTradeResponseFeeCostRegExp).optional().describe("Fee cost in `currency` units, decimal string."),
|
|
28032
|
+
"currency": zod.string().optional().describe('Ticker of the fee denom (e.g., "USDT", or "AULT" for a base-denom fee). The quote ticker for the rate-estimated fallback.'),
|
|
28033
|
+
"rate": zod.string().regex(getTradeResponseFeeRateRegExp).optional().describe("This leg's fee rate from the market, decimal string: the maker rate for the maker leg, the taker rate otherwise.")
|
|
28034
|
+
}).optional().describe("Fee charged on the fill. When the indexer recorded a realized fee, cost and currency report it verbatim; the currency follows the denom the filled leg received, which is the base asset on a taker buy, not always the quote. For rows that predate fee indexing, cost falls back to the estimate amount * price * rate in the quote currency, where rate is this leg's rate (maker_fee_rate for the maker leg, otherwise taker_fee_rate)."),
|
|
28035
|
+
"info": zod.object({
|
|
28036
|
+
"address": zod.string().regex(getTradeResponseInfoAddressOneRegExp).describe("Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n").describe("Bech32 address of the orderer that owns this leg of the fill."),
|
|
28037
|
+
"paid": zod.string().describe('Atto-precision amount the orderer paid for this fill, suffixed\nwith the chain denom (e.g. `"1500000000000000000uusdt"`). Empty\nstring when the chain did not record this side.\n'),
|
|
28038
|
+
"received": zod.string().describe("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"),
|
|
28039
|
+
"block_height": zod.string().regex(getTradeResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
28040
|
+
"event_index": zod.number().min(getTradeResponseInfoEventIndexMin).max(getTradeResponseInfoEventIndexMax).describe("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")
|
|
28041
|
+
}).describe("Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n")
|
|
28042
|
+
}).describe("All numeric fields are canonical decimal strings \u2014 quantities at any\nmagnitude survive the JSON round-trip without rounding through\nfloat64. Consumers parse with their own bigdecimal.\n");
|
|
28111
28043
|
var getTradingFeesResponseMakerRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28112
28044
|
var getTradingFeesResponseTakerRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28113
|
-
var GetTradingFeesResponse = zod.record(
|
|
28114
|
-
zod.string(),
|
|
28115
|
-
zod.
|
|
28116
|
-
|
|
28117
|
-
|
|
28118
|
-
|
|
28119
|
-
|
|
28120
|
-
|
|
28121
|
-
info: zod.looseObject({})
|
|
28122
|
-
})
|
|
28123
|
-
);
|
|
28045
|
+
var GetTradingFeesResponse = zod.record(zod.string(), zod.object({
|
|
28046
|
+
"symbol": zod.string(),
|
|
28047
|
+
"maker": zod.string().regex(getTradingFeesResponseMakerRegExp).describe("Maker fee rate as a canonical decimal string."),
|
|
28048
|
+
"taker": zod.string().regex(getTradingFeesResponseTakerRegExp).describe("Taker fee rate as a canonical decimal string."),
|
|
28049
|
+
"percentage": zod.boolean(),
|
|
28050
|
+
"tierBased": zod.boolean(),
|
|
28051
|
+
"info": zod.looseObject({})
|
|
28052
|
+
}));
|
|
28124
28053
|
var GetStatsQueryParams = zod.object({
|
|
28125
|
-
window: zod.enum(["24h", "7d", "30d", "all"]).optional().describe("Precomputed reporting window. Defaults to `24h`.")
|
|
28054
|
+
"window": zod.enum(["24h", "7d", "30d", "all"]).optional().describe("Precomputed reporting window. Defaults to `24h`.")
|
|
28126
28055
|
});
|
|
28127
28056
|
var getStatsResponseTotalsQuoteVolumeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28128
28057
|
var getStatsResponseTotalsEstimatedFeeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -28134,44 +28063,30 @@ var getStatsResponseMarketsItemBaseVolumeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$
|
|
|
28134
28063
|
var getStatsResponseMarketsItemEstimatedFeeRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28135
28064
|
var getStatsResponseMarketsItemTakerFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28136
28065
|
var GetStatsResponse = zod.object({
|
|
28137
|
-
window: zod.enum(["24h", "7d", "30d", "all"]),
|
|
28138
|
-
totals: zod.object({
|
|
28139
|
-
quoteVolume: zod.string().regex(getStatsResponseTotalsQuoteVolumeRegExp).nullable().describe(
|
|
28140
|
-
|
|
28141
|
-
),
|
|
28142
|
-
|
|
28143
|
-
|
|
28144
|
-
),
|
|
28145
|
-
|
|
28146
|
-
|
|
28147
|
-
),
|
|
28148
|
-
|
|
28149
|
-
traderCount: zod.number().describe("Distinct trading addresses in the window."),
|
|
28150
|
-
activeMarkets: zod.number().describe("Number of markets with at least one fill in the window."),
|
|
28151
|
-
dailyActiveUsers: zod.number().nullable().describe(
|
|
28152
|
-
"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"
|
|
28153
|
-
),
|
|
28154
|
-
averageSlippageBps: zod.string().regex(getStatsResponseTotalsAverageSlippageBpsRegExp).nullable().describe(
|
|
28155
|
-
"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"
|
|
28156
|
-
),
|
|
28157
|
-
depositUsdcVolume24h: zod.string().regex(getStatsResponseTotalsDepositUsdcVolume24hRegExp).nullable().describe("24h USDC deposit volume when available; null for longer windows."),
|
|
28158
|
-
builderCodesFee24h: zod.string().regex(getStatsResponseTotalsBuilderCodesFee24hRegExp).nullable().describe("Reserved. Currently always null.")
|
|
28066
|
+
"window": zod.enum(["24h", "7d", "30d", "all"]),
|
|
28067
|
+
"totals": zod.object({
|
|
28068
|
+
"quoteVolume": zod.string().regex(getStatsResponseTotalsQuoteVolumeRegExp).nullable().describe("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"),
|
|
28069
|
+
"quoteAsset": zod.string().nullable().describe('Shared quote ticker of the markets that had volume. Null when they\nspan more than one quote, or on an idle window (then `quoteVolume`\nis "0"; a null `quoteVolume` means multi-quote).\n'),
|
|
28070
|
+
"estimatedFee": zod.string().regex(getStatsResponseTotalsEstimatedFeeRegExp).nullable().describe("Estimated total fees (`\u03A3 quoteVolume \xD7 takerFeeRate`) as a decimal\nstring; an estimate, not booked revenue. Null on multi-quote.\n"),
|
|
28071
|
+
"tradeCount": zod.number().describe("Number of fills (maker legs) in the window."),
|
|
28072
|
+
"traderCount": zod.number().describe("Distinct trading addresses in the window."),
|
|
28073
|
+
"activeMarkets": zod.number().describe("Number of markets with at least one fill in the window."),
|
|
28074
|
+
"dailyActiveUsers": zod.number().nullable().describe("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"),
|
|
28075
|
+
"averageSlippageBps": zod.string().regex(getStatsResponseTotalsAverageSlippageBpsRegExp).nullable().describe("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"),
|
|
28076
|
+
"depositUsdcVolume24h": zod.string().regex(getStatsResponseTotalsDepositUsdcVolume24hRegExp).nullable().describe("24h USDC deposit volume when available; null for longer windows."),
|
|
28077
|
+
"builderCodesFee24h": zod.string().regex(getStatsResponseTotalsBuilderCodesFee24hRegExp).nullable().describe("Reserved. Currently always null.")
|
|
28159
28078
|
}).describe("Protocol-wide aggregates for the window."),
|
|
28160
|
-
markets: zod.array(
|
|
28161
|
-
zod.
|
|
28162
|
-
|
|
28163
|
-
|
|
28164
|
-
|
|
28165
|
-
|
|
28166
|
-
|
|
28167
|
-
|
|
28168
|
-
|
|
28169
|
-
|
|
28170
|
-
|
|
28171
|
-
)
|
|
28172
|
-
}).describe(
|
|
28173
|
-
"Protocol stats overview for a rolling window. Monetary fields are\ncanonical decimal strings; counts are integers.\n"
|
|
28174
|
-
);
|
|
28079
|
+
"markets": zod.array(zod.object({
|
|
28080
|
+
"symbol": zod.string(),
|
|
28081
|
+
"base": zod.string(),
|
|
28082
|
+
"quote": zod.string(),
|
|
28083
|
+
"quoteVolume": zod.string().regex(getStatsResponseMarketsItemQuoteVolumeRegExp),
|
|
28084
|
+
"baseVolume": zod.string().regex(getStatsResponseMarketsItemBaseVolumeRegExp),
|
|
28085
|
+
"estimatedFee": zod.string().regex(getStatsResponseMarketsItemEstimatedFeeRegExp),
|
|
28086
|
+
"tradeCount": zod.number(),
|
|
28087
|
+
"takerFeeRate": zod.string().regex(getStatsResponseMarketsItemTakerFeeRateRegExp)
|
|
28088
|
+
}).describe("Per-market aggregates for the window."))
|
|
28089
|
+
}).describe("Protocol stats overview for a rolling window. Monetary fields are\ncanonical decimal strings; counts are integers.\n");
|
|
28175
28090
|
var listOrdersQueryAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
28176
28091
|
var listOrdersQueryAddressTwoRegExp = new RegExp("^0x[a-f0-9]{40}$");
|
|
28177
28092
|
var listOrdersQueryMarketIdRegExp = new RegExp("^[0-9a-fA-F]+$");
|
|
@@ -28179,27 +28094,14 @@ var listOrdersQueryCloidRegExp = new RegExp("^([0-9a-fA-F]{16})?$");
|
|
|
28179
28094
|
var listOrdersQueryLimitDefault = 100;
|
|
28180
28095
|
var listOrdersQueryLimitMax = 500;
|
|
28181
28096
|
var ListOrdersQueryParams = zod.object({
|
|
28182
|
-
address: zod.union([
|
|
28183
|
-
|
|
28184
|
-
|
|
28185
|
-
|
|
28186
|
-
|
|
28187
|
-
|
|
28188
|
-
|
|
28189
|
-
|
|
28190
|
-
"Account address. Accepts either bech32 (`ault1...`) or 0x-hex\n(`0x...`) form; the API normalizes to the canonical bech32\nstored in the indexer before querying.\n"
|
|
28191
|
-
),
|
|
28192
|
-
status: zod.enum(["open", "closed", "canceled"]).optional(),
|
|
28193
|
-
symbol: zod.string().optional().describe("Symbol to filter by (e.g., AULT/USDT). Alternative to market_id."),
|
|
28194
|
-
market_id: zod.string().regex(listOrdersQueryMarketIdRegExp).optional().describe("Hex-encoded binary market ID to filter by. Takes precedence over symbol."),
|
|
28195
|
-
cloid: zod.string().regex(listOrdersQueryCloidRegExp).optional().describe(
|
|
28196
|
-
"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"
|
|
28197
|
-
),
|
|
28198
|
-
since: zod.number().optional().describe("Return orders created after this Unix timestamp (milliseconds)"),
|
|
28199
|
-
limit: zod.number().min(1).max(listOrdersQueryLimitMax).default(listOrdersQueryLimitDefault),
|
|
28200
|
-
cursor: zod.string().optional().describe(
|
|
28201
|
-
'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'
|
|
28202
|
-
)
|
|
28097
|
+
"address": zod.union([zod.string().regex(listOrdersQueryAddressOneRegExp).describe("Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n"), zod.string().regex(listOrdersQueryAddressTwoRegExp).describe("EVM hex form of the same 20-byte account address. Always\n`0x`-prefixed and lowercased; mixed-case bodies are rejected so a\nnon-checksummed and a checksummed copy of the same address never\ncompare unequal at the API boundary.\n")]).describe("Account address. Accepts either bech32 (`ault1...`) or 0x-hex\n(`0x...`) form; the API normalizes to the canonical bech32\nstored in the indexer before querying.\n"),
|
|
28098
|
+
"status": zod.enum(["open", "closed", "canceled"]).optional(),
|
|
28099
|
+
"symbol": zod.string().optional().describe("Symbol to filter by (e.g., AULT/USDT). Alternative to market_id."),
|
|
28100
|
+
"market_id": zod.string().regex(listOrdersQueryMarketIdRegExp).optional().describe("Hex-encoded binary market ID to filter by. Takes precedence over symbol."),
|
|
28101
|
+
"cloid": zod.string().regex(listOrdersQueryCloidRegExp).optional().describe("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"),
|
|
28102
|
+
"since": zod.number().optional().describe("Return orders created after this Unix timestamp (milliseconds)"),
|
|
28103
|
+
"limit": zod.number().min(1).max(listOrdersQueryLimitMax).default(listOrdersQueryLimitDefault),
|
|
28104
|
+
"cursor": zod.string().optional().describe('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')
|
|
28203
28105
|
});
|
|
28204
28106
|
var listOrdersResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28205
28107
|
var listOrdersResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -28210,77 +28112,60 @@ var listOrdersResponseFeeCostRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
|
28210
28112
|
var listOrdersResponseFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28211
28113
|
var listOrdersResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
28212
28114
|
var listOrdersResponseInfoRemainingDepositRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28115
|
+
var listOrdersResponseInfoTwapIdRegExp = new RegExp("^[0-9a-f]+$");
|
|
28116
|
+
var listOrdersResponseInfoTwapOneTotalDepositRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28117
|
+
var listOrdersResponseInfoTwapOnePriceToleranceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28118
|
+
var listOrdersResponseInfoTwapOneWorstPriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28213
28119
|
var ListOrdersResponseItem = zod.object({
|
|
28214
|
-
id: zod.string(),
|
|
28215
|
-
clientOrderId: zod.string().nullish().describe(
|
|
28216
|
-
|
|
28217
|
-
),
|
|
28218
|
-
|
|
28219
|
-
|
|
28220
|
-
|
|
28221
|
-
|
|
28222
|
-
|
|
28223
|
-
|
|
28224
|
-
|
|
28225
|
-
),
|
|
28226
|
-
|
|
28227
|
-
|
|
28228
|
-
),
|
|
28229
|
-
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
|
|
28234
|
-
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
),
|
|
28238
|
-
|
|
28239
|
-
|
|
28240
|
-
|
|
28241
|
-
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
"
|
|
28245
|
-
|
|
28246
|
-
|
|
28247
|
-
|
|
28248
|
-
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
"
|
|
28253
|
-
|
|
28254
|
-
|
|
28255
|
-
|
|
28256
|
-
"
|
|
28257
|
-
),
|
|
28258
|
-
|
|
28259
|
-
|
|
28260
|
-
"partially_filled",
|
|
28261
|
-
"filled",
|
|
28262
|
-
"cancelled",
|
|
28263
|
-
"expired",
|
|
28264
|
-
"triggered_pending",
|
|
28265
|
-
"unknown"
|
|
28266
|
-
]).describe(
|
|
28267
|
-
"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"
|
|
28268
|
-
),
|
|
28269
|
-
chain_type: zod.enum(["limit", "market", "twap", "unknown"]).describe(
|
|
28270
|
-
"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"
|
|
28271
|
-
),
|
|
28272
|
-
close_reason: zod.string().nullable().describe(
|
|
28273
|
-
"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"
|
|
28274
|
-
)
|
|
28275
|
-
}).describe(
|
|
28276
|
-
"Exchange-specific extension on `OrderResponse`. Mirrors the\n`info` map populated in `internal/domain/order/service.go`.\n"
|
|
28277
|
-
)
|
|
28278
|
-
}).describe(
|
|
28279
|
-
"All numeric fields (price, amount, filled, remaining, cost,\nfee.cost, fee.rate, average, triggerPrice, stopPrice) are canonical\ndecimal strings.\n"
|
|
28280
|
-
);
|
|
28120
|
+
"id": zod.string(),
|
|
28121
|
+
"clientOrderId": zod.string().nullish().describe("The order's cloid (client order id) as a hex string, or null when the order was placed without one."),
|
|
28122
|
+
"timestamp": zod.number(),
|
|
28123
|
+
"datetime": zod.iso.datetime({}),
|
|
28124
|
+
"lastTradeTimestamp": zod.number().nullish().describe("Timestamp (ms) of the last trade executed against this order. Null if no trades."),
|
|
28125
|
+
"status": zod.enum(["open", "closed", "canceled", "unknown"]).describe("`unknown` is the fallback for a chain status code the API doesn't recognize."),
|
|
28126
|
+
"symbol": zod.string(),
|
|
28127
|
+
"type": zod.enum(["limit", "market", "twap", "unknown"]).describe("`unknown` is the fallback for a chain type code the API doesn't recognize. A `twap` row (chain order_type=2) is either the TWAP parent the user placed (`info.twap` set) or one of its slice executions (`info.twap_id` set)."),
|
|
28128
|
+
"timeInForce": zod.union([zod.literal("ioc"), zod.literal(null)]).nullable().describe("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"),
|
|
28129
|
+
"side": zod.enum(["buy", "sell"]),
|
|
28130
|
+
"price": zod.string().regex(listOrdersResponsePriceRegExp),
|
|
28131
|
+
"average": zod.string().nullish().describe("Average execution price as decimal string. Null when filled is 0."),
|
|
28132
|
+
"amount": zod.string().regex(listOrdersResponseAmountRegExp),
|
|
28133
|
+
"filled": zod.string().regex(listOrdersResponseFilledRegExp),
|
|
28134
|
+
"remaining": zod.string().regex(listOrdersResponseRemainingRegExp),
|
|
28135
|
+
"cost": zod.string().regex(listOrdersResponseCostRegExp).describe('Quote-asset notional accumulated across all fills for this order.\n\nWhen the order has at least one indexed fill, the value is summed\nfrom the trades table (`SUM(filled_quantity * price)`) \u2014 it\nreflects the realized average across every level the order\nwalked, not `filled * price`. Until the indexer has caught up\nwith a freshly-matched fill, the value falls back to\n`filled * price` so consumers never see a misleading "0" while\nthe trade row is still in flight.\n'),
|
|
28136
|
+
"trades": zod.array(zod.looseObject({})).optional(),
|
|
28137
|
+
"fee": zod.object({
|
|
28138
|
+
"cost": zod.string().regex(listOrdersResponseFeeCostRegExp).optional().describe("Fee cost in quote currency, decimal string."),
|
|
28139
|
+
"currency": zod.string().optional().describe('Quote currency ticker (e.g., "USDT")'),
|
|
28140
|
+
"rate": zod.string().regex(listOrdersResponseFeeRateRegExp).optional().describe("Fee rate from the market, decimal string.")
|
|
28141
|
+
}).optional().describe("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"),
|
|
28142
|
+
"reduceOnly": zod.boolean().optional(),
|
|
28143
|
+
"postOnly": zod.boolean().optional(),
|
|
28144
|
+
"stopPrice": zod.string().nullish(),
|
|
28145
|
+
"triggerPrice": zod.string().nullish(),
|
|
28146
|
+
"info": zod.object({
|
|
28147
|
+
"block_height": zod.string().regex(listOrdersResponseInfoBlockHeightRegExp).describe("Height of the block that wrote the order. Decimal string for\nparity with the WS order `info.block_height`.\n"),
|
|
28148
|
+
"tx_index": zod.number().describe("Index of the order tx within its block."),
|
|
28149
|
+
"remaining_deposit": zod.string().regex(listOrdersResponseInfoRemainingDepositRegExp).describe("Remaining quote-asset escrow (raw decimal string at the chain's\natto-precision) that has not yet been spent on fills. On a TWAP\nparent: the unspent deposit (quote for a buy, base for a sell).\n"),
|
|
28150
|
+
"chain_status": zod.enum(["open", "partially_filled", "filled", "cancelled", "expired", "triggered_pending", "unknown"]).describe("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"),
|
|
28151
|
+
"chain_type": zod.enum(["limit", "market", "twap", "unknown"]).describe("Granular chain-level order type. Mirrors the dbindexer\n`orders.order_type` column (0=limit, 1=market, 2=twap). Both a\nTWAP parent and its slice executions surface as `twap`; tell\nthem apart by `twap` (set on the parent) and `twap_id` (set on\na slice). `unknown` is the fallback for a chain code the API\ndoesn't recognize.\n"),
|
|
28152
|
+
"close_reason": zod.string().nullable().describe("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"),
|
|
28153
|
+
"twap_id": zod.string().regex(listOrdersResponseInfoTwapIdRegExp).nullish().describe("Hex id of the TWAP parent a slice execution was attributed to;\nnull on parents, non-TWAP rows and unattributed slices.\n"),
|
|
28154
|
+
"twap": zod.union([zod.object({
|
|
28155
|
+
"total_deposit": zod.string().regex(listOrdersResponseInfoTwapOneTotalDepositRegExp).describe("Escrowed size in `deposit_asset` units (the `amount` of a sell, the quote budget of a buy)."),
|
|
28156
|
+
"deposit_asset": zod.enum(["base", "quote"]).describe("Base for a sell, quote for a buy."),
|
|
28157
|
+
"start_time": zod.number().nullable().describe("When the schedule started (ms)."),
|
|
28158
|
+
"deadline": zod.number().nullable().describe("When the schedule ends (ms)."),
|
|
28159
|
+
"num_slices": zod.number().describe("Slices the schedule was cut into."),
|
|
28160
|
+
"slice_index": zod.number().describe("Slices dispatched so far."),
|
|
28161
|
+
"price_tolerance": zod.string().regex(listOrdersResponseInfoTwapOnePriceToleranceRegExp).nullable().describe("Per-slice slippage bound as a ratio (`0.005` = 0.5%); null when `worst_price` is set or the chain default applied."),
|
|
28162
|
+
"worst_price": zod.string().regex(listOrdersResponseInfoTwapOneWorstPriceRegExp).nullable().describe("Absolute worst price per slice; null when a tolerance was used.")
|
|
28163
|
+
}).describe("Schedule of a TWAP parent. Amounts are human units; times are ms epoch."), zod.null()]).optional().describe("The schedule of a TWAP parent; null on every other row.")
|
|
28164
|
+
}).describe("Exchange-specific extension on `OrderResponse`. Mirrors the\n`info` map populated in `internal/domain/order/service.go`.\n")
|
|
28165
|
+
}).describe("All numeric fields (price, amount, filled, remaining, cost,\nfee.cost, fee.rate, average, triggerPrice, stopPrice) are canonical\ndecimal strings.\n");
|
|
28281
28166
|
var ListOrdersResponse = zod.array(ListOrdersResponseItem);
|
|
28282
28167
|
var GetOrderParams = zod.object({
|
|
28283
|
-
id: zod.string().describe("Hex-encoded order ID")
|
|
28168
|
+
"id": zod.string().describe("Hex-encoded order ID")
|
|
28284
28169
|
});
|
|
28285
28170
|
var getOrderResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28286
28171
|
var getOrderResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -28291,90 +28176,69 @@ var getOrderResponseFeeCostRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
|
28291
28176
|
var getOrderResponseFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28292
28177
|
var getOrderResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
28293
28178
|
var getOrderResponseInfoRemainingDepositRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28179
|
+
var getOrderResponseInfoTwapIdRegExp = new RegExp("^[0-9a-f]+$");
|
|
28180
|
+
var getOrderResponseInfoTwapOneTotalDepositRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28181
|
+
var getOrderResponseInfoTwapOnePriceToleranceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28182
|
+
var getOrderResponseInfoTwapOneWorstPriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28294
28183
|
var GetOrderResponse = zod.object({
|
|
28295
|
-
id: zod.string(),
|
|
28296
|
-
clientOrderId: zod.string().nullish().describe(
|
|
28297
|
-
|
|
28298
|
-
),
|
|
28299
|
-
|
|
28300
|
-
|
|
28301
|
-
|
|
28302
|
-
|
|
28303
|
-
|
|
28304
|
-
|
|
28305
|
-
|
|
28306
|
-
),
|
|
28307
|
-
|
|
28308
|
-
|
|
28309
|
-
),
|
|
28310
|
-
|
|
28311
|
-
|
|
28312
|
-
|
|
28313
|
-
|
|
28314
|
-
|
|
28315
|
-
|
|
28316
|
-
|
|
28317
|
-
|
|
28318
|
-
),
|
|
28319
|
-
|
|
28320
|
-
|
|
28321
|
-
|
|
28322
|
-
|
|
28323
|
-
|
|
28324
|
-
|
|
28325
|
-
"
|
|
28326
|
-
|
|
28327
|
-
|
|
28328
|
-
|
|
28329
|
-
|
|
28330
|
-
|
|
28331
|
-
|
|
28332
|
-
|
|
28333
|
-
"
|
|
28334
|
-
|
|
28335
|
-
|
|
28336
|
-
|
|
28337
|
-
"
|
|
28338
|
-
),
|
|
28339
|
-
|
|
28340
|
-
|
|
28341
|
-
"partially_filled",
|
|
28342
|
-
"filled",
|
|
28343
|
-
"cancelled",
|
|
28344
|
-
"expired",
|
|
28345
|
-
"triggered_pending",
|
|
28346
|
-
"unknown"
|
|
28347
|
-
]).describe(
|
|
28348
|
-
"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"
|
|
28349
|
-
),
|
|
28350
|
-
chain_type: zod.enum(["limit", "market", "twap", "unknown"]).describe(
|
|
28351
|
-
"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"
|
|
28352
|
-
),
|
|
28353
|
-
close_reason: zod.string().nullable().describe(
|
|
28354
|
-
"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"
|
|
28355
|
-
)
|
|
28356
|
-
}).describe(
|
|
28357
|
-
"Exchange-specific extension on `OrderResponse`. Mirrors the\n`info` map populated in `internal/domain/order/service.go`.\n"
|
|
28358
|
-
)
|
|
28359
|
-
}).describe(
|
|
28360
|
-
"All numeric fields (price, amount, filled, remaining, cost,\nfee.cost, fee.rate, average, triggerPrice, stopPrice) are canonical\ndecimal strings.\n"
|
|
28361
|
-
);
|
|
28184
|
+
"id": zod.string(),
|
|
28185
|
+
"clientOrderId": zod.string().nullish().describe("The order's cloid (client order id) as a hex string, or null when the order was placed without one."),
|
|
28186
|
+
"timestamp": zod.number(),
|
|
28187
|
+
"datetime": zod.iso.datetime({}),
|
|
28188
|
+
"lastTradeTimestamp": zod.number().nullish().describe("Timestamp (ms) of the last trade executed against this order. Null if no trades."),
|
|
28189
|
+
"status": zod.enum(["open", "closed", "canceled", "unknown"]).describe("`unknown` is the fallback for a chain status code the API doesn't recognize."),
|
|
28190
|
+
"symbol": zod.string(),
|
|
28191
|
+
"type": zod.enum(["limit", "market", "twap", "unknown"]).describe("`unknown` is the fallback for a chain type code the API doesn't recognize. A `twap` row (chain order_type=2) is either the TWAP parent the user placed (`info.twap` set) or one of its slice executions (`info.twap_id` set)."),
|
|
28192
|
+
"timeInForce": zod.union([zod.literal("ioc"), zod.literal(null)]).nullable().describe("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"),
|
|
28193
|
+
"side": zod.enum(["buy", "sell"]),
|
|
28194
|
+
"price": zod.string().regex(getOrderResponsePriceRegExp),
|
|
28195
|
+
"average": zod.string().nullish().describe("Average execution price as decimal string. Null when filled is 0."),
|
|
28196
|
+
"amount": zod.string().regex(getOrderResponseAmountRegExp),
|
|
28197
|
+
"filled": zod.string().regex(getOrderResponseFilledRegExp),
|
|
28198
|
+
"remaining": zod.string().regex(getOrderResponseRemainingRegExp),
|
|
28199
|
+
"cost": zod.string().regex(getOrderResponseCostRegExp).describe('Quote-asset notional accumulated across all fills for this order.\n\nWhen the order has at least one indexed fill, the value is summed\nfrom the trades table (`SUM(filled_quantity * price)`) \u2014 it\nreflects the realized average across every level the order\nwalked, not `filled * price`. Until the indexer has caught up\nwith a freshly-matched fill, the value falls back to\n`filled * price` so consumers never see a misleading "0" while\nthe trade row is still in flight.\n'),
|
|
28200
|
+
"trades": zod.array(zod.looseObject({})).optional(),
|
|
28201
|
+
"fee": zod.object({
|
|
28202
|
+
"cost": zod.string().regex(getOrderResponseFeeCostRegExp).optional().describe("Fee cost in quote currency, decimal string."),
|
|
28203
|
+
"currency": zod.string().optional().describe('Quote currency ticker (e.g., "USDT")'),
|
|
28204
|
+
"rate": zod.string().regex(getOrderResponseFeeRateRegExp).optional().describe("Fee rate from the market, decimal string.")
|
|
28205
|
+
}).optional().describe("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"),
|
|
28206
|
+
"reduceOnly": zod.boolean().optional(),
|
|
28207
|
+
"postOnly": zod.boolean().optional(),
|
|
28208
|
+
"stopPrice": zod.string().nullish(),
|
|
28209
|
+
"triggerPrice": zod.string().nullish(),
|
|
28210
|
+
"info": zod.object({
|
|
28211
|
+
"block_height": zod.string().regex(getOrderResponseInfoBlockHeightRegExp).describe("Height of the block that wrote the order. Decimal string for\nparity with the WS order `info.block_height`.\n"),
|
|
28212
|
+
"tx_index": zod.number().describe("Index of the order tx within its block."),
|
|
28213
|
+
"remaining_deposit": zod.string().regex(getOrderResponseInfoRemainingDepositRegExp).describe("Remaining quote-asset escrow (raw decimal string at the chain's\natto-precision) that has not yet been spent on fills. On a TWAP\nparent: the unspent deposit (quote for a buy, base for a sell).\n"),
|
|
28214
|
+
"chain_status": zod.enum(["open", "partially_filled", "filled", "cancelled", "expired", "triggered_pending", "unknown"]).describe("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"),
|
|
28215
|
+
"chain_type": zod.enum(["limit", "market", "twap", "unknown"]).describe("Granular chain-level order type. Mirrors the dbindexer\n`orders.order_type` column (0=limit, 1=market, 2=twap). Both a\nTWAP parent and its slice executions surface as `twap`; tell\nthem apart by `twap` (set on the parent) and `twap_id` (set on\na slice). `unknown` is the fallback for a chain code the API\ndoesn't recognize.\n"),
|
|
28216
|
+
"close_reason": zod.string().nullable().describe("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"),
|
|
28217
|
+
"twap_id": zod.string().regex(getOrderResponseInfoTwapIdRegExp).nullish().describe("Hex id of the TWAP parent a slice execution was attributed to;\nnull on parents, non-TWAP rows and unattributed slices.\n"),
|
|
28218
|
+
"twap": zod.union([zod.object({
|
|
28219
|
+
"total_deposit": zod.string().regex(getOrderResponseInfoTwapOneTotalDepositRegExp).describe("Escrowed size in `deposit_asset` units (the `amount` of a sell, the quote budget of a buy)."),
|
|
28220
|
+
"deposit_asset": zod.enum(["base", "quote"]).describe("Base for a sell, quote for a buy."),
|
|
28221
|
+
"start_time": zod.number().nullable().describe("When the schedule started (ms)."),
|
|
28222
|
+
"deadline": zod.number().nullable().describe("When the schedule ends (ms)."),
|
|
28223
|
+
"num_slices": zod.number().describe("Slices the schedule was cut into."),
|
|
28224
|
+
"slice_index": zod.number().describe("Slices dispatched so far."),
|
|
28225
|
+
"price_tolerance": zod.string().regex(getOrderResponseInfoTwapOnePriceToleranceRegExp).nullable().describe("Per-slice slippage bound as a ratio (`0.005` = 0.5%); null when `worst_price` is set or the chain default applied."),
|
|
28226
|
+
"worst_price": zod.string().regex(getOrderResponseInfoTwapOneWorstPriceRegExp).nullable().describe("Absolute worst price per slice; null when a tolerance was used.")
|
|
28227
|
+
}).describe("Schedule of a TWAP parent. Amounts are human units; times are ms epoch."), zod.null()]).optional().describe("The schedule of a TWAP parent; null on every other row.")
|
|
28228
|
+
}).describe("Exchange-specific extension on `OrderResponse`. Mirrors the\n`info` map populated in `internal/domain/order/service.go`.\n")
|
|
28229
|
+
}).describe("All numeric fields (price, amount, filled, remaining, cost,\nfee.cost, fee.rate, average, triggerPrice, stopPrice) are canonical\ndecimal strings.\n");
|
|
28362
28230
|
var listMyTradesQueryLimitDefault = 100;
|
|
28363
28231
|
var listMyTradesQueryLimitMax = 500;
|
|
28364
28232
|
var listMyTradesQueryBeforeIndexMin = 0;
|
|
28365
28233
|
var listMyTradesQueryBeforeIndexMax = 4294967295;
|
|
28366
28234
|
var ListMyTradesQueryParams = zod.object({
|
|
28367
|
-
address: zod.string().describe("Blockchain address of the trader"),
|
|
28368
|
-
symbol: zod.string().optional().describe("Symbol to filter by (e.g., AULT/USDT)"),
|
|
28369
|
-
since: zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
28370
|
-
limit: zod.number().min(1).max(listMyTradesQueryLimitMax).default(listMyTradesQueryLimitDefault),
|
|
28371
|
-
cursor: zod.string().optional().describe(
|
|
28372
|
-
|
|
28373
|
-
),
|
|
28374
|
-
before_height: zod.number().min(1).optional().describe(
|
|
28375
|
-
"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"
|
|
28376
|
-
),
|
|
28377
|
-
before_index: zod.number().min(listMyTradesQueryBeforeIndexMin).max(listMyTradesQueryBeforeIndexMax).optional().describe("Composite pagination cursor, lower half. See `before_height`.")
|
|
28235
|
+
"address": zod.string().describe("Blockchain address of the trader"),
|
|
28236
|
+
"symbol": zod.string().optional().describe("Symbol to filter by (e.g., AULT/USDT)"),
|
|
28237
|
+
"since": zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
28238
|
+
"limit": zod.number().min(1).max(listMyTradesQueryLimitMax).default(listMyTradesQueryLimitDefault),
|
|
28239
|
+
"cursor": zod.string().optional().describe('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'),
|
|
28240
|
+
"before_height": zod.number().min(1).optional().describe("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"),
|
|
28241
|
+
"before_index": zod.number().min(listMyTradesQueryBeforeIndexMin).max(listMyTradesQueryBeforeIndexMax).optional().describe("Composite pagination cursor, lower half. See `before_height`.")
|
|
28378
28242
|
});
|
|
28379
28243
|
var listMyTradesResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28380
28244
|
var listMyTradesResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
@@ -28386,93 +28250,57 @@ var listMyTradesResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
|
28386
28250
|
var listMyTradesResponseInfoEventIndexMin = 0;
|
|
28387
28251
|
var listMyTradesResponseInfoEventIndexMax = 4294967295;
|
|
28388
28252
|
var ListMyTradesResponseItem = zod.object({
|
|
28389
|
-
id: zod.string(),
|
|
28390
|
-
order: zod.string().nullish(),
|
|
28391
|
-
timestamp: zod.number(),
|
|
28392
|
-
datetime: zod.iso.datetime({}),
|
|
28393
|
-
symbol: zod.string(),
|
|
28394
|
-
type: zod.union([
|
|
28395
|
-
|
|
28396
|
-
|
|
28397
|
-
|
|
28398
|
-
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
|
|
28403
|
-
|
|
28404
|
-
"
|
|
28405
|
-
),
|
|
28406
|
-
|
|
28407
|
-
|
|
28408
|
-
"
|
|
28409
|
-
|
|
28410
|
-
|
|
28411
|
-
|
|
28412
|
-
|
|
28413
|
-
|
|
28414
|
-
cost: zod.string().regex(listMyTradesResponseFeeCostRegExp).optional().describe("Fee cost in `currency` units, decimal string."),
|
|
28415
|
-
currency: zod.string().optional().describe(
|
|
28416
|
-
'Ticker of the fee denom (e.g., "USDT", or "AULT" for a base-denom fee). The quote ticker for the rate-estimated fallback.'
|
|
28417
|
-
),
|
|
28418
|
-
rate: zod.string().regex(listMyTradesResponseFeeRateRegExp).optional().describe(
|
|
28419
|
-
"This leg's fee rate from the market, decimal string: the maker rate for the maker leg, the taker rate otherwise."
|
|
28420
|
-
)
|
|
28421
|
-
}).optional().describe(
|
|
28422
|
-
"Fee charged on the fill. When the indexer recorded a realized fee, cost and currency report it verbatim; the currency follows the denom the filled leg received, which is the base asset on a taker buy, not always the quote. For rows that predate fee indexing, cost falls back to the estimate amount * price * rate in the quote currency, where rate is this leg's rate (maker_fee_rate for the maker leg, otherwise taker_fee_rate)."
|
|
28423
|
-
),
|
|
28424
|
-
info: zod.object({
|
|
28425
|
-
address: zod.string().regex(listMyTradesResponseInfoAddressOneRegExp).describe(
|
|
28426
|
-
"Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n"
|
|
28427
|
-
).describe("Bech32 address of the orderer that owns this leg of the fill."),
|
|
28428
|
-
paid: zod.string().describe(
|
|
28429
|
-
'Atto-precision amount the orderer paid for this fill, suffixed\nwith the chain denom (e.g. `"1500000000000000000uusdt"`). Empty\nstring when the chain did not record this side.\n'
|
|
28430
|
-
),
|
|
28431
|
-
received: zod.string().describe(
|
|
28432
|
-
"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"
|
|
28433
|
-
),
|
|
28434
|
-
block_height: zod.string().regex(listMyTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
28435
|
-
event_index: zod.number().min(listMyTradesResponseInfoEventIndexMin).max(listMyTradesResponseInfoEventIndexMax).describe(
|
|
28436
|
-
"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"
|
|
28437
|
-
)
|
|
28438
|
-
}).describe(
|
|
28439
|
-
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
28440
|
-
)
|
|
28441
|
-
}).describe(
|
|
28442
|
-
"All numeric fields are canonical decimal strings \u2014 quantities at any\nmagnitude survive the JSON round-trip without rounding through\nfloat64. Consumers parse with their own bigdecimal.\n"
|
|
28443
|
-
);
|
|
28253
|
+
"id": zod.string(),
|
|
28254
|
+
"order": zod.string().nullish(),
|
|
28255
|
+
"timestamp": zod.number(),
|
|
28256
|
+
"datetime": zod.iso.datetime({}),
|
|
28257
|
+
"symbol": zod.string(),
|
|
28258
|
+
"type": zod.union([zod.literal("limit"), zod.literal("market"), zod.literal("twap"), zod.literal("unknown"), zod.literal(null)]).nullish().describe("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."),
|
|
28259
|
+
"cloid": zod.string().nullish().describe("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)."),
|
|
28260
|
+
"side": zod.enum(["buy", "sell"]),
|
|
28261
|
+
"takerOrMaker": zod.enum(["taker", "maker"]).optional().describe("Which leg of the match this fill is. Each match writes a maker leg and a taker leg; the public market feed returns only the maker leg so a market's trades aren't double-counted, while the per-orderer feed returns whichever leg belongs to that orderer."),
|
|
28262
|
+
"price": zod.string().regex(listMyTradesResponsePriceRegExp),
|
|
28263
|
+
"amount": zod.string().regex(listMyTradesResponseAmountRegExp),
|
|
28264
|
+
"cost": zod.string().regex(listMyTradesResponseCostRegExp).describe("price * amount"),
|
|
28265
|
+
"fee": zod.object({
|
|
28266
|
+
"cost": zod.string().regex(listMyTradesResponseFeeCostRegExp).optional().describe("Fee cost in `currency` units, decimal string."),
|
|
28267
|
+
"currency": zod.string().optional().describe('Ticker of the fee denom (e.g., "USDT", or "AULT" for a base-denom fee). The quote ticker for the rate-estimated fallback.'),
|
|
28268
|
+
"rate": zod.string().regex(listMyTradesResponseFeeRateRegExp).optional().describe("This leg's fee rate from the market, decimal string: the maker rate for the maker leg, the taker rate otherwise.")
|
|
28269
|
+
}).optional().describe("Fee charged on the fill. When the indexer recorded a realized fee, cost and currency report it verbatim; the currency follows the denom the filled leg received, which is the base asset on a taker buy, not always the quote. For rows that predate fee indexing, cost falls back to the estimate amount * price * rate in the quote currency, where rate is this leg's rate (maker_fee_rate for the maker leg, otherwise taker_fee_rate)."),
|
|
28270
|
+
"info": zod.object({
|
|
28271
|
+
"address": zod.string().regex(listMyTradesResponseInfoAddressOneRegExp).describe("Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n").describe("Bech32 address of the orderer that owns this leg of the fill."),
|
|
28272
|
+
"paid": zod.string().describe('Atto-precision amount the orderer paid for this fill, suffixed\nwith the chain denom (e.g. `"1500000000000000000uusdt"`). Empty\nstring when the chain did not record this side.\n'),
|
|
28273
|
+
"received": zod.string().describe("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"),
|
|
28274
|
+
"block_height": zod.string().regex(listMyTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
28275
|
+
"event_index": zod.number().min(listMyTradesResponseInfoEventIndexMin).max(listMyTradesResponseInfoEventIndexMax).describe("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")
|
|
28276
|
+
}).describe("Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n")
|
|
28277
|
+
}).describe("All numeric fields are canonical decimal strings \u2014 quantities at any\nmagnitude survive the JSON round-trip without rounding through\nfloat64. Consumers parse with their own bigdecimal.\n");
|
|
28444
28278
|
var ListMyTradesResponse = zod.array(ListMyTradesResponseItem);
|
|
28445
28279
|
var GetBalanceQueryParams = zod.object({
|
|
28446
|
-
address: zod.string()
|
|
28280
|
+
"address": zod.string()
|
|
28447
28281
|
});
|
|
28448
28282
|
var getBalanceResponseFreeRegExpOne = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28449
28283
|
var getBalanceResponseUsedRegExpOne = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28450
28284
|
var getBalanceResponseTotalRegExpOne = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
28451
28285
|
var GetBalanceResponse = zod.object({
|
|
28452
|
-
free: zod.record(zod.string(), zod.string().regex(getBalanceResponseFreeRegExpOne)),
|
|
28453
|
-
used: zod.record(zod.string(), zod.string().regex(getBalanceResponseUsedRegExpOne)),
|
|
28454
|
-
total: zod.record(zod.string(), zod.string().regex(getBalanceResponseTotalRegExpOne)),
|
|
28455
|
-
timestamp: zod.number().nullish(),
|
|
28456
|
-
datetime: zod.string().nullish(),
|
|
28457
|
-
info: zod.looseObject({})
|
|
28458
|
-
}).describe(
|
|
28459
|
-
"Balance object. Contains `free`, `used`, `total` dictionaries\n(currency code -> decimal string), plus per-currency entries with\n{free, used, total} as decimal strings, and `info`, `timestamp`,\n`datetime`. Strings preserve precision past 2^53 raw units.\n"
|
|
28460
|
-
);
|
|
28286
|
+
"free": zod.record(zod.string(), zod.string().regex(getBalanceResponseFreeRegExpOne)),
|
|
28287
|
+
"used": zod.record(zod.string(), zod.string().regex(getBalanceResponseUsedRegExpOne)),
|
|
28288
|
+
"total": zod.record(zod.string(), zod.string().regex(getBalanceResponseTotalRegExpOne)),
|
|
28289
|
+
"timestamp": zod.number().nullish(),
|
|
28290
|
+
"datetime": zod.string().nullish(),
|
|
28291
|
+
"info": zod.looseObject({})
|
|
28292
|
+
}).describe("Balance object. Contains `free`, `used`, `total` dictionaries\n(currency code -> decimal string), plus per-currency entries with\n{free, used, total} as decimal strings, and `info`, `timestamp`,\n`datetime`. Strings preserve precision past 2^53 raw units.\n");
|
|
28461
28293
|
var GetOHLCVParams = zod.object({
|
|
28462
|
-
symbol: zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
28294
|
+
"symbol": zod.string().describe("URL-encoded trading pair (e.g., `AULT%2FUSDT`)")
|
|
28463
28295
|
});
|
|
28464
28296
|
var getOHLCVQueryTimeframeDefault = `1m`;
|
|
28465
28297
|
var getOHLCVQueryLimitDefault = 500;
|
|
28466
28298
|
var getOHLCVQueryLimitMax = 1e3;
|
|
28467
28299
|
var GetOHLCVQueryParams = zod.object({
|
|
28468
|
-
timeframe: zod.string().default(getOHLCVQueryTimeframeDefault).describe("Timeframe: 1m, 5m, 15m, 30m, 1h, 4h, 1d. Also accepts TV format: 1, 5, 15, 60, 1D"),
|
|
28469
|
-
limit: zod.number().min(1).max(getOHLCVQueryLimitMax).default(getOHLCVQueryLimitDefault).describe(
|
|
28470
|
-
|
|
28471
|
-
)
|
|
28472
|
-
since: zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
28473
|
-
cursor: zod.string().optional().describe(
|
|
28474
|
-
'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'
|
|
28475
|
-
)
|
|
28300
|
+
"timeframe": zod.string().default(getOHLCVQueryTimeframeDefault).describe("Timeframe: 1m, 5m, 15m, 30m, 1h, 4h, 1d. Also accepts TV format: 1, 5, 15, 60, 1D"),
|
|
28301
|
+
"limit": zod.number().min(1).max(getOHLCVQueryLimitMax).default(getOHLCVQueryLimitDefault).describe("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"),
|
|
28302
|
+
"since": zod.number().optional().describe("Unix timestamp in milliseconds"),
|
|
28303
|
+
"cursor": zod.string().optional().describe('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')
|
|
28476
28304
|
});
|
|
28477
28305
|
var GetOHLCVResponseItem = zod.tuple([
|
|
28478
28306
|
zod.number().describe("timestamp in milliseconds"),
|
|
@@ -28482,142 +28310,134 @@ var GetOHLCVResponseItem = zod.tuple([
|
|
|
28482
28310
|
zod.string().describe("close price, decimal string"),
|
|
28483
28311
|
zod.string().describe("base-asset volume, decimal string"),
|
|
28484
28312
|
zod.string().describe("quote-asset volume, decimal string (approximation of `baseVolume * close`)")
|
|
28485
|
-
]).describe(
|
|
28486
|
-
"`[timestamp_ms, open, high, low, close, baseVolume, quoteVolume]`.\nTimestamp is a numeric ms epoch; the o/h/l/c/baseVolume/quoteVolume\nfields are canonical decimal strings so quantities at any magnitude\nsurvive the JSON round-trip. The trailing `quoteVolume` slot is\nderived as `baseVolume * close_price` until the chain indexer\nemits a realized `volume_quote` column. Both SDK clients\n(`ault-sdk-ts`, `ault-sdk-py`) consume the 7-tuple as the\ncanonical shape.\n(Patterns omitted on tuple items because orval generates broken\nregex references when `prefixItems` carry `pattern`; the format is\ndocumented in the descriptions.)\n"
|
|
28487
|
-
);
|
|
28313
|
+
]).describe("`[timestamp_ms, open, high, low, close, baseVolume, quoteVolume]`.\nTimestamp is a numeric ms epoch; the o/h/l/c/baseVolume/quoteVolume\nfields are canonical decimal strings so quantities at any magnitude\nsurvive the JSON round-trip. The trailing `quoteVolume` slot is\nderived as `baseVolume * close_price` until the chain indexer\nemits a realized `volume_quote` column. Both SDK clients\n(`ault-sdk-ts`, `ault-sdk-py`) consume the 7-tuple as the\ncanonical shape.\n(Patterns omitted on tuple items because orval generates broken\nregex references when `prefixItems` carry `pattern`; the format is\ndocumented in the descriptions.)\n");
|
|
28488
28314
|
var GetOHLCVResponse = zod.array(GetOHLCVResponseItem);
|
|
28489
28315
|
var GetUDFConfigResponse = zod.object({
|
|
28490
|
-
supports_search: zod.boolean(),
|
|
28491
|
-
supports_group_request: zod.boolean(),
|
|
28492
|
-
supports_marks: zod.boolean(),
|
|
28493
|
-
supports_timescale_marks: zod.boolean(),
|
|
28494
|
-
supports_time: zod.boolean(),
|
|
28495
|
-
supported_resolutions: zod.array(zod.string()),
|
|
28496
|
-
exchanges: zod.array(
|
|
28497
|
-
zod.
|
|
28498
|
-
|
|
28499
|
-
|
|
28500
|
-
|
|
28501
|
-
|
|
28502
|
-
|
|
28503
|
-
|
|
28504
|
-
|
|
28505
|
-
name: zod.string(),
|
|
28506
|
-
value: zod.string()
|
|
28507
|
-
})
|
|
28508
|
-
)
|
|
28316
|
+
"supports_search": zod.boolean(),
|
|
28317
|
+
"supports_group_request": zod.boolean(),
|
|
28318
|
+
"supports_marks": zod.boolean(),
|
|
28319
|
+
"supports_timescale_marks": zod.boolean(),
|
|
28320
|
+
"supports_time": zod.boolean(),
|
|
28321
|
+
"supported_resolutions": zod.array(zod.string()),
|
|
28322
|
+
"exchanges": zod.array(zod.object({
|
|
28323
|
+
"value": zod.string(),
|
|
28324
|
+
"name": zod.string(),
|
|
28325
|
+
"desc": zod.string()
|
|
28326
|
+
})),
|
|
28327
|
+
"symbols_types": zod.array(zod.object({
|
|
28328
|
+
"name": zod.string(),
|
|
28329
|
+
"value": zod.string()
|
|
28330
|
+
}))
|
|
28509
28331
|
});
|
|
28510
28332
|
var GetUDFSymbolQueryParams = zod.object({
|
|
28511
|
-
symbol: zod.string()
|
|
28333
|
+
"symbol": zod.string()
|
|
28512
28334
|
});
|
|
28513
28335
|
var GetUDFSymbolResponse = zod.object({
|
|
28514
|
-
name: zod.string(),
|
|
28515
|
-
ticker: zod.string(),
|
|
28516
|
-
description: zod.string(),
|
|
28517
|
-
type: zod.string(),
|
|
28518
|
-
session: zod.string(),
|
|
28519
|
-
exchange: zod.string(),
|
|
28520
|
-
listed_exchange: zod.string(),
|
|
28521
|
-
timezone: zod.string(),
|
|
28522
|
-
minmov: zod.number(),
|
|
28523
|
-
pricescale: zod.number(),
|
|
28524
|
-
has_intraday: zod.boolean(),
|
|
28525
|
-
has_daily: zod.boolean(),
|
|
28526
|
-
has_no_volume: zod.boolean().describe("Whether the symbol has volume data"),
|
|
28527
|
-
volume_precision: zod.number().describe("Number of decimal places for volume"),
|
|
28528
|
-
data_status: zod.enum(["streaming", "endofday", "pulsed", "delayed_streaming"]).describe("Data feed status"),
|
|
28529
|
-
currency_code: zod.string().describe("Quote currency code"),
|
|
28530
|
-
supported_resolutions: zod.array(zod.string())
|
|
28336
|
+
"name": zod.string(),
|
|
28337
|
+
"ticker": zod.string(),
|
|
28338
|
+
"description": zod.string(),
|
|
28339
|
+
"type": zod.string(),
|
|
28340
|
+
"session": zod.string(),
|
|
28341
|
+
"exchange": zod.string(),
|
|
28342
|
+
"listed_exchange": zod.string(),
|
|
28343
|
+
"timezone": zod.string(),
|
|
28344
|
+
"minmov": zod.number(),
|
|
28345
|
+
"pricescale": zod.number(),
|
|
28346
|
+
"has_intraday": zod.boolean(),
|
|
28347
|
+
"has_daily": zod.boolean(),
|
|
28348
|
+
"has_no_volume": zod.boolean().describe("Whether the symbol has volume data"),
|
|
28349
|
+
"volume_precision": zod.number().describe("Number of decimal places for volume"),
|
|
28350
|
+
"data_status": zod.enum(["streaming", "endofday", "pulsed", "delayed_streaming"]).describe("Data feed status"),
|
|
28351
|
+
"currency_code": zod.string().describe("Quote currency code"),
|
|
28352
|
+
"supported_resolutions": zod.array(zod.string())
|
|
28531
28353
|
});
|
|
28532
28354
|
var SearchUDFSymbolsQueryParams = zod.object({
|
|
28533
|
-
query: zod.string().optional().describe("Text typed by the user in the search box"),
|
|
28534
|
-
type: zod.string().optional().describe("Symbol type filter"),
|
|
28535
|
-
exchange: zod.string().optional().describe("Exchange filter"),
|
|
28536
|
-
limit: zod.number().min(1).optional().describe("Maximum number of results (default 30)")
|
|
28355
|
+
"query": zod.string().optional().describe("Text typed by the user in the search box"),
|
|
28356
|
+
"type": zod.string().optional().describe("Symbol type filter"),
|
|
28357
|
+
"exchange": zod.string().optional().describe("Exchange filter"),
|
|
28358
|
+
"limit": zod.number().min(1).optional().describe("Maximum number of results (default 30)")
|
|
28537
28359
|
});
|
|
28538
28360
|
var SearchUDFSymbolsResponseItem = zod.object({
|
|
28539
|
-
symbol: zod.string(),
|
|
28540
|
-
full_name: zod.string(),
|
|
28541
|
-
description: zod.string(),
|
|
28542
|
-
exchange: zod.string(),
|
|
28543
|
-
ticker: zod.string(),
|
|
28544
|
-
type: zod.string()
|
|
28361
|
+
"symbol": zod.string(),
|
|
28362
|
+
"full_name": zod.string(),
|
|
28363
|
+
"description": zod.string(),
|
|
28364
|
+
"exchange": zod.string(),
|
|
28365
|
+
"ticker": zod.string(),
|
|
28366
|
+
"type": zod.string()
|
|
28545
28367
|
});
|
|
28546
28368
|
var SearchUDFSymbolsResponse = zod.array(SearchUDFSymbolsResponseItem);
|
|
28547
28369
|
var getUDFHistoryQueryCountbackMax = 1e3;
|
|
28548
28370
|
var GetUDFHistoryQueryParams = zod.object({
|
|
28549
|
-
symbol: zod.string(),
|
|
28550
|
-
resolution: zod.enum(["1", "5", "15", "30", "60", "1D", "1W", "1M"]),
|
|
28551
|
-
from: zod.number().describe("Unix seconds"),
|
|
28552
|
-
to: zod.number().describe("Unix seconds"),
|
|
28553
|
-
countback: zod.number().min(1).max(getUDFHistoryQueryCountbackMax).optional().describe("Values above 1000 are clamped to 1000 server-side.")
|
|
28371
|
+
"symbol": zod.string(),
|
|
28372
|
+
"resolution": zod.enum(["1", "5", "15", "30", "60", "1D", "1W", "1M"]),
|
|
28373
|
+
"from": zod.number().describe("Unix seconds"),
|
|
28374
|
+
"to": zod.number().describe("Unix seconds"),
|
|
28375
|
+
"countback": zod.number().min(1).max(getUDFHistoryQueryCountbackMax).optional().describe("Values above 1000 are clamped to 1000 server-side.")
|
|
28554
28376
|
});
|
|
28555
28377
|
var GetUDFHistoryResponse = zod.object({
|
|
28556
|
-
s: zod.enum(["ok", "no_data", "error"]),
|
|
28557
|
-
errmsg: zod.string().optional().describe('Error message (present only when s = "error")'),
|
|
28558
|
-
t: zod.array(zod.number()).optional(),
|
|
28559
|
-
o: zod.array(zod.number()).optional(),
|
|
28560
|
-
h: zod.array(zod.number()).optional(),
|
|
28561
|
-
l: zod.array(zod.number()).optional(),
|
|
28562
|
-
c: zod.array(zod.number()).optional(),
|
|
28563
|
-
v: zod.array(zod.number()).optional(),
|
|
28564
|
-
nextTime: zod.number().optional().describe('Unix seconds of next available bar (when s = "no_data")')
|
|
28378
|
+
"s": zod.enum(["ok", "no_data", "error"]),
|
|
28379
|
+
"errmsg": zod.string().optional().describe('Error message (present only when s = "error")'),
|
|
28380
|
+
"t": zod.array(zod.number()).optional(),
|
|
28381
|
+
"o": zod.array(zod.number()).optional(),
|
|
28382
|
+
"h": zod.array(zod.number()).optional(),
|
|
28383
|
+
"l": zod.array(zod.number()).optional(),
|
|
28384
|
+
"c": zod.array(zod.number()).optional(),
|
|
28385
|
+
"v": zod.array(zod.number()).optional(),
|
|
28386
|
+
"nextTime": zod.number().optional().describe('Unix seconds of next available bar (when s = "no_data")')
|
|
28565
28387
|
});
|
|
28566
28388
|
var GetUDFQuotesQueryParams = zod.object({
|
|
28567
|
-
symbols: zod.string().describe("Comma-separated list of symbols, at most 100 (400 above that)")
|
|
28389
|
+
"symbols": zod.string().describe("Comma-separated list of symbols, at most 100 (400 above that)")
|
|
28568
28390
|
});
|
|
28569
28391
|
var GetUDFQuotesResponse = zod.object({
|
|
28570
|
-
s: zod.enum(["ok", "error"]),
|
|
28571
|
-
errmsg: zod.string().optional(),
|
|
28572
|
-
d: zod.array(
|
|
28573
|
-
zod.
|
|
28574
|
-
|
|
28575
|
-
|
|
28576
|
-
|
|
28577
|
-
|
|
28578
|
-
|
|
28579
|
-
|
|
28580
|
-
|
|
28581
|
-
|
|
28582
|
-
|
|
28583
|
-
|
|
28584
|
-
|
|
28585
|
-
|
|
28586
|
-
|
|
28587
|
-
|
|
28588
|
-
|
|
28589
|
-
volume: zod.number().nullish()
|
|
28590
|
-
})
|
|
28392
|
+
"s": zod.enum(["ok", "error"]),
|
|
28393
|
+
"errmsg": zod.string().optional(),
|
|
28394
|
+
"d": zod.array(zod.object({
|
|
28395
|
+
"s": zod.enum(["ok", "error"]).describe("Per-symbol status"),
|
|
28396
|
+
"n": zod.string().describe("Full symbol name"),
|
|
28397
|
+
"v": zod.object({
|
|
28398
|
+
"ch": zod.number().nullish().describe("Price change"),
|
|
28399
|
+
"chp": zod.number().nullish().describe("Change percentage"),
|
|
28400
|
+
"short_name": zod.string().optional(),
|
|
28401
|
+
"exchange": zod.string().optional(),
|
|
28402
|
+
"description": zod.string().optional(),
|
|
28403
|
+
"lp": zod.number().nullish().describe("Last price"),
|
|
28404
|
+
"ask": zod.number().nullish(),
|
|
28405
|
+
"bid": zod.number().nullish(),
|
|
28406
|
+
"open_price": zod.number().nullish(),
|
|
28407
|
+
"high_price": zod.number().nullish(),
|
|
28408
|
+
"low_price": zod.number().nullish(),
|
|
28409
|
+
"prev_close_price": zod.number().nullish(),
|
|
28410
|
+
"volume": zod.number().nullish()
|
|
28591
28411
|
})
|
|
28592
|
-
)
|
|
28412
|
+
}))
|
|
28593
28413
|
});
|
|
28594
28414
|
var GetUDFMarksQueryParams = zod.object({
|
|
28595
|
-
symbol: zod.string(),
|
|
28596
|
-
from: zod.number().describe("Left boundary of the visible range (Unix seconds)"),
|
|
28597
|
-
to: zod.number().describe("Right boundary of the visible range (Unix seconds)"),
|
|
28598
|
-
resolution: zod.string().optional().describe("Bar resolution (e.g. 1, 5, 15, 30, 60, 1D, 1W, 1M)")
|
|
28415
|
+
"symbol": zod.string(),
|
|
28416
|
+
"from": zod.number().describe("Left boundary of the visible range (Unix seconds)"),
|
|
28417
|
+
"to": zod.number().describe("Right boundary of the visible range (Unix seconds)"),
|
|
28418
|
+
"resolution": zod.string().optional().describe("Bar resolution (e.g. 1, 5, 15, 30, 60, 1D, 1W, 1M)")
|
|
28599
28419
|
});
|
|
28600
28420
|
var GetUDFMarksResponse = zod.object({
|
|
28601
|
-
id: zod.array(zod.number()),
|
|
28602
|
-
time: zod.array(zod.number()),
|
|
28603
|
-
color: zod.array(zod.string()),
|
|
28604
|
-
text: zod.array(zod.string()),
|
|
28605
|
-
label: zod.array(zod.string()),
|
|
28606
|
-
labelFontColor: zod.array(zod.string()),
|
|
28607
|
-
minSize: zod.array(zod.number())
|
|
28421
|
+
"id": zod.array(zod.number()),
|
|
28422
|
+
"time": zod.array(zod.number()),
|
|
28423
|
+
"color": zod.array(zod.string()),
|
|
28424
|
+
"text": zod.array(zod.string()),
|
|
28425
|
+
"label": zod.array(zod.string()),
|
|
28426
|
+
"labelFontColor": zod.array(zod.string()),
|
|
28427
|
+
"minSize": zod.array(zod.number())
|
|
28608
28428
|
});
|
|
28609
28429
|
var GetUDFTimescaleMarksQueryParams = zod.object({
|
|
28610
|
-
symbol: zod.string(),
|
|
28611
|
-
from: zod.number().describe("Left boundary of the visible range (Unix seconds)"),
|
|
28612
|
-
to: zod.number().describe("Right boundary of the visible range (Unix seconds)"),
|
|
28613
|
-
resolution: zod.string().optional().describe("Bar resolution (e.g. 1, 5, 15, 30, 60, 1D, 1W, 1M)")
|
|
28430
|
+
"symbol": zod.string(),
|
|
28431
|
+
"from": zod.number().describe("Left boundary of the visible range (Unix seconds)"),
|
|
28432
|
+
"to": zod.number().describe("Right boundary of the visible range (Unix seconds)"),
|
|
28433
|
+
"resolution": zod.string().optional().describe("Bar resolution (e.g. 1, 5, 15, 30, 60, 1D, 1W, 1M)")
|
|
28614
28434
|
});
|
|
28615
28435
|
var GetUDFTimescaleMarksResponseItem = zod.object({
|
|
28616
|
-
id: zod.number(),
|
|
28617
|
-
time: zod.number(),
|
|
28618
|
-
color: zod.string(),
|
|
28619
|
-
label: zod.string().describe("Single character displayed in a circle"),
|
|
28620
|
-
tooltip: zod.string()
|
|
28436
|
+
"id": zod.number(),
|
|
28437
|
+
"time": zod.number(),
|
|
28438
|
+
"color": zod.string(),
|
|
28439
|
+
"label": zod.string().describe("Single character displayed in a circle"),
|
|
28440
|
+
"tooltip": zod.string()
|
|
28621
28441
|
});
|
|
28622
28442
|
var GetUDFTimescaleMarksResponse = zod.array(GetUDFTimescaleMarksResponseItem);
|
|
28623
28443
|
|
|
@@ -28625,9 +28445,6 @@ var GetUDFTimescaleMarksResponse = zod.array(GetUDFTimescaleMarksResponseItem);
|
|
|
28625
28445
|
function createDexWs(url, options) {
|
|
28626
28446
|
return new DexWsClient(url, options);
|
|
28627
28447
|
}
|
|
28628
|
-
|
|
28629
|
-
// src/index.ts
|
|
28630
|
-
var SDK_VERSION = "0.7.1";
|
|
28631
28448
|
export {
|
|
28632
28449
|
AGENT_DEFAULTS,
|
|
28633
28450
|
AULT_SIGNER_MARKER,
|
|
@@ -28724,6 +28541,7 @@ export {
|
|
|
28724
28541
|
TxError,
|
|
28725
28542
|
TxNotConfirmedError,
|
|
28726
28543
|
TxSimulationError,
|
|
28544
|
+
USER_AGENT,
|
|
28727
28545
|
BondStatus as ValidatorStatus,
|
|
28728
28546
|
WebSocketError,
|
|
28729
28547
|
WithdrawRewardsPartialError,
|
|
@@ -28812,6 +28630,10 @@ export {
|
|
|
28812
28630
|
getOrderResponseFilledRegExp,
|
|
28813
28631
|
getOrderResponseInfoBlockHeightRegExp,
|
|
28814
28632
|
getOrderResponseInfoRemainingDepositRegExp,
|
|
28633
|
+
getOrderResponseInfoTwapIdRegExp,
|
|
28634
|
+
getOrderResponseInfoTwapOnePriceToleranceRegExp,
|
|
28635
|
+
getOrderResponseInfoTwapOneTotalDepositRegExp,
|
|
28636
|
+
getOrderResponseInfoTwapOneWorstPriceRegExp,
|
|
28815
28637
|
getOrderResponsePriceRegExp,
|
|
28816
28638
|
getOrderResponseRemainingRegExp,
|
|
28817
28639
|
getOrderbookQueryLimitDefault,
|
|
@@ -28880,6 +28702,10 @@ export {
|
|
|
28880
28702
|
listOrdersResponseFilledRegExp,
|
|
28881
28703
|
listOrdersResponseInfoBlockHeightRegExp,
|
|
28882
28704
|
listOrdersResponseInfoRemainingDepositRegExp,
|
|
28705
|
+
listOrdersResponseInfoTwapIdRegExp,
|
|
28706
|
+
listOrdersResponseInfoTwapOnePriceToleranceRegExp,
|
|
28707
|
+
listOrdersResponseInfoTwapOneTotalDepositRegExp,
|
|
28708
|
+
listOrdersResponseInfoTwapOneWorstPriceRegExp,
|
|
28883
28709
|
listOrdersResponsePriceRegExp,
|
|
28884
28710
|
listOrdersResponseRemainingRegExp,
|
|
28885
28711
|
listTradesQueryBeforeIndexMax,
|