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