ault-sdk-ts 0.0.2-alpha.8 → 0.3.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 +378 -50
- package/dist/agent/attach.d.ts +26 -0
- package/dist/agent/sign-and-broadcast.d.ts +9 -2
- package/dist/agent/tx/clob.d.ts +8 -1
- package/dist/agent/tx-executor.d.ts +24 -2
- package/dist/client.d.ts +6 -7
- package/dist/core/clob-gas.d.ts +28 -0
- package/dist/core/clob-msgs.d.ts +31 -5
- package/dist/core/clob-responses.d.ts +20 -0
- package/dist/core/cloid.d.ts +4 -0
- package/dist/core/errors.d.ts +79 -0
- package/dist/core/manifest-fetcher.d.ts +12 -0
- package/dist/core/manifest-resolver.d.ts +131 -0
- package/dist/core/manifest-types.d.ts +104 -0
- package/dist/core/network.d.ts +42 -13
- package/dist/eip712/msg.generated.d.ts +26 -10
- package/dist/eip712/registry.d.ts +2 -0
- package/dist/eip712/sign-and-broadcast.d.ts +27 -3
- package/dist/high-level/cloid-lookup.d.ts +9 -0
- package/dist/high-level/create-client.d.ts +15 -11
- package/dist/high-level/tx/accountx.d.ts +3 -0
- package/dist/high-level/tx/agent.d.ts +1 -1
- package/dist/high-level/tx/clob.d.ts +1 -1
- package/dist/high-level/tx/context.d.ts +8 -0
- package/dist/high-level/tx/license.d.ts +1 -1
- package/dist/high-level/tx/miner.d.ts +1 -1
- package/dist/high-level/tx/reward.d.ts +1 -1
- package/dist/high-level/tx/staking.d.ts +1 -1
- package/dist/high-level/tx-executor.d.ts +23 -3
- package/dist/high-level/types.d.ts +356 -100
- package/dist/high-level-client.d.ts +1 -1
- package/dist/index.cjs +15590 -7271
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +15699 -7405
- package/dist/index.js.map +1 -1
- package/dist/proto/gen/ault/accountx/v1/genesis.d.ts +38 -0
- package/dist/proto/gen/ault/accountx/v1/params.d.ts +32 -0
- package/dist/proto/gen/ault/accountx/v1/query.d.ts +88 -0
- package/dist/proto/gen/ault/accountx/v1/tx.d.ts +52 -0
- package/dist/proto/gen/ault/agent/v1/tx.d.ts +4 -5
- package/dist/proto/gen/ault/authority/v1/authority.d.ts +2 -0
- package/dist/proto/gen/ault/clob/v1/genesis.d.ts +6 -5
- package/dist/proto/gen/ault/clob/v1/query.d.ts +14 -0
- package/dist/proto/gen/ault/clob/v1/tx.d.ts +30 -3
- package/dist/proto/gen/ault/common/v1/system.d.ts +31 -0
- package/dist/proto/gen/ault/license/v1/genesis.d.ts +1 -26
- package/dist/proto/gen/ault/license/v1/license.d.ts +0 -26
- package/dist/proto/gen/ault/license/v1/query.d.ts +44 -18
- package/dist/proto/gen/ault/market/v1/market.d.ts +1 -0
- package/dist/proto/gen/ault/market/v1/tx.d.ts +9 -0
- package/dist/proto/gen/ault/miner/v1/genesis.d.ts +52 -84
- package/dist/proto/gen/ault/miner/v1/miner.d.ts +10 -45
- package/dist/proto/gen/ault/miner/v1/query.d.ts +0 -13
- package/dist/proto/gen/ault/spot/v1/genesis.d.ts +2 -2
- package/dist/proto/gen/ault/spot/v1/order.d.ts +12 -4
- package/dist/proto/gen/ault/systemtx/v1/genesis.d.ts +37 -0
- package/dist/proto/gen/ault/tokenregistry/v1/genesis.d.ts +3 -3
- package/dist/proto/gen/ault/tokenregistry/v1/query.d.ts +2 -2
- package/dist/proto/gen/ault/tokenregistry/v1/tokenregistry.d.ts +24 -15
- package/dist/proto/gen/ault/tokenregistry/v1/tx.d.ts +1 -16
- package/dist/proto/gen/cosmos/bank/v1beta1/bank.d.ts +119 -0
- package/dist/proto/gen/cosmos/bank/v1beta1/query.d.ts +264 -0
- package/dist/proto/gen/cosmos/distribution/v1beta1/query.d.ts +203 -0
- package/dist/proto/gen/cosmos/query/v1/query.d.ts +1 -0
- package/dist/proto/gen/cosmos/staking/v1beta1/query.d.ts +275 -0
- package/dist/proto/gen/google/api/http.d.ts +20 -28
- package/dist/proto/gen/tendermint/abci/types.d.ts +23 -0
- package/dist/proto/tx-decode.d.ts +18 -0
- package/dist/rest/accountx.d.ts +8 -0
- package/dist/rest/bank.d.ts +15 -0
- package/dist/rest/clob.d.ts +9 -1
- package/dist/rest/context.d.ts +4 -4
- package/dist/rest/dex-types.generated.d.ts +434 -120
- package/dist/rest/dex.d.ts +7 -0
- package/dist/rest/dex.generated.d.ts +657 -83
- package/dist/rest/feemarket.d.ts +114 -0
- package/dist/rest/license.d.ts +21 -59
- package/dist/rest/miner.d.ts +16 -46
- package/dist/rest/portfolio.d.ts +103 -0
- package/dist/rest/staking.d.ts +14 -28
- package/dist/rest/tokenregistry.d.ts +3 -1
- package/dist/rest/types.d.ts +82 -858
- package/dist/utils/address.d.ts +2 -0
- package/dist/utils/opaque-id.d.ts +25 -0
- package/dist/utils/tx-hash.d.ts +1 -0
- package/dist/ws/client.d.ts +45 -5
- package/dist/ws/types.d.ts +379 -34
- package/package.json +2 -1
- package/dist/agent/create-agent-client.d.ts +0 -3
|
@@ -1,3 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cosmos bech32 account address. The HRP is fixed to `ault` for
|
|
3
|
+
accounts (validators use `aultvaloper`, which this schema rejects).
|
|
4
|
+
Lowercased and checksum-verified by the API; mixed-case bech32 is
|
|
5
|
+
rejected to avoid silent EIP-55-style ambiguity.
|
|
6
|
+
|
|
7
|
+
* @pattern ^ault1[a-z0-9]{38,}$
|
|
8
|
+
*/
|
|
9
|
+
export type AddressBech32 = string;
|
|
10
|
+
/**
|
|
11
|
+
* EVM hex form of the same 20-byte account address. Always
|
|
12
|
+
`0x`-prefixed and lowercased; mixed-case bodies are rejected so a
|
|
13
|
+
non-checksummed and a checksummed copy of the same address never
|
|
14
|
+
compare unequal at the API boundary.
|
|
15
|
+
|
|
16
|
+
* @pattern ^0x[a-f0-9]{40}$
|
|
17
|
+
*/
|
|
18
|
+
export type AddressHex = string;
|
|
19
|
+
/**
|
|
20
|
+
* Granular chain-level status — the WS view exposes the same
|
|
21
|
+
string. The CCXT view at `OrderResponse.status` collapses these
|
|
22
|
+
into open | closed | canceled. `unknown` is the fallback for a
|
|
23
|
+
chain code the API doesn't recognize.
|
|
24
|
+
|
|
25
|
+
*/
|
|
26
|
+
export type OrderInfoChainStatus = (typeof OrderInfoChainStatus)[keyof typeof OrderInfoChainStatus];
|
|
27
|
+
export declare const OrderInfoChainStatus: {
|
|
28
|
+
readonly open: "open";
|
|
29
|
+
readonly partially_filled: "partially_filled";
|
|
30
|
+
readonly filled: "filled";
|
|
31
|
+
readonly cancelled: "cancelled";
|
|
32
|
+
readonly expired: "expired";
|
|
33
|
+
readonly triggered_pending: "triggered_pending";
|
|
34
|
+
readonly unknown: "unknown";
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Granular chain-level order type. The CCXT view at
|
|
38
|
+
`OrderResponse.type` collapses these into limit | market.
|
|
39
|
+
`unknown` is the fallback for a chain code the API doesn't
|
|
40
|
+
recognize.
|
|
41
|
+
|
|
42
|
+
*/
|
|
43
|
+
export type OrderInfoChainType = (typeof OrderInfoChainType)[keyof typeof OrderInfoChainType];
|
|
44
|
+
export declare const OrderInfoChainType: {
|
|
45
|
+
readonly limit: "limit";
|
|
46
|
+
readonly market: "market";
|
|
47
|
+
readonly scale: "scale";
|
|
48
|
+
readonly stop: "stop";
|
|
49
|
+
readonly unknown: "unknown";
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Exchange-specific extension on `OrderResponse`. Mirrors the
|
|
53
|
+
`info` map populated in `internal/domain/order/service.go`.
|
|
54
|
+
|
|
55
|
+
*/
|
|
56
|
+
export interface OrderInfo {
|
|
57
|
+
/**
|
|
58
|
+
* Height of the block that wrote the order. Decimal string for
|
|
59
|
+
parity with the WS order `info.block_height`.
|
|
60
|
+
|
|
61
|
+
* @pattern ^\d+$
|
|
62
|
+
*/
|
|
63
|
+
block_height: string;
|
|
64
|
+
/** Index of the order tx within its block. */
|
|
65
|
+
tx_index: number;
|
|
66
|
+
/**
|
|
67
|
+
* Remaining quote-asset escrow (raw decimal string at the chain's
|
|
68
|
+
atto-precision) that has not yet been spent on fills.
|
|
69
|
+
|
|
70
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
71
|
+
*/
|
|
72
|
+
remaining_deposit: string;
|
|
73
|
+
/** Granular chain-level status — the WS view exposes the same
|
|
74
|
+
string. The CCXT view at `OrderResponse.status` collapses these
|
|
75
|
+
into open | closed | canceled. `unknown` is the fallback for a
|
|
76
|
+
chain code the API doesn't recognize.
|
|
77
|
+
*/
|
|
78
|
+
chain_status: OrderInfoChainStatus;
|
|
79
|
+
/** Granular chain-level order type. The CCXT view at
|
|
80
|
+
`OrderResponse.type` collapses these into limit | market.
|
|
81
|
+
`unknown` is the fallback for a chain code the API doesn't
|
|
82
|
+
recognize.
|
|
83
|
+
*/
|
|
84
|
+
chain_type: OrderInfoChainType;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Exchange-specific extension on `TradeResponse`. Mirrors the
|
|
88
|
+
`Info` struct populated in `internal/domain/trade/service.go`.
|
|
89
|
+
|
|
90
|
+
*/
|
|
91
|
+
export interface TradeInfo {
|
|
92
|
+
/** Bech32 address of the orderer that owns this leg of the fill. */
|
|
93
|
+
address: AddressBech32;
|
|
94
|
+
/** Atto-precision amount the orderer paid for this fill, suffixed
|
|
95
|
+
with the chain denom (e.g. `"1500000000000000000uusdt"`). Empty
|
|
96
|
+
string when the chain did not record this side.
|
|
97
|
+
*/
|
|
98
|
+
paid: string;
|
|
99
|
+
/** Atto-precision amount the orderer received for this fill,
|
|
100
|
+
suffixed with the chain denom. Empty string when the chain did
|
|
101
|
+
not record this side.
|
|
102
|
+
*/
|
|
103
|
+
received: string;
|
|
104
|
+
/**
|
|
105
|
+
* Decimal-string block height for parity with the WS trade event.
|
|
106
|
+
* @pattern ^\d+$
|
|
107
|
+
*/
|
|
108
|
+
block_height: string;
|
|
109
|
+
/**
|
|
110
|
+
* The trade's event position within its block. Together with
|
|
111
|
+
`block_height` it is the row's composite pagination cursor for the
|
|
112
|
+
trade feed. `created_at` cannot serve this role because every trade
|
|
113
|
+
in a block shares one timestamp.
|
|
114
|
+
|
|
115
|
+
* @minimum 0
|
|
116
|
+
*/
|
|
117
|
+
event_index: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Exchange-specific extension on `MarketResponse`. Mirrors the
|
|
121
|
+
`Info` map populated in `internal/domain/market/service.go`.
|
|
122
|
+
|
|
123
|
+
*/
|
|
124
|
+
export interface MarketInfo {
|
|
125
|
+
/** Bech32 address of the per-market escrow account that holds
|
|
126
|
+
user deposits while orders are resting.
|
|
127
|
+
*/
|
|
128
|
+
escrow_address?: AddressBech32;
|
|
129
|
+
/** Height of the block at which the market was registered. */
|
|
130
|
+
block_height?: number;
|
|
131
|
+
/** On-chain market type code (e.g. spot). Stable across the
|
|
132
|
+
lifecycle of the market; `MarketResponse.type` carries the
|
|
133
|
+
CCXT label.
|
|
134
|
+
*/
|
|
135
|
+
market_type?: number;
|
|
136
|
+
}
|
|
1
137
|
export type HealthResponseStatus = (typeof HealthResponseStatus)[keyof typeof HealthResponseStatus];
|
|
2
138
|
export declare const HealthResponseStatus: {
|
|
3
139
|
readonly healthy: "healthy";
|
|
@@ -31,13 +167,63 @@ export interface StatusResponse {
|
|
|
31
167
|
last_indexed_height: number;
|
|
32
168
|
last_indexed_at: string;
|
|
33
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Module gas constants overridden for this env (keyed by message
|
|
172
|
+
type, e.g. `LIMIT_ORDER`). Values are integers.
|
|
173
|
+
|
|
174
|
+
*/
|
|
175
|
+
export type SDKManifestResponseGas = {
|
|
176
|
+
[key: string]: unknown;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* EIP-712 fee-related defaults (e.g. fee amount, gas limit). Shape
|
|
180
|
+
is operator-controlled.
|
|
181
|
+
|
|
182
|
+
*/
|
|
183
|
+
export type SDKManifestResponseEip712 = {
|
|
184
|
+
[key: string]: unknown;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Env-specific URL overrides (e.g. `rest`, `rpc`, `ws`).
|
|
188
|
+
|
|
189
|
+
*/
|
|
190
|
+
export type SDKManifestResponseUrls = {
|
|
191
|
+
[key: string]: unknown;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Per-environment SDK manifest. The dex-api treats this as an opaque
|
|
195
|
+
operator-supplied document apart from `schemaVersion`; the named
|
|
196
|
+
sections below describe what SDKs currently look for, but unknown
|
|
197
|
+
top-level fields are preserved verbatim so a forward-compat manifest
|
|
198
|
+
flows through without a server release.
|
|
199
|
+
|
|
200
|
+
*/
|
|
201
|
+
export interface SDKManifestResponse {
|
|
202
|
+
/**
|
|
203
|
+
* Manifest schema version. Server rejects values `< 1` at boot;
|
|
204
|
+
future majors (e.g. `2`) pass through and are interpreted by
|
|
205
|
+
the SDK.
|
|
206
|
+
|
|
207
|
+
* @minimum 1
|
|
208
|
+
*/
|
|
209
|
+
schemaVersion: number;
|
|
210
|
+
/** Module gas constants overridden for this env (keyed by message
|
|
211
|
+
type, e.g. `LIMIT_ORDER`). Values are integers.
|
|
212
|
+
*/
|
|
213
|
+
gas?: SDKManifestResponseGas;
|
|
214
|
+
/** EIP-712 fee-related defaults (e.g. fee amount, gas limit). Shape
|
|
215
|
+
is operator-controlled.
|
|
216
|
+
*/
|
|
217
|
+
eip712?: SDKManifestResponseEip712;
|
|
218
|
+
/** Env-specific URL overrides (e.g. `rest`, `rpc`, `ws`).
|
|
219
|
+
*/
|
|
220
|
+
urls?: SDKManifestResponseUrls;
|
|
221
|
+
[key: string]: unknown;
|
|
222
|
+
}
|
|
34
223
|
export type MarketResponseType = (typeof MarketResponseType)[keyof typeof MarketResponseType];
|
|
35
224
|
export declare const MarketResponseType: {
|
|
36
225
|
readonly spot: "spot";
|
|
37
226
|
};
|
|
38
|
-
export type MarketResponseInfo = {
|
|
39
|
-
[key: string]: unknown;
|
|
40
|
-
};
|
|
41
227
|
export interface MarketPrecision {
|
|
42
228
|
amount?: number;
|
|
43
229
|
price?: number;
|
|
@@ -90,17 +276,25 @@ export interface MarketResponse {
|
|
|
90
276
|
/** @nullable */
|
|
91
277
|
optionType?: string | null;
|
|
92
278
|
feeSide?: string;
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
279
|
+
/**
|
|
280
|
+
* Taker fee rate as a canonical decimal string. Strings preserve
|
|
281
|
+
precision past 2^53 raw units and avoid float-rounding noise.
|
|
282
|
+
|
|
283
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
284
|
+
*/
|
|
285
|
+
taker: string;
|
|
286
|
+
/**
|
|
287
|
+
* Maker fee rate as a canonical decimal string.
|
|
288
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
289
|
+
*/
|
|
290
|
+
maker: string;
|
|
97
291
|
percentage?: boolean;
|
|
98
292
|
tierBased?: boolean;
|
|
99
293
|
precision: MarketPrecision;
|
|
100
294
|
limits: MarketLimits;
|
|
101
295
|
/** @nullable */
|
|
102
296
|
created?: number | null;
|
|
103
|
-
info:
|
|
297
|
+
info: MarketInfo;
|
|
104
298
|
}
|
|
105
299
|
export type CurrencyResponseLimits = {
|
|
106
300
|
amount?: MinMax;
|
|
@@ -136,65 +330,173 @@ export type TradingFeeResponseInfo = {
|
|
|
136
330
|
};
|
|
137
331
|
export interface TradingFeeResponse {
|
|
138
332
|
symbol: string;
|
|
139
|
-
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
333
|
+
/**
|
|
334
|
+
* Maker fee rate as a canonical decimal string.
|
|
335
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
336
|
+
*/
|
|
337
|
+
maker: string;
|
|
338
|
+
/**
|
|
339
|
+
* Taker fee rate as a canonical decimal string.
|
|
340
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
341
|
+
*/
|
|
342
|
+
taker: string;
|
|
143
343
|
percentage: boolean;
|
|
144
344
|
tierBased: boolean;
|
|
145
345
|
info: TradingFeeResponseInfo;
|
|
146
346
|
}
|
|
347
|
+
export type StatsResponseWindow = (typeof StatsResponseWindow)[keyof typeof StatsResponseWindow];
|
|
348
|
+
export declare const StatsResponseWindow: {
|
|
349
|
+
readonly "24h": "24h";
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Protocol-wide aggregates for the window.
|
|
353
|
+
*/
|
|
354
|
+
export interface StatsTotals {
|
|
355
|
+
/**
|
|
356
|
+
* Total quote volume over the window as a canonical decimal string.
|
|
357
|
+
Null when contributing markets span more than one quote (then
|
|
358
|
+
`estimatedFee` and `quoteAsset` are null too).
|
|
359
|
+
|
|
360
|
+
* @nullable
|
|
361
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
362
|
+
*/
|
|
363
|
+
quoteVolume: string | null;
|
|
364
|
+
/**
|
|
365
|
+
* Shared quote ticker of the markets that had volume. Null when they
|
|
366
|
+
span more than one quote, or on an idle window (then `quoteVolume`
|
|
367
|
+
is "0"; a null `quoteVolume` means multi-quote).
|
|
368
|
+
|
|
369
|
+
* @nullable
|
|
370
|
+
*/
|
|
371
|
+
quoteAsset: string | null;
|
|
372
|
+
/**
|
|
373
|
+
* Estimated total fees (`Σ quoteVolume × takerFeeRate`) as a decimal
|
|
374
|
+
string; an estimate, not booked revenue. Null on multi-quote.
|
|
375
|
+
|
|
376
|
+
* @nullable
|
|
377
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
378
|
+
*/
|
|
379
|
+
estimatedFee: string | null;
|
|
380
|
+
/** Number of fills (maker legs) in the window. */
|
|
381
|
+
tradeCount: number;
|
|
382
|
+
/** Distinct trading addresses in the window. */
|
|
383
|
+
traderCount: number;
|
|
384
|
+
/** Number of markets with at least one fill in the window. */
|
|
385
|
+
activeMarkets: number;
|
|
386
|
+
/**
|
|
387
|
+
* Distinct trading addresses in the window. Currently an alias of
|
|
388
|
+
`traderCount`; separate so a precise DAU source can diverge later.
|
|
389
|
+
|
|
390
|
+
* @nullable
|
|
391
|
+
*/
|
|
392
|
+
dailyActiveUsers: number | null;
|
|
393
|
+
/**
|
|
394
|
+
* Volume-weighted taker slippage (fill vs book-mid) in bps as a
|
|
395
|
+
decimal string. Null with no benchmarkable taker fill or when
|
|
396
|
+
fills span more than one quote.
|
|
397
|
+
|
|
398
|
+
* @nullable
|
|
399
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
400
|
+
*/
|
|
401
|
+
averageSlippageBps: string | null;
|
|
402
|
+
/**
|
|
403
|
+
* Reserved. Currently always null.
|
|
404
|
+
* @nullable
|
|
405
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
406
|
+
*/
|
|
407
|
+
depositUsdcVolume24h: string | null;
|
|
408
|
+
/**
|
|
409
|
+
* Reserved. Currently always null.
|
|
410
|
+
* @nullable
|
|
411
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
412
|
+
*/
|
|
413
|
+
builderCodesFee24h: string | null;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Per-market aggregates for the window.
|
|
417
|
+
*/
|
|
418
|
+
export interface MarketStats {
|
|
419
|
+
symbol: string;
|
|
420
|
+
base: string;
|
|
421
|
+
quote: string;
|
|
422
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
423
|
+
quoteVolume: string;
|
|
424
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
425
|
+
baseVolume: string;
|
|
426
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
427
|
+
estimatedFee: string;
|
|
428
|
+
tradeCount: number;
|
|
429
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
430
|
+
takerFeeRate: string;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Protocol stats overview for a rolling window. Monetary fields are
|
|
434
|
+
canonical decimal strings; counts are integers.
|
|
435
|
+
|
|
436
|
+
*/
|
|
437
|
+
export interface StatsResponse {
|
|
438
|
+
window: StatsResponseWindow;
|
|
439
|
+
totals: StatsTotals;
|
|
440
|
+
markets: MarketStats[];
|
|
441
|
+
}
|
|
147
442
|
export type TickerResponseInfo = {
|
|
148
443
|
[key: string]: unknown;
|
|
149
444
|
};
|
|
445
|
+
/**
|
|
446
|
+
* 24h ticker stats. All numeric fields are canonical decimal strings
|
|
447
|
+
so quantities at any magnitude survive the JSON round-trip without
|
|
448
|
+
rounding through float64. Pointer-style fields (high/low/bid/etc.)
|
|
449
|
+
are nullable when no data is available for that field.
|
|
450
|
+
|
|
451
|
+
*/
|
|
150
452
|
export interface TickerResponse {
|
|
151
453
|
symbol: string;
|
|
152
454
|
/** @nullable */
|
|
153
|
-
high?:
|
|
455
|
+
high?: string | null;
|
|
154
456
|
/** @nullable */
|
|
155
|
-
low?:
|
|
457
|
+
low?: string | null;
|
|
156
458
|
/** @nullable */
|
|
157
|
-
bid?:
|
|
459
|
+
bid?: string | null;
|
|
158
460
|
/**
|
|
159
461
|
* Volume at the best bid price level. Extracted from the orderbook snapshot.
|
|
160
462
|
* @nullable
|
|
161
463
|
*/
|
|
162
|
-
bidVolume?:
|
|
464
|
+
bidVolume?: string | null;
|
|
163
465
|
/** @nullable */
|
|
164
|
-
ask?:
|
|
466
|
+
ask?: string | null;
|
|
165
467
|
/**
|
|
166
468
|
* Volume at the best ask price level. Extracted from the orderbook snapshot.
|
|
167
469
|
* @nullable
|
|
168
470
|
*/
|
|
169
|
-
askVolume?:
|
|
471
|
+
askVolume?: string | null;
|
|
170
472
|
/**
|
|
171
473
|
* Volume-weighted average price: quoteVolume / baseVolume
|
|
172
474
|
* @nullable
|
|
173
475
|
*/
|
|
174
|
-
vwap?:
|
|
476
|
+
vwap?: string | null;
|
|
175
477
|
/** @nullable */
|
|
176
|
-
open?:
|
|
478
|
+
open?: string | null;
|
|
177
479
|
/** @nullable */
|
|
178
|
-
close?:
|
|
480
|
+
close?: string | null;
|
|
179
481
|
/** @nullable */
|
|
180
|
-
last?:
|
|
482
|
+
last?: string | null;
|
|
181
483
|
/**
|
|
182
484
|
* Close price of the last bar before the 24h window.
|
|
183
485
|
* @nullable
|
|
184
486
|
*/
|
|
185
|
-
previousClose?:
|
|
487
|
+
previousClose?: string | null;
|
|
186
488
|
/** @nullable */
|
|
187
|
-
change?:
|
|
489
|
+
change?: string | null;
|
|
188
490
|
/** @nullable */
|
|
189
|
-
percentage?:
|
|
491
|
+
percentage?: string | null;
|
|
190
492
|
/**
|
|
191
|
-
* Simple average: (open +
|
|
493
|
+
* Simple average: (open + last) / 2
|
|
192
494
|
* @nullable
|
|
193
495
|
*/
|
|
194
|
-
average?:
|
|
195
|
-
baseVolume:
|
|
496
|
+
average?: string | null;
|
|
497
|
+
baseVolume: string;
|
|
196
498
|
/** @nullable */
|
|
197
|
-
quoteVolume?:
|
|
499
|
+
quoteVolume?: string | null;
|
|
198
500
|
/** Milliseconds */
|
|
199
501
|
timestamp: number;
|
|
200
502
|
datetime: string;
|
|
@@ -202,20 +504,43 @@ export interface TickerResponse {
|
|
|
202
504
|
}
|
|
203
505
|
export interface OrderbookResponse {
|
|
204
506
|
symbol: string;
|
|
205
|
-
|
|
206
|
-
|
|
507
|
+
/**
|
|
508
|
+
* Hex-encoded chain market identifier (no `0x` prefix). Provided so
|
|
509
|
+
consumers can round-trip back to chain proto endpoints which key
|
|
510
|
+
on the binary market id without re-resolving the symbol map.
|
|
511
|
+
Layout on the chain side is `MarketType (1 byte) | baseDenom |
|
|
512
|
+
\\x00 | quoteDenom`, with the full id stored as `VARBINARY(255)`
|
|
513
|
+
in the indexer; the hex form is therefore variable-length, even
|
|
514
|
+
for short-denom test markets that hit the lower bound.
|
|
515
|
+
|
|
516
|
+
* @pattern ^[0-9a-f]{2,510}$
|
|
517
|
+
*/
|
|
518
|
+
market_id: string;
|
|
519
|
+
/** Bid levels as `[price, qty]` decimal-string tuples. Ordered by
|
|
520
|
+
price descending — index 0 is the best bid. Matches the WS
|
|
521
|
+
`book` topic (`docs/websocket-api.md`), so consumers that switch
|
|
522
|
+
between REST snapshots and WS deltas don't need to re-sort.
|
|
523
|
+
*/
|
|
524
|
+
bids: [string, string][];
|
|
525
|
+
/** Ask levels as `[price, qty]` decimal-string tuples. Ordered by
|
|
526
|
+
price ascending — index 0 is the best ask. Matches the WS
|
|
527
|
+
`book` topic, so consumers that switch between REST snapshots
|
|
528
|
+
and WS deltas don't need to re-sort.
|
|
529
|
+
*/
|
|
530
|
+
asks: [string, string][];
|
|
207
531
|
timestamp: number;
|
|
208
532
|
datetime: string;
|
|
209
533
|
nonce: number;
|
|
210
534
|
}
|
|
211
535
|
/**
|
|
212
|
-
* Order type resolved via JOIN to orders table. Null if order not found.
|
|
536
|
+
* Order type resolved via JOIN to orders table. Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize.
|
|
213
537
|
* @nullable
|
|
214
538
|
*/
|
|
215
539
|
export type TradeResponseType = (typeof TradeResponseType)[keyof typeof TradeResponseType] | null;
|
|
216
540
|
export declare const TradeResponseType: {
|
|
217
541
|
readonly limit: "limit";
|
|
218
542
|
readonly market: "market";
|
|
543
|
+
readonly unknown: "unknown";
|
|
219
544
|
};
|
|
220
545
|
export type TradeResponseSide = (typeof TradeResponseSide)[keyof typeof TradeResponseSide];
|
|
221
546
|
export declare const TradeResponseSide: {
|
|
@@ -223,26 +548,36 @@ export declare const TradeResponseSide: {
|
|
|
223
548
|
readonly sell: "sell";
|
|
224
549
|
};
|
|
225
550
|
/**
|
|
226
|
-
*
|
|
551
|
+
* 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.
|
|
227
552
|
*/
|
|
228
553
|
export type TradeResponseTakerOrMaker = (typeof TradeResponseTakerOrMaker)[keyof typeof TradeResponseTakerOrMaker];
|
|
229
554
|
export declare const TradeResponseTakerOrMaker: {
|
|
230
555
|
readonly taker: "taker";
|
|
556
|
+
readonly maker: "maker";
|
|
231
557
|
};
|
|
232
558
|
/**
|
|
233
|
-
*
|
|
559
|
+
* 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).
|
|
234
560
|
*/
|
|
235
561
|
export type TradeResponseFee = {
|
|
236
|
-
/**
|
|
237
|
-
|
|
238
|
-
|
|
562
|
+
/**
|
|
563
|
+
* Fee cost in `currency` units, decimal string.
|
|
564
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
565
|
+
*/
|
|
566
|
+
cost?: string;
|
|
567
|
+
/** Ticker of the fee denom (e.g., "USDT", or "AULT" for a base-denom fee). The quote ticker for the rate-estimated fallback. */
|
|
239
568
|
currency?: string;
|
|
240
|
-
/**
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
569
|
+
/**
|
|
570
|
+
* This leg's fee rate from the market, decimal string: the maker rate for the maker leg, the taker rate otherwise.
|
|
571
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
572
|
+
*/
|
|
573
|
+
rate?: string;
|
|
245
574
|
};
|
|
575
|
+
/**
|
|
576
|
+
* All numeric fields are canonical decimal strings — quantities at any
|
|
577
|
+
magnitude survive the JSON round-trip without rounding through
|
|
578
|
+
float64. Consumers parse with their own bigdecimal.
|
|
579
|
+
|
|
580
|
+
*/
|
|
246
581
|
export interface TradeResponse {
|
|
247
582
|
id: string;
|
|
248
583
|
/** @nullable */
|
|
@@ -251,31 +586,49 @@ export interface TradeResponse {
|
|
|
251
586
|
datetime: string;
|
|
252
587
|
symbol: string;
|
|
253
588
|
/**
|
|
254
|
-
* Order type resolved via JOIN to orders table. Null if order not found.
|
|
589
|
+
* Order type resolved via JOIN to orders table. Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize.
|
|
255
590
|
* @nullable
|
|
256
591
|
*/
|
|
257
592
|
type?: TradeResponseType;
|
|
593
|
+
/**
|
|
594
|
+
* 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).
|
|
595
|
+
* @nullable
|
|
596
|
+
*/
|
|
597
|
+
cloid?: string | null;
|
|
258
598
|
side: TradeResponseSide;
|
|
259
|
-
/**
|
|
599
|
+
/** 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. */
|
|
260
600
|
takerOrMaker?: TradeResponseTakerOrMaker;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
|
|
265
|
-
/**
|
|
601
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
602
|
+
price: string;
|
|
603
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
604
|
+
amount: string;
|
|
605
|
+
/**
|
|
606
|
+
* price * amount
|
|
607
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
608
|
+
*/
|
|
609
|
+
cost: string;
|
|
610
|
+
/** 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). */
|
|
266
611
|
fee?: TradeResponseFee;
|
|
267
|
-
info:
|
|
612
|
+
info: TradeInfo;
|
|
268
613
|
}
|
|
614
|
+
/**
|
|
615
|
+
* `unknown` is the fallback for a chain status code the API doesn't recognize.
|
|
616
|
+
*/
|
|
269
617
|
export type OrderResponseStatus = (typeof OrderResponseStatus)[keyof typeof OrderResponseStatus];
|
|
270
618
|
export declare const OrderResponseStatus: {
|
|
271
619
|
readonly open: "open";
|
|
272
620
|
readonly closed: "closed";
|
|
273
621
|
readonly canceled: "canceled";
|
|
622
|
+
readonly unknown: "unknown";
|
|
274
623
|
};
|
|
624
|
+
/**
|
|
625
|
+
* `unknown` is the fallback for a chain type code the API doesn't recognize.
|
|
626
|
+
*/
|
|
275
627
|
export type OrderResponseType = (typeof OrderResponseType)[keyof typeof OrderResponseType];
|
|
276
628
|
export declare const OrderResponseType: {
|
|
277
629
|
readonly limit: "limit";
|
|
278
630
|
readonly market: "market";
|
|
631
|
+
readonly unknown: "unknown";
|
|
279
632
|
};
|
|
280
633
|
export type OrderResponseSide = (typeof OrderResponseSide)[keyof typeof OrderResponseSide];
|
|
281
634
|
export declare const OrderResponseSide: {
|
|
@@ -286,23 +639,37 @@ export type OrderResponseTradesItem = {
|
|
|
286
639
|
[key: string]: unknown;
|
|
287
640
|
};
|
|
288
641
|
/**
|
|
289
|
-
*
|
|
642
|
+
* Fee for the order. `cost` is `cost * taker_fee_rate` — applied to
|
|
643
|
+
the realized cost above, so it is more accurate than the previous
|
|
644
|
+
`filled * price * taker_fee_rate` approximation. The rate is the
|
|
645
|
+
market's taker rate; this stays an estimate because the indexer
|
|
646
|
+
records no realized per-trade fee amount to sum.
|
|
647
|
+
|
|
290
648
|
*/
|
|
291
649
|
export type OrderResponseFee = {
|
|
292
|
-
/**
|
|
293
|
-
|
|
650
|
+
/**
|
|
651
|
+
* Fee cost in quote currency, decimal string.
|
|
652
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
653
|
+
*/
|
|
654
|
+
cost?: string;
|
|
294
655
|
/** Quote currency ticker (e.g., "USDT") */
|
|
295
656
|
currency?: string;
|
|
296
|
-
/**
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
657
|
+
/**
|
|
658
|
+
* Fee rate from the market, decimal string.
|
|
659
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
660
|
+
*/
|
|
661
|
+
rate?: string;
|
|
301
662
|
};
|
|
663
|
+
/**
|
|
664
|
+
* All numeric fields (price, amount, filled, remaining, cost,
|
|
665
|
+
fee.cost, fee.rate, average, triggerPrice, stopPrice) are canonical
|
|
666
|
+
decimal strings.
|
|
667
|
+
|
|
668
|
+
*/
|
|
302
669
|
export interface OrderResponse {
|
|
303
670
|
id: string;
|
|
304
671
|
/**
|
|
305
|
-
*
|
|
672
|
+
* The order's cloid (client order id) as a hex string, or null when the order was placed without one.
|
|
306
673
|
* @nullable
|
|
307
674
|
*/
|
|
308
675
|
clientOrderId?: string | null;
|
|
@@ -313,50 +680,74 @@ export interface OrderResponse {
|
|
|
313
680
|
* @nullable
|
|
314
681
|
*/
|
|
315
682
|
lastTradeTimestamp?: number | null;
|
|
683
|
+
/** `unknown` is the fallback for a chain status code the API doesn't recognize. */
|
|
316
684
|
status: OrderResponseStatus;
|
|
317
685
|
symbol: string;
|
|
686
|
+
/** `unknown` is the fallback for a chain type code the API doesn't recognize. */
|
|
318
687
|
type: OrderResponseType;
|
|
319
688
|
/** @nullable */
|
|
320
689
|
timeInForce?: string | null;
|
|
321
690
|
side: OrderResponseSide;
|
|
322
|
-
|
|
691
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
692
|
+
price: string;
|
|
323
693
|
/**
|
|
324
|
-
* Average execution price
|
|
694
|
+
* Average execution price as decimal string. Null when filled is 0.
|
|
325
695
|
* @nullable
|
|
326
696
|
*/
|
|
327
|
-
average?:
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
697
|
+
average?: string | null;
|
|
698
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
699
|
+
amount: string;
|
|
700
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
701
|
+
filled: string;
|
|
702
|
+
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
703
|
+
remaining: string;
|
|
704
|
+
/**
|
|
705
|
+
* Quote-asset notional accumulated across all fills for this order.
|
|
706
|
+
|
|
707
|
+
When the order has at least one indexed fill, the value is summed
|
|
708
|
+
from the trades table (`SUM(filled_quantity * price)`) — it
|
|
709
|
+
reflects the realized average across every level the order
|
|
710
|
+
walked, not `filled * price`. Until the indexer has caught up
|
|
711
|
+
with a freshly-matched fill, the value falls back to
|
|
712
|
+
`filled * price` so consumers never see a misleading "0" while
|
|
713
|
+
the trade row is still in flight.
|
|
714
|
+
|
|
715
|
+
* @pattern ^-?\d+(\.\d+)?$
|
|
716
|
+
*/
|
|
717
|
+
cost: string;
|
|
333
718
|
trades?: OrderResponseTradesItem[];
|
|
334
|
-
/**
|
|
719
|
+
/** Fee for the order. `cost` is `cost * taker_fee_rate` — applied to
|
|
720
|
+
the realized cost above, so it is more accurate than the previous
|
|
721
|
+
`filled * price * taker_fee_rate` approximation. The rate is the
|
|
722
|
+
market's taker rate; this stays an estimate because the indexer
|
|
723
|
+
records no realized per-trade fee amount to sum.
|
|
724
|
+
*/
|
|
335
725
|
fee?: OrderResponseFee;
|
|
336
726
|
reduceOnly?: boolean;
|
|
337
727
|
postOnly?: boolean;
|
|
338
728
|
/** @nullable */
|
|
339
|
-
stopPrice?:
|
|
729
|
+
stopPrice?: string | null;
|
|
340
730
|
/** @nullable */
|
|
341
|
-
triggerPrice?:
|
|
342
|
-
info:
|
|
731
|
+
triggerPrice?: string | null;
|
|
732
|
+
info: OrderInfo;
|
|
343
733
|
}
|
|
344
734
|
export type BalancesResponseFree = {
|
|
345
|
-
[key: string]:
|
|
735
|
+
[key: string]: string;
|
|
346
736
|
};
|
|
347
737
|
export type BalancesResponseUsed = {
|
|
348
|
-
[key: string]:
|
|
738
|
+
[key: string]: string;
|
|
349
739
|
};
|
|
350
740
|
export type BalancesResponseTotal = {
|
|
351
|
-
[key: string]:
|
|
741
|
+
[key: string]: string;
|
|
352
742
|
};
|
|
353
743
|
export type BalancesResponseInfo = {
|
|
354
744
|
[key: string]: unknown;
|
|
355
745
|
};
|
|
356
746
|
/**
|
|
357
747
|
* Balance object. Contains `free`, `used`, `total` dictionaries
|
|
358
|
-
(currency code ->
|
|
359
|
-
and `info`, `timestamp`,
|
|
748
|
+
(currency code -> decimal string), plus per-currency entries with
|
|
749
|
+
{free, used, total} as decimal strings, and `info`, `timestamp`,
|
|
750
|
+
`datetime`. Strings preserve precision past 2^53 raw units.
|
|
360
751
|
|
|
361
752
|
*/
|
|
362
753
|
export interface BalancesResponse {
|
|
@@ -370,11 +761,22 @@ export interface BalancesResponse {
|
|
|
370
761
|
info: BalancesResponseInfo;
|
|
371
762
|
}
|
|
372
763
|
/**
|
|
373
|
-
* [timestamp_ms, open, high, low, close,
|
|
374
|
-
|
|
375
|
-
|
|
764
|
+
* `[timestamp_ms, open, high, low, close, baseVolume, quoteVolume]`.
|
|
765
|
+
Timestamp is a numeric ms epoch; the o/h/l/c/baseVolume/quoteVolume
|
|
766
|
+
fields are canonical decimal strings so quantities at any magnitude
|
|
767
|
+
survive the JSON round-trip. The trailing `quoteVolume` slot is
|
|
768
|
+
derived as `baseVolume * close_price` until the chain indexer
|
|
769
|
+
emits a realized `volume_quote` column. Both SDK clients
|
|
770
|
+
(`ault-sdk-ts`, `ault-sdk-py`) consume the 7-tuple as the
|
|
771
|
+
canonical shape.
|
|
772
|
+
(Patterns omitted on tuple items because orval generates broken
|
|
773
|
+
regex references when `prefixItems` carry `pattern`; the format is
|
|
774
|
+
documented in the descriptions.)
|
|
775
|
+
|
|
776
|
+
* @minItems 7
|
|
777
|
+
* @maxItems 7
|
|
376
778
|
*/
|
|
377
|
-
export type OHLCVEntry = number
|
|
779
|
+
export type OHLCVEntry = [number, string, string, string, string, string, string];
|
|
378
780
|
export interface UDFExchange {
|
|
379
781
|
value: string;
|
|
380
782
|
name: string;
|
|
@@ -549,6 +951,20 @@ export type InternalErrorResponse = ErrorResponse;
|
|
|
549
951
|
* Rate limit exceeded
|
|
550
952
|
*/
|
|
551
953
|
export type RateLimitedResponse = ErrorResponse;
|
|
954
|
+
export type RangeQueryParameter = (typeof RangeQueryParameter)[keyof typeof RangeQueryParameter];
|
|
955
|
+
export declare const RangeQueryParameter: {
|
|
956
|
+
readonly day: "day";
|
|
957
|
+
readonly week: "week";
|
|
958
|
+
readonly month: "month";
|
|
959
|
+
readonly allTime: "allTime";
|
|
960
|
+
};
|
|
961
|
+
export type RangeQueryDayParameter = (typeof RangeQueryDayParameter)[keyof typeof RangeQueryDayParameter];
|
|
962
|
+
export declare const RangeQueryDayParameter: {
|
|
963
|
+
readonly day: "day";
|
|
964
|
+
readonly week: "week";
|
|
965
|
+
readonly month: "month";
|
|
966
|
+
readonly allTime: "allTime";
|
|
967
|
+
};
|
|
552
968
|
export type ListCurrencies200 = {
|
|
553
969
|
[key: string]: CurrencyResponse;
|
|
554
970
|
};
|
|
@@ -558,6 +974,7 @@ export type GetAllTickers200 = {
|
|
|
558
974
|
export type GetOrderbookParams = {
|
|
559
975
|
/**
|
|
560
976
|
* @minimum 1
|
|
977
|
+
* @maximum 20
|
|
561
978
|
*/
|
|
562
979
|
limit?: number;
|
|
563
980
|
};
|
|
@@ -575,11 +992,24 @@ export type ListTradesParams = {
|
|
|
575
992
|
export type GetTradingFees200 = {
|
|
576
993
|
[key: string]: TradingFeeResponse;
|
|
577
994
|
};
|
|
578
|
-
export type
|
|
995
|
+
export type GetStatsParams = {
|
|
579
996
|
/**
|
|
580
|
-
*
|
|
997
|
+
* Rolling window. Only `24h` is supported; defaults to `24h`.
|
|
581
998
|
*/
|
|
582
|
-
|
|
999
|
+
window?: GetStatsWindow;
|
|
1000
|
+
};
|
|
1001
|
+
export type GetStatsWindow = (typeof GetStatsWindow)[keyof typeof GetStatsWindow];
|
|
1002
|
+
export declare const GetStatsWindow: {
|
|
1003
|
+
readonly "24h": "24h";
|
|
1004
|
+
};
|
|
1005
|
+
export type ListOrdersParams = {
|
|
1006
|
+
/**
|
|
1007
|
+
* Account address. Accepts either bech32 (`ault1...`) or 0x-hex
|
|
1008
|
+
(`0x...`) form; the API normalizes to the canonical bech32
|
|
1009
|
+
stored in the indexer before querying.
|
|
1010
|
+
|
|
1011
|
+
*/
|
|
1012
|
+
address: AddressBech32 | AddressHex;
|
|
583
1013
|
status?: ListOrdersStatus;
|
|
584
1014
|
/**
|
|
585
1015
|
* Symbol to filter by (e.g., AULT/USDT). Alternative to market_id.
|
|
@@ -590,6 +1020,19 @@ export type ListOrdersParams = {
|
|
|
590
1020
|
* @pattern ^[0-9a-fA-F]+$
|
|
591
1021
|
*/
|
|
592
1022
|
market_id?: string;
|
|
1023
|
+
/**
|
|
1024
|
+
* Client order id (cloid) to filter by, as a hex string. A
|
|
1025
|
+
non-empty value must decode to exactly 8 bytes (16 hex chars);
|
|
1026
|
+
anything else returns 400. An absent or empty (`cloid=`) value
|
|
1027
|
+
applies no cloid filter, matching how `market_id` behaves.
|
|
1028
|
+
Combined with `address`, a set cloid returns the orders carrying
|
|
1029
|
+
it. cloid uniqueness is only enforced for currently-resting
|
|
1030
|
+
orders, so closed orders that reused the cloid may also match and
|
|
1031
|
+
more than one order can be returned.
|
|
1032
|
+
|
|
1033
|
+
* @pattern ^([0-9a-fA-F]{16})?$
|
|
1034
|
+
*/
|
|
1035
|
+
cloid?: string;
|
|
593
1036
|
/**
|
|
594
1037
|
* Return orders created after this Unix timestamp (milliseconds)
|
|
595
1038
|
*/
|
|
@@ -821,6 +1264,38 @@ export type getStatusResponseError = (getStatusResponse429 | getStatusResponse50
|
|
|
821
1264
|
export type getStatusResponse = getStatusResponseSuccess | getStatusResponseError;
|
|
822
1265
|
export declare const getGetStatusUrl: () => string;
|
|
823
1266
|
export declare const getStatus: (options?: RequestInit) => Promise<getStatusResponse>;
|
|
1267
|
+
/**
|
|
1268
|
+
* Returns the per-environment manifest consumed by the ault SDK clients
|
|
1269
|
+
(TypeScript and Python). The body is supplied verbatim by the operator
|
|
1270
|
+
via the `SDK_MANIFEST_JSON` env var on the server. SDKs merge the
|
|
1271
|
+
manifest field-by-field over the embedded baseline that ships with the
|
|
1272
|
+
package, so a sparse override is the norm.
|
|
1273
|
+
|
|
1274
|
+
The dex-api validates only `schemaVersion` (must be `>= 1`); all other
|
|
1275
|
+
fields are operator-controlled and pass through verbatim, including
|
|
1276
|
+
unknown top-level keys added in future schema revisions. The payload
|
|
1277
|
+
is operator-controlled and must not contain secrets — the response is
|
|
1278
|
+
cached at CDN edges via `Cache-Control: public`.
|
|
1279
|
+
|
|
1280
|
+
* @summary Get SDK manifest
|
|
1281
|
+
*/
|
|
1282
|
+
export type getSDKManifestResponse200 = {
|
|
1283
|
+
data: SDKManifestResponse;
|
|
1284
|
+
status: 200;
|
|
1285
|
+
};
|
|
1286
|
+
export type getSDKManifestResponse429 = {
|
|
1287
|
+
data: RateLimitedResponse;
|
|
1288
|
+
status: 429;
|
|
1289
|
+
};
|
|
1290
|
+
export type getSDKManifestResponseSuccess = getSDKManifestResponse200 & {
|
|
1291
|
+
headers: Headers;
|
|
1292
|
+
};
|
|
1293
|
+
export type getSDKManifestResponseError = getSDKManifestResponse429 & {
|
|
1294
|
+
headers: Headers;
|
|
1295
|
+
};
|
|
1296
|
+
export type getSDKManifestResponse = getSDKManifestResponseSuccess | getSDKManifestResponseError;
|
|
1297
|
+
export declare const getGetSDKManifestUrl: () => string;
|
|
1298
|
+
export declare const getSDKManifest: (options?: RequestInit) => Promise<getSDKManifestResponse>;
|
|
824
1299
|
/**
|
|
825
1300
|
* Returns all trading pairs in standard market format, ordered by ID.
|
|
826
1301
|
* @summary List all markets
|
|
@@ -979,6 +1454,55 @@ export type listTradesResponseError = (listTradesResponse400 | listTradesRespons
|
|
|
979
1454
|
export type listTradesResponse = listTradesResponseSuccess | listTradesResponseError;
|
|
980
1455
|
export declare const getListTradesUrl: (symbol: string, params?: ListTradesParams) => string;
|
|
981
1456
|
export declare const listTrades: (symbol: string, params?: ListTradesParams, options?: RequestInit) => Promise<listTradesResponse>;
|
|
1457
|
+
/**
|
|
1458
|
+
* Returns a single trade by its synthesized id. The `trades` table has no
|
|
1459
|
+
surrogate key, so the id is the reversible composite the REST feeds
|
|
1460
|
+
emit, `<block_height>-<hex(order_id)>-<open_quantity>`, taken verbatim
|
|
1461
|
+
from a REST trade object's `id` (from `/trades/{symbol}` or `/mytrades`).
|
|
1462
|
+
The endpoint parses it back to locate the fill and resolves either leg
|
|
1463
|
+
of a match. Note this is not the WebSocket `tid`: the realtime feed emits
|
|
1464
|
+
a hashed numeric trade id, which is not a valid input here — only a REST
|
|
1465
|
+
`id` is. The id must be canonical (lowercase hex, no leading zeros or
|
|
1466
|
+
sign, canonical decimal quantity); a non-canonical or malformed id
|
|
1467
|
+
returns 400. The path is singular (`/trade/{id}`), distinct from the
|
|
1468
|
+
plural public feed `/trades/{symbol}`. The response mirrors that public
|
|
1469
|
+
feed exactly — `order` and `cloid` are null. An id that matches no fill
|
|
1470
|
+
returns 404. A well-formed id whose fill exists but whose market is not
|
|
1471
|
+
yet in the symbol map also returns 404: this can happen transiently
|
|
1472
|
+
within the map's reload window just after a market is created, since
|
|
1473
|
+
there is no symbol under which to render the trade.
|
|
1474
|
+
|
|
1475
|
+
* @summary Get a single trade by ID
|
|
1476
|
+
*/
|
|
1477
|
+
export type getTradeResponse200 = {
|
|
1478
|
+
data: TradeResponse;
|
|
1479
|
+
status: 200;
|
|
1480
|
+
};
|
|
1481
|
+
export type getTradeResponse400 = {
|
|
1482
|
+
data: BadRequestResponse;
|
|
1483
|
+
status: 400;
|
|
1484
|
+
};
|
|
1485
|
+
export type getTradeResponse404 = {
|
|
1486
|
+
data: ErrorResponse;
|
|
1487
|
+
status: 404;
|
|
1488
|
+
};
|
|
1489
|
+
export type getTradeResponse429 = {
|
|
1490
|
+
data: RateLimitedResponse;
|
|
1491
|
+
status: 429;
|
|
1492
|
+
};
|
|
1493
|
+
export type getTradeResponse500 = {
|
|
1494
|
+
data: InternalErrorResponse;
|
|
1495
|
+
status: 500;
|
|
1496
|
+
};
|
|
1497
|
+
export type getTradeResponseSuccess = getTradeResponse200 & {
|
|
1498
|
+
headers: Headers;
|
|
1499
|
+
};
|
|
1500
|
+
export type getTradeResponseError = (getTradeResponse400 | getTradeResponse404 | getTradeResponse429 | getTradeResponse500) & {
|
|
1501
|
+
headers: Headers;
|
|
1502
|
+
};
|
|
1503
|
+
export type getTradeResponse = getTradeResponseSuccess | getTradeResponseError;
|
|
1504
|
+
export declare const getGetTradeUrl: (id: string) => string;
|
|
1505
|
+
export declare const getTrade: (id: string, options?: RequestInit) => Promise<getTradeResponse>;
|
|
982
1506
|
/**
|
|
983
1507
|
* Returns trading fee schedule for all markets, keyed by symbol.
|
|
984
1508
|
* @summary Get trading fees for all markets
|
|
@@ -1005,6 +1529,56 @@ export type getTradingFeesResponse = getTradingFeesResponseSuccess | getTradingF
|
|
|
1005
1529
|
export declare const getGetTradingFeesUrl: () => string;
|
|
1006
1530
|
export declare const getTradingFees: (options?: RequestInit) => Promise<getTradingFeesResponse>;
|
|
1007
1531
|
/**
|
|
1532
|
+
* Protocol-wide stats overview for a rolling window: quote volume,
|
|
1533
|
+
estimated fees, trade/trader counts, active markets, an active-traders
|
|
1534
|
+
DAU, average taker slippage, and a per-market breakdown.
|
|
1535
|
+
|
|
1536
|
+
Volume shares the `price_history` source and DB-side cutoff the 24h
|
|
1537
|
+
ticker uses. `estimatedFee` is `quoteVolume × takerFeeRate` (an
|
|
1538
|
+
estimate, not booked revenue). `dailyActiveUsers` currently aliases
|
|
1539
|
+
`traderCount`. `quoteVolume`/`estimatedFee`/`quoteAsset` and
|
|
1540
|
+
`averageSlippageBps` are null when contributors span more than one
|
|
1541
|
+
quote asset. `depositUsdcVolume24h` and `builderCodesFee24h` are
|
|
1542
|
+
reserved and always null. `tradeCount`/`traderCount` are book-wide;
|
|
1543
|
+
the rest cover symbol-mapped markets, so the two need not reconcile
|
|
1544
|
+
during symbol-map lag.
|
|
1545
|
+
|
|
1546
|
+
* @summary Protocol stats overview
|
|
1547
|
+
*/
|
|
1548
|
+
export type getStatsResponse200 = {
|
|
1549
|
+
data: StatsResponse;
|
|
1550
|
+
status: 200;
|
|
1551
|
+
};
|
|
1552
|
+
export type getStatsResponse400 = {
|
|
1553
|
+
data: BadRequestResponse;
|
|
1554
|
+
status: 400;
|
|
1555
|
+
};
|
|
1556
|
+
export type getStatsResponse429 = {
|
|
1557
|
+
data: RateLimitedResponse;
|
|
1558
|
+
status: 429;
|
|
1559
|
+
};
|
|
1560
|
+
export type getStatsResponse500 = {
|
|
1561
|
+
data: InternalErrorResponse;
|
|
1562
|
+
status: 500;
|
|
1563
|
+
};
|
|
1564
|
+
export type getStatsResponseSuccess = getStatsResponse200 & {
|
|
1565
|
+
headers: Headers;
|
|
1566
|
+
};
|
|
1567
|
+
export type getStatsResponseError = (getStatsResponse400 | getStatsResponse429 | getStatsResponse500) & {
|
|
1568
|
+
headers: Headers;
|
|
1569
|
+
};
|
|
1570
|
+
export type getStatsResponse = getStatsResponseSuccess | getStatsResponseError;
|
|
1571
|
+
export declare const getGetStatsUrl: (params?: GetStatsParams) => string;
|
|
1572
|
+
export declare const getStats: (params?: GetStatsParams, options?: RequestInit) => Promise<getStatsResponse>;
|
|
1573
|
+
/**
|
|
1574
|
+
* Returns the orders that belong to `address`, optionally filtered
|
|
1575
|
+
by status, symbol, market id, cloid, and creation time. The endpoint
|
|
1576
|
+
always returns an array — the empty array is the correct response
|
|
1577
|
+
for an address with no orders matching the filter, and the API
|
|
1578
|
+
deliberately never emits 404 here so SDK generators do not invent
|
|
1579
|
+
a not-found path. Malformed `address`, `symbol`, `market_id`, or
|
|
1580
|
+
`cloid` return 400.
|
|
1581
|
+
|
|
1008
1582
|
* @summary List orders for an address
|
|
1009
1583
|
*/
|
|
1010
1584
|
export type listOrdersResponse200 = {
|