ault-sdk-ts 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +209 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +196 -62
- package/dist/index.js.map +1 -1
- package/dist/rest/dex-types.generated.d.ts +73 -34
- package/dist/rest/dex.d.ts +2 -0
- package/dist/rest/dex.generated.d.ts +295 -69
- package/dist/rest/pagination.d.ts +45 -0
- package/package.json +1 -1
|
@@ -34,10 +34,11 @@ export declare const OrderInfoChainStatus: {
|
|
|
34
34
|
readonly unknown: "unknown";
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* Granular chain-level order type.
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
* Granular chain-level order type. Mirrors the dbindexer
|
|
38
|
+
`orders.order_type` column (0=limit, 1=market, 2=twap). TWAP
|
|
39
|
+
slice executions are stored as individual order rows and surface
|
|
40
|
+
here as `twap`. `unknown` is the fallback for a chain code the
|
|
41
|
+
API doesn't recognize.
|
|
41
42
|
|
|
42
43
|
*/
|
|
43
44
|
export type OrderInfoChainType = (typeof OrderInfoChainType)[keyof typeof OrderInfoChainType];
|
|
@@ -75,17 +76,23 @@ export interface OrderInfo {
|
|
|
75
76
|
chain code the API doesn't recognize.
|
|
76
77
|
*/
|
|
77
78
|
chain_status: OrderInfoChainStatus;
|
|
78
|
-
/** Granular chain-level order type.
|
|
79
|
-
`
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
/** Granular chain-level order type. Mirrors the dbindexer
|
|
80
|
+
`orders.order_type` column (0=limit, 1=market, 2=twap). TWAP
|
|
81
|
+
slice executions are stored as individual order rows and surface
|
|
82
|
+
here as `twap`. `unknown` is the fallback for a chain code the
|
|
83
|
+
API doesn't recognize.
|
|
82
84
|
*/
|
|
83
85
|
chain_type: OrderInfoChainType;
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
`
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Free-form chain close reason for a terminal order — e.g.
|
|
88
|
+
`completed`, `canceled`, `expired`, `ioc_canceled`,
|
|
89
|
+
`self_trade`, `post_only_rejected`, `replaced`. Null while the
|
|
90
|
+
order is still live. Lets consumers tell an IOC-cancelled or
|
|
91
|
+
self-trade-prevented close apart from the generic `canceled` close.
|
|
92
|
+
|
|
93
|
+
* @nullable
|
|
94
|
+
*/
|
|
95
|
+
close_reason: string | null;
|
|
89
96
|
}
|
|
90
97
|
/**
|
|
91
98
|
* Exchange-specific extension on `TradeResponse`. Mirrors the
|
|
@@ -111,12 +118,13 @@ export interface TradeInfo {
|
|
|
111
118
|
*/
|
|
112
119
|
block_height: string;
|
|
113
120
|
/**
|
|
114
|
-
* The trade's event position within its block.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
* The trade's event position within its block. With `block_height`
|
|
122
|
+
it forms the row's composite pagination cursor: pass the last
|
|
123
|
+
row's pair as `before_height`/`before_index` to fetch the next
|
|
124
|
+
(older) page.
|
|
118
125
|
|
|
119
126
|
* @minimum 0
|
|
127
|
+
* @maximum 4294967295
|
|
120
128
|
*/
|
|
121
129
|
event_index: number;
|
|
122
130
|
}
|
|
@@ -141,25 +149,31 @@ export interface MarketInfo {
|
|
|
141
149
|
export type HealthResponseStatus = (typeof HealthResponseStatus)[keyof typeof HealthResponseStatus];
|
|
142
150
|
export declare const HealthResponseStatus: {
|
|
143
151
|
readonly healthy: "healthy";
|
|
144
|
-
readonly unhealthy: "unhealthy";
|
|
145
|
-
};
|
|
146
|
-
export type HealthResponseDatabase = (typeof HealthResponseDatabase)[keyof typeof HealthResponseDatabase];
|
|
147
|
-
export declare const HealthResponseDatabase: {
|
|
148
|
-
readonly ok: "ok";
|
|
149
|
-
readonly unreachable: "unreachable";
|
|
150
152
|
};
|
|
151
153
|
export interface HealthResponse {
|
|
152
154
|
status: HealthResponseStatus;
|
|
153
|
-
database: HealthResponseDatabase;
|
|
154
155
|
}
|
|
155
156
|
export type ReadyResponseStatus = (typeof ReadyResponseStatus)[keyof typeof ReadyResponseStatus];
|
|
156
157
|
export declare const ReadyResponseStatus: {
|
|
157
158
|
readonly ready: "ready";
|
|
158
|
-
readonly not_ready: "not ready";
|
|
159
159
|
};
|
|
160
160
|
export interface ReadyResponse {
|
|
161
161
|
status: ReadyResponseStatus;
|
|
162
162
|
}
|
|
163
|
+
export type DBReadyResponseStatus = (typeof DBReadyResponseStatus)[keyof typeof DBReadyResponseStatus];
|
|
164
|
+
export declare const DBReadyResponseStatus: {
|
|
165
|
+
readonly ok: "ok";
|
|
166
|
+
readonly unavailable: "unavailable";
|
|
167
|
+
};
|
|
168
|
+
export type DBReadyResponseDatabase = (typeof DBReadyResponseDatabase)[keyof typeof DBReadyResponseDatabase];
|
|
169
|
+
export declare const DBReadyResponseDatabase: {
|
|
170
|
+
readonly ok: "ok";
|
|
171
|
+
readonly unreachable: "unreachable";
|
|
172
|
+
};
|
|
173
|
+
export interface DBReadyResponse {
|
|
174
|
+
status: DBReadyResponseStatus;
|
|
175
|
+
database: DBReadyResponseDatabase;
|
|
176
|
+
}
|
|
163
177
|
export type LiveResponseStatus = (typeof LiveResponseStatus)[keyof typeof LiveResponseStatus];
|
|
164
178
|
export declare const LiveResponseStatus: {
|
|
165
179
|
readonly alive: "alive";
|
|
@@ -307,9 +321,16 @@ export type CurrencyResponseLimits = {
|
|
|
307
321
|
export type CurrencyResponseNetworks = {
|
|
308
322
|
[key: string]: unknown;
|
|
309
323
|
};
|
|
310
|
-
export
|
|
311
|
-
|
|
312
|
-
|
|
324
|
+
export interface CurrencyInfo {
|
|
325
|
+
/**
|
|
326
|
+
* The token contract's own decimals (raw ERC20 decimals). Amounts
|
|
327
|
+
on the API are NOT in these units — see `precision`.
|
|
328
|
+
|
|
329
|
+
* @minimum 0
|
|
330
|
+
* @maximum 255
|
|
331
|
+
*/
|
|
332
|
+
contractDecimals: number;
|
|
333
|
+
}
|
|
313
334
|
export interface CurrencyResponse {
|
|
314
335
|
/** On-chain denom */
|
|
315
336
|
id: string;
|
|
@@ -324,10 +345,16 @@ export interface CurrencyResponse {
|
|
|
324
345
|
withdraw?: boolean | null;
|
|
325
346
|
/** @nullable */
|
|
326
347
|
fee?: number | null;
|
|
348
|
+
/** The DEX trading precision — always 18: every amount on every
|
|
349
|
+
endpoint (balances, orders, trades, portfolio) is normalized to
|
|
350
|
+
18-decimal units regardless of the token contract's own
|
|
351
|
+
decimals. The raw contract decimals are available in
|
|
352
|
+
`info.contractDecimals`.
|
|
353
|
+
*/
|
|
327
354
|
precision: number;
|
|
328
355
|
limits: CurrencyResponseLimits;
|
|
329
356
|
networks?: CurrencyResponseNetworks;
|
|
330
|
-
info:
|
|
357
|
+
info: CurrencyInfo;
|
|
331
358
|
}
|
|
332
359
|
export type TradingFeeResponseInfo = {
|
|
333
360
|
[key: string]: unknown;
|
|
@@ -351,6 +378,9 @@ export interface TradingFeeResponse {
|
|
|
351
378
|
export type StatsResponseWindow = (typeof StatsResponseWindow)[keyof typeof StatsResponseWindow];
|
|
352
379
|
export declare const StatsResponseWindow: {
|
|
353
380
|
readonly "24h": "24h";
|
|
381
|
+
readonly "7d": "7d";
|
|
382
|
+
readonly "30d": "30d";
|
|
383
|
+
readonly all: "all";
|
|
354
384
|
};
|
|
355
385
|
/**
|
|
356
386
|
* Protocol-wide aggregates for the window.
|
|
@@ -388,8 +418,9 @@ export interface StatsTotals {
|
|
|
388
418
|
/** Number of markets with at least one fill in the window. */
|
|
389
419
|
activeMarkets: number;
|
|
390
420
|
/**
|
|
391
|
-
* Distinct trading addresses
|
|
392
|
-
`traderCount
|
|
421
|
+
* Distinct trading addresses over 24 hours. An alias of
|
|
422
|
+
`traderCount` for the `24h` response and null for longer windows;
|
|
423
|
+
separate so a precise DAU source can diverge later.
|
|
393
424
|
|
|
394
425
|
* @nullable
|
|
395
426
|
*/
|
|
@@ -404,7 +435,7 @@ export interface StatsTotals {
|
|
|
404
435
|
*/
|
|
405
436
|
averageSlippageBps: string | null;
|
|
406
437
|
/**
|
|
407
|
-
*
|
|
438
|
+
* 24h USDC deposit volume when available; null for longer windows.
|
|
408
439
|
* @nullable
|
|
409
440
|
* @pattern ^-?\d+(\.\d+)?$
|
|
410
441
|
*/
|
|
@@ -537,7 +568,7 @@ export interface OrderbookResponse {
|
|
|
537
568
|
nonce: number;
|
|
538
569
|
}
|
|
539
570
|
/**
|
|
540
|
-
* 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.
|
|
571
|
+
* 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.
|
|
541
572
|
* @nullable
|
|
542
573
|
*/
|
|
543
574
|
export type TradeResponseType = (typeof TradeResponseType)[keyof typeof TradeResponseType] | null;
|
|
@@ -591,7 +622,7 @@ export interface TradeResponse {
|
|
|
591
622
|
datetime: string;
|
|
592
623
|
symbol: string;
|
|
593
624
|
/**
|
|
594
|
-
* 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.
|
|
625
|
+
* 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.
|
|
595
626
|
* @nullable
|
|
596
627
|
*/
|
|
597
628
|
type?: TradeResponseType;
|
|
@@ -627,7 +658,7 @@ export declare const OrderResponseStatus: {
|
|
|
627
658
|
readonly unknown: "unknown";
|
|
628
659
|
};
|
|
629
660
|
/**
|
|
630
|
-
* `unknown` is the fallback for a chain type code the API doesn't recognize.
|
|
661
|
+
* `unknown` is the fallback for a chain type code the API doesn't recognize. A `twap` row (chain order_type=2) is a TWAP slice execution — the TWAP parent lives in `twap_orders` and is not returned by the order endpoints.
|
|
631
662
|
*/
|
|
632
663
|
export type OrderResponseType = (typeof OrderResponseType)[keyof typeof OrderResponseType];
|
|
633
664
|
export declare const OrderResponseType: {
|
|
@@ -636,6 +667,18 @@ export declare const OrderResponseType: {
|
|
|
636
667
|
readonly twap: "twap";
|
|
637
668
|
readonly unknown: "unknown";
|
|
638
669
|
};
|
|
670
|
+
/**
|
|
671
|
+
* CCXT-collapsed time-in-force. `ioc` for an immediate-or-cancel
|
|
672
|
+
order (chain TIF code 1); null for the default (GTT/GTC) or an
|
|
673
|
+
unrecognized code. Always present (never omitted). The WS
|
|
674
|
+
`orderUpdates` payload exposes the same `ioc`-or-absent value.
|
|
675
|
+
|
|
676
|
+
* @nullable
|
|
677
|
+
*/
|
|
678
|
+
export type OrderResponseTimeInForce = (typeof OrderResponseTimeInForce)[keyof typeof OrderResponseTimeInForce] | null;
|
|
679
|
+
export declare const OrderResponseTimeInForce: {
|
|
680
|
+
readonly ioc: "ioc";
|
|
681
|
+
};
|
|
639
682
|
export type OrderResponseSide = (typeof OrderResponseSide)[keyof typeof OrderResponseSide];
|
|
640
683
|
export declare const OrderResponseSide: {
|
|
641
684
|
readonly buy: "buy";
|
|
@@ -689,10 +732,17 @@ export interface OrderResponse {
|
|
|
689
732
|
/** `unknown` is the fallback for a chain status code the API doesn't recognize. */
|
|
690
733
|
status: OrderResponseStatus;
|
|
691
734
|
symbol: string;
|
|
692
|
-
/** `unknown` is the fallback for a chain type code the API doesn't recognize. */
|
|
735
|
+
/** `unknown` is the fallback for a chain type code the API doesn't recognize. A `twap` row (chain order_type=2) is a TWAP slice execution — the TWAP parent lives in `twap_orders` and is not returned by the order endpoints. */
|
|
693
736
|
type: OrderResponseType;
|
|
694
|
-
/**
|
|
695
|
-
|
|
737
|
+
/**
|
|
738
|
+
* CCXT-collapsed time-in-force. `ioc` for an immediate-or-cancel
|
|
739
|
+
order (chain TIF code 1); null for the default (GTT/GTC) or an
|
|
740
|
+
unrecognized code. Always present (never omitted). The WS
|
|
741
|
+
`orderUpdates` payload exposes the same `ioc`-or-absent value.
|
|
742
|
+
|
|
743
|
+
* @nullable
|
|
744
|
+
*/
|
|
745
|
+
timeInForce: OrderResponseTimeInForce;
|
|
696
746
|
side: OrderResponseSide;
|
|
697
747
|
/** @pattern ^-?\d+(\.\d+)?$ */
|
|
698
748
|
price: string;
|
|
@@ -953,10 +1003,58 @@ export type BadRequestResponse = ErrorResponse;
|
|
|
953
1003
|
* Internal server error
|
|
954
1004
|
*/
|
|
955
1005
|
export type InternalErrorResponse = ErrorResponse;
|
|
1006
|
+
/**
|
|
1007
|
+
* Tickers unavailable (code `SERVICE_UNAVAILABLE`): the in-memory 24h
|
|
1008
|
+
window has not published a snapshot yet. Startup seeds the window
|
|
1009
|
+
before the server accepts traffic, so this only appears if every
|
|
1010
|
+
refresh since boot has failed. Retryable.
|
|
1011
|
+
|
|
1012
|
+
*/
|
|
1013
|
+
export type TickersUnavailableResponse = ErrorResponse;
|
|
1014
|
+
/**
|
|
1015
|
+
* Cursor pagination unavailable (code `SERVICE_UNAVAILABLE`): the
|
|
1016
|
+
database still holds trades rows that tie on
|
|
1017
|
+
(`block_height`, `event_index`) — the dbindexer `event_index`
|
|
1018
|
+
backfill has not run — so a cursor page would silently skip the
|
|
1019
|
+
tied rows. Only requests carrying `cursor` or
|
|
1020
|
+
`before_height`/`before_index` are refused; plain `since`/`limit`
|
|
1021
|
+
requests are unaffected.
|
|
1022
|
+
|
|
1023
|
+
*/
|
|
1024
|
+
export type CursorUnavailableResponse = ErrorResponse;
|
|
956
1025
|
/**
|
|
957
1026
|
* Rate limit exceeded
|
|
958
1027
|
*/
|
|
959
1028
|
export type RateLimitedResponse = ErrorResponse;
|
|
1029
|
+
/**
|
|
1030
|
+
* Opaque pagination cursor. Take it verbatim from the previous page's
|
|
1031
|
+
`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and
|
|
1032
|
+
repeat every other query parameter; the cursor is bound to that
|
|
1033
|
+
filter set and a different one is rejected with 400. `limit` may
|
|
1034
|
+
change between pages. No `X-Next-Cursor` on a response means the
|
|
1035
|
+
feed is exhausted. Clients must not build or parse cursors.
|
|
1036
|
+
|
|
1037
|
+
*/
|
|
1038
|
+
export type CursorParameter = string;
|
|
1039
|
+
/**
|
|
1040
|
+
* Deprecated in favour of `cursor`; still honoured, and ignored when
|
|
1041
|
+
`cursor` is also present.
|
|
1042
|
+
|
|
1043
|
+
Composite pagination cursor, upper half. Returns only trades
|
|
1044
|
+
strictly older (in feed order) than the row identified by
|
|
1045
|
+
(`before_height`, `before_index`) — take both values from the
|
|
1046
|
+
last row's `info.block_height` / `info.event_index`. Must be
|
|
1047
|
+
passed together with `before_index`. Unlike `since`, the cursor
|
|
1048
|
+
cannot skip or repeat trades when many share one timestamp.
|
|
1049
|
+
|
|
1050
|
+
* @deprecated
|
|
1051
|
+
*/
|
|
1052
|
+
export type BeforeHeightParameter = number;
|
|
1053
|
+
/**
|
|
1054
|
+
* Composite pagination cursor, lower half. See `before_height`.
|
|
1055
|
+
* @deprecated
|
|
1056
|
+
*/
|
|
1057
|
+
export type BeforeIndexParameter = number;
|
|
960
1058
|
export type RangeQueryParameter = (typeof RangeQueryParameter)[keyof typeof RangeQueryParameter];
|
|
961
1059
|
export declare const RangeQueryParameter: {
|
|
962
1060
|
readonly day: "day";
|
|
@@ -994,19 +1092,52 @@ export type ListTradesParams = {
|
|
|
994
1092
|
* Unix timestamp in milliseconds
|
|
995
1093
|
*/
|
|
996
1094
|
since?: number;
|
|
1095
|
+
/**
|
|
1096
|
+
* Opaque pagination cursor. Take it verbatim from the previous page's
|
|
1097
|
+
`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and
|
|
1098
|
+
repeat every other query parameter; the cursor is bound to that
|
|
1099
|
+
filter set and a different one is rejected with 400. `limit` may
|
|
1100
|
+
change between pages. No `X-Next-Cursor` on a response means the
|
|
1101
|
+
feed is exhausted. Clients must not build or parse cursors.
|
|
1102
|
+
|
|
1103
|
+
*/
|
|
1104
|
+
cursor?: CursorParameter;
|
|
1105
|
+
/**
|
|
1106
|
+
* Deprecated in favour of `cursor`; still honoured, and ignored when
|
|
1107
|
+
`cursor` is also present.
|
|
1108
|
+
|
|
1109
|
+
Composite pagination cursor, upper half. Returns only trades
|
|
1110
|
+
strictly older (in feed order) than the row identified by
|
|
1111
|
+
(`before_height`, `before_index`) — take both values from the
|
|
1112
|
+
last row's `info.block_height` / `info.event_index`. Must be
|
|
1113
|
+
passed together with `before_index`. Unlike `since`, the cursor
|
|
1114
|
+
cannot skip or repeat trades when many share one timestamp.
|
|
1115
|
+
|
|
1116
|
+
* @minimum 1
|
|
1117
|
+
*/
|
|
1118
|
+
before_height?: BeforeHeightParameter;
|
|
1119
|
+
/**
|
|
1120
|
+
* Composite pagination cursor, lower half. See `before_height`.
|
|
1121
|
+
* @minimum 0
|
|
1122
|
+
* @maximum 4294967295
|
|
1123
|
+
*/
|
|
1124
|
+
before_index?: BeforeIndexParameter;
|
|
997
1125
|
};
|
|
998
1126
|
export type GetTradingFees200 = {
|
|
999
1127
|
[key: string]: TradingFeeResponse;
|
|
1000
1128
|
};
|
|
1001
1129
|
export type GetStatsParams = {
|
|
1002
1130
|
/**
|
|
1003
|
-
*
|
|
1131
|
+
* Precomputed reporting window. Defaults to `24h`.
|
|
1004
1132
|
*/
|
|
1005
1133
|
window?: GetStatsWindow;
|
|
1006
1134
|
};
|
|
1007
1135
|
export type GetStatsWindow = (typeof GetStatsWindow)[keyof typeof GetStatsWindow];
|
|
1008
1136
|
export declare const GetStatsWindow: {
|
|
1009
1137
|
readonly "24h": "24h";
|
|
1138
|
+
readonly "7d": "7d";
|
|
1139
|
+
readonly "30d": "30d";
|
|
1140
|
+
readonly all: "all";
|
|
1010
1141
|
};
|
|
1011
1142
|
export type ListOrdersParams = {
|
|
1012
1143
|
/**
|
|
@@ -1045,9 +1176,19 @@ export type ListOrdersParams = {
|
|
|
1045
1176
|
since?: number;
|
|
1046
1177
|
/**
|
|
1047
1178
|
* @minimum 1
|
|
1048
|
-
* @maximum
|
|
1179
|
+
* @maximum 500
|
|
1049
1180
|
*/
|
|
1050
1181
|
limit?: number;
|
|
1182
|
+
/**
|
|
1183
|
+
* Opaque pagination cursor. Take it verbatim from the previous page's
|
|
1184
|
+
`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and
|
|
1185
|
+
repeat every other query parameter; the cursor is bound to that
|
|
1186
|
+
filter set and a different one is rejected with 400. `limit` may
|
|
1187
|
+
change between pages. No `X-Next-Cursor` on a response means the
|
|
1188
|
+
feed is exhausted. Clients must not build or parse cursors.
|
|
1189
|
+
|
|
1190
|
+
*/
|
|
1191
|
+
cursor?: CursorParameter;
|
|
1051
1192
|
};
|
|
1052
1193
|
export type ListOrdersStatus = (typeof ListOrdersStatus)[keyof typeof ListOrdersStatus];
|
|
1053
1194
|
export declare const ListOrdersStatus: {
|
|
@@ -1073,6 +1214,36 @@ export type ListMyTradesParams = {
|
|
|
1073
1214
|
* @maximum 500
|
|
1074
1215
|
*/
|
|
1075
1216
|
limit?: number;
|
|
1217
|
+
/**
|
|
1218
|
+
* Opaque pagination cursor. Take it verbatim from the previous page's
|
|
1219
|
+
`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and
|
|
1220
|
+
repeat every other query parameter; the cursor is bound to that
|
|
1221
|
+
filter set and a different one is rejected with 400. `limit` may
|
|
1222
|
+
change between pages. No `X-Next-Cursor` on a response means the
|
|
1223
|
+
feed is exhausted. Clients must not build or parse cursors.
|
|
1224
|
+
|
|
1225
|
+
*/
|
|
1226
|
+
cursor?: CursorParameter;
|
|
1227
|
+
/**
|
|
1228
|
+
* Deprecated in favour of `cursor`; still honoured, and ignored when
|
|
1229
|
+
`cursor` is also present.
|
|
1230
|
+
|
|
1231
|
+
Composite pagination cursor, upper half. Returns only trades
|
|
1232
|
+
strictly older (in feed order) than the row identified by
|
|
1233
|
+
(`before_height`, `before_index`) — take both values from the
|
|
1234
|
+
last row's `info.block_height` / `info.event_index`. Must be
|
|
1235
|
+
passed together with `before_index`. Unlike `since`, the cursor
|
|
1236
|
+
cannot skip or repeat trades when many share one timestamp.
|
|
1237
|
+
|
|
1238
|
+
* @minimum 1
|
|
1239
|
+
*/
|
|
1240
|
+
before_height?: BeforeHeightParameter;
|
|
1241
|
+
/**
|
|
1242
|
+
* Composite pagination cursor, lower half. See `before_height`.
|
|
1243
|
+
* @minimum 0
|
|
1244
|
+
* @maximum 4294967295
|
|
1245
|
+
*/
|
|
1246
|
+
before_index?: BeforeIndexParameter;
|
|
1076
1247
|
};
|
|
1077
1248
|
export type GetBalanceParams = {
|
|
1078
1249
|
address: string;
|
|
@@ -1083,14 +1254,29 @@ export type GetOHLCVParams = {
|
|
|
1083
1254
|
*/
|
|
1084
1255
|
timeframe?: string;
|
|
1085
1256
|
/**
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1257
|
+
* Bars per page, oldest first within the page. Without `since` the
|
|
1258
|
+
page holds the newest `limit` bars and the cursor walks back in
|
|
1259
|
+
time; with `since` it holds the first `limit` bars from `since`
|
|
1260
|
+
and the cursor walks forward.
|
|
1261
|
+
|
|
1262
|
+
* @minimum 1
|
|
1263
|
+
* @maximum 1000
|
|
1264
|
+
*/
|
|
1089
1265
|
limit?: number;
|
|
1090
1266
|
/**
|
|
1091
1267
|
* Unix timestamp in milliseconds
|
|
1092
1268
|
*/
|
|
1093
1269
|
since?: number;
|
|
1270
|
+
/**
|
|
1271
|
+
* Opaque pagination cursor. Take it verbatim from the previous page's
|
|
1272
|
+
`X-Next-Cursor` header (or follow the `Link: rel="next"` URL) and
|
|
1273
|
+
repeat every other query parameter; the cursor is bound to that
|
|
1274
|
+
filter set and a different one is rejected with 400. `limit` may
|
|
1275
|
+
change between pages. No `X-Next-Cursor` on a response means the
|
|
1276
|
+
feed is exhausted. Clients must not build or parse cursors.
|
|
1277
|
+
|
|
1278
|
+
*/
|
|
1279
|
+
cursor?: CursorParameter;
|
|
1094
1280
|
};
|
|
1095
1281
|
export type GetUDFSymbolParams = {
|
|
1096
1282
|
symbol: string;
|
|
@@ -1126,6 +1312,7 @@ export type GetUDFHistoryParams = {
|
|
|
1126
1312
|
*/
|
|
1127
1313
|
to: number;
|
|
1128
1314
|
/**
|
|
1315
|
+
* Values above 1000 are clamped to 1000 server-side.
|
|
1129
1316
|
* @minimum 1
|
|
1130
1317
|
* @maximum 1000
|
|
1131
1318
|
*/
|
|
@@ -1144,7 +1331,7 @@ export declare const GetUDFHistoryResolution: {
|
|
|
1144
1331
|
};
|
|
1145
1332
|
export type GetUDFQuotesParams = {
|
|
1146
1333
|
/**
|
|
1147
|
-
* Comma-separated list of symbols
|
|
1334
|
+
* Comma-separated list of symbols, at most 100 (400 above that)
|
|
1148
1335
|
*/
|
|
1149
1336
|
symbols: string;
|
|
1150
1337
|
};
|
|
@@ -1179,6 +1366,8 @@ export type GetUDFTimescaleMarksParams = {
|
|
|
1179
1366
|
resolution?: string;
|
|
1180
1367
|
};
|
|
1181
1368
|
/**
|
|
1369
|
+
* Reports that the process is up. Performs no dependency checks — DB reachability is exposed separately via /db-ready.
|
|
1370
|
+
|
|
1182
1371
|
* @summary Health check
|
|
1183
1372
|
*/
|
|
1184
1373
|
export type getHealthResponse200 = {
|
|
@@ -1189,20 +1378,18 @@ export type getHealthResponse429 = {
|
|
|
1189
1378
|
data: RateLimitedResponse;
|
|
1190
1379
|
status: 429;
|
|
1191
1380
|
};
|
|
1192
|
-
export type getHealthResponse503 = {
|
|
1193
|
-
data: void;
|
|
1194
|
-
status: 503;
|
|
1195
|
-
};
|
|
1196
1381
|
export type getHealthResponseSuccess = getHealthResponse200 & {
|
|
1197
1382
|
headers: Headers;
|
|
1198
1383
|
};
|
|
1199
|
-
export type getHealthResponseError =
|
|
1384
|
+
export type getHealthResponseError = getHealthResponse429 & {
|
|
1200
1385
|
headers: Headers;
|
|
1201
1386
|
};
|
|
1202
1387
|
export type getHealthResponse = getHealthResponseSuccess | getHealthResponseError;
|
|
1203
1388
|
export declare const getGetHealthUrl: () => string;
|
|
1204
1389
|
export declare const getHealth: (options?: RequestInit) => Promise<getHealthResponse>;
|
|
1205
1390
|
/**
|
|
1391
|
+
* K8s readiness probe. Always 200 once the process is serving; performs no dependency checks.
|
|
1392
|
+
|
|
1206
1393
|
* @summary Readiness probe
|
|
1207
1394
|
*/
|
|
1208
1395
|
export type getReadyResponse200 = {
|
|
@@ -1213,14 +1400,10 @@ export type getReadyResponse429 = {
|
|
|
1213
1400
|
data: RateLimitedResponse;
|
|
1214
1401
|
status: 429;
|
|
1215
1402
|
};
|
|
1216
|
-
export type getReadyResponse503 = {
|
|
1217
|
-
data: ReadyResponse;
|
|
1218
|
-
status: 503;
|
|
1219
|
-
};
|
|
1220
1403
|
export type getReadyResponseSuccess = getReadyResponse200 & {
|
|
1221
1404
|
headers: Headers;
|
|
1222
1405
|
};
|
|
1223
|
-
export type getReadyResponseError =
|
|
1406
|
+
export type getReadyResponseError = getReadyResponse429 & {
|
|
1224
1407
|
headers: Headers;
|
|
1225
1408
|
};
|
|
1226
1409
|
export type getReadyResponse = getReadyResponseSuccess | getReadyResponseError;
|
|
@@ -1246,6 +1429,32 @@ export type getLiveResponseError = getLiveResponse429 & {
|
|
|
1246
1429
|
export type getLiveResponse = getLiveResponseSuccess | getLiveResponseError;
|
|
1247
1430
|
export declare const getGetLiveUrl: () => string;
|
|
1248
1431
|
export declare const getLive: (options?: RequestInit) => Promise<getLiveResponse>;
|
|
1432
|
+
/**
|
|
1433
|
+
* Pings the database. Not wired into the k8s liveness/readiness probes; intended for manual or low-frequency monitoring use.
|
|
1434
|
+
|
|
1435
|
+
* @summary On-demand database connectivity check
|
|
1436
|
+
*/
|
|
1437
|
+
export type getDBReadyResponse200 = {
|
|
1438
|
+
data: DBReadyResponse;
|
|
1439
|
+
status: 200;
|
|
1440
|
+
};
|
|
1441
|
+
export type getDBReadyResponse429 = {
|
|
1442
|
+
data: RateLimitedResponse;
|
|
1443
|
+
status: 429;
|
|
1444
|
+
};
|
|
1445
|
+
export type getDBReadyResponse503 = {
|
|
1446
|
+
data: DBReadyResponse;
|
|
1447
|
+
status: 503;
|
|
1448
|
+
};
|
|
1449
|
+
export type getDBReadyResponseSuccess = getDBReadyResponse200 & {
|
|
1450
|
+
headers: Headers;
|
|
1451
|
+
};
|
|
1452
|
+
export type getDBReadyResponseError = (getDBReadyResponse429 | getDBReadyResponse503) & {
|
|
1453
|
+
headers: Headers;
|
|
1454
|
+
};
|
|
1455
|
+
export type getDBReadyResponse = getDBReadyResponseSuccess | getDBReadyResponseError;
|
|
1456
|
+
export declare const getGetDBReadyUrl: () => string;
|
|
1457
|
+
export declare const getDBReady: (options?: RequestInit) => Promise<getDBReadyResponse>;
|
|
1249
1458
|
/**
|
|
1250
1459
|
* @summary Get indexer sync status
|
|
1251
1460
|
*/
|
|
@@ -1371,10 +1580,14 @@ export type getTickerResponse500 = {
|
|
|
1371
1580
|
data: InternalErrorResponse;
|
|
1372
1581
|
status: 500;
|
|
1373
1582
|
};
|
|
1583
|
+
export type getTickerResponse503 = {
|
|
1584
|
+
data: TickersUnavailableResponse;
|
|
1585
|
+
status: 503;
|
|
1586
|
+
};
|
|
1374
1587
|
export type getTickerResponseSuccess = getTickerResponse200 & {
|
|
1375
1588
|
headers: Headers;
|
|
1376
1589
|
};
|
|
1377
|
-
export type getTickerResponseError = (getTickerResponse400 | getTickerResponse429 | getTickerResponse500) & {
|
|
1590
|
+
export type getTickerResponseError = (getTickerResponse400 | getTickerResponse429 | getTickerResponse500 | getTickerResponse503) & {
|
|
1378
1591
|
headers: Headers;
|
|
1379
1592
|
};
|
|
1380
1593
|
export type getTickerResponse = getTickerResponseSuccess | getTickerResponseError;
|
|
@@ -1395,10 +1608,14 @@ export type getAllTickersResponse500 = {
|
|
|
1395
1608
|
data: InternalErrorResponse;
|
|
1396
1609
|
status: 500;
|
|
1397
1610
|
};
|
|
1611
|
+
export type getAllTickersResponse503 = {
|
|
1612
|
+
data: TickersUnavailableResponse;
|
|
1613
|
+
status: 503;
|
|
1614
|
+
};
|
|
1398
1615
|
export type getAllTickersResponseSuccess = getAllTickersResponse200 & {
|
|
1399
1616
|
headers: Headers;
|
|
1400
1617
|
};
|
|
1401
|
-
export type getAllTickersResponseError = (getAllTickersResponse429 | getAllTickersResponse500) & {
|
|
1618
|
+
export type getAllTickersResponseError = (getAllTickersResponse429 | getAllTickersResponse500 | getAllTickersResponse503) & {
|
|
1402
1619
|
headers: Headers;
|
|
1403
1620
|
};
|
|
1404
1621
|
export type getAllTickersResponse = getAllTickersResponseSuccess | getAllTickersResponseError;
|
|
@@ -1451,10 +1668,14 @@ export type listTradesResponse500 = {
|
|
|
1451
1668
|
data: InternalErrorResponse;
|
|
1452
1669
|
status: 500;
|
|
1453
1670
|
};
|
|
1671
|
+
export type listTradesResponse503 = {
|
|
1672
|
+
data: CursorUnavailableResponse;
|
|
1673
|
+
status: 503;
|
|
1674
|
+
};
|
|
1454
1675
|
export type listTradesResponseSuccess = listTradesResponse200 & {
|
|
1455
1676
|
headers: Headers;
|
|
1456
1677
|
};
|
|
1457
|
-
export type listTradesResponseError = (listTradesResponse400 | listTradesResponse429 | listTradesResponse500) & {
|
|
1678
|
+
export type listTradesResponseError = (listTradesResponse400 | listTradesResponse429 | listTradesResponse500 | listTradesResponse503) & {
|
|
1458
1679
|
headers: Headers;
|
|
1459
1680
|
};
|
|
1460
1681
|
export type listTradesResponse = listTradesResponseSuccess | listTradesResponseError;
|
|
@@ -1535,19 +1756,20 @@ export type getTradingFeesResponse = getTradingFeesResponseSuccess | getTradingF
|
|
|
1535
1756
|
export declare const getGetTradingFeesUrl: () => string;
|
|
1536
1757
|
export declare const getTradingFees: (options?: RequestInit) => Promise<getTradingFeesResponse>;
|
|
1537
1758
|
/**
|
|
1538
|
-
* Protocol-wide stats overview for a
|
|
1539
|
-
estimated fees, trade/trader counts, active markets,
|
|
1540
|
-
|
|
1759
|
+
* Protocol-wide stats overview for a selected reporting window: quote
|
|
1760
|
+
volume, estimated fees, trade/trader counts, active markets, average
|
|
1761
|
+
taker slippage, and a per-market breakdown.
|
|
1541
1762
|
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
`traderCount
|
|
1763
|
+
Every supported window is assembled by the precompute worker from its
|
|
1764
|
+
hourly/daily rollups; the API never scans trade history on the request
|
|
1765
|
+
path. `estimatedFee` is `quoteVolume × takerFeeRate` (an estimate, not
|
|
1766
|
+
booked revenue). `dailyActiveUsers` aliases `traderCount` for `24h`
|
|
1767
|
+
and is null for longer windows. `quoteVolume`/`estimatedFee`/`quoteAsset` and
|
|
1546
1768
|
`averageSlippageBps` are null when contributors span more than one
|
|
1547
|
-
quote asset. `depositUsdcVolume24h`
|
|
1548
|
-
|
|
1549
|
-
the rest cover symbol-mapped
|
|
1550
|
-
during symbol-map lag.
|
|
1769
|
+
quote asset. `depositUsdcVolume24h` applies only to `24h` and is null
|
|
1770
|
+
for longer windows; `builderCodesFee24h` remains reserved and null.
|
|
1771
|
+
`tradeCount`/`traderCount` are book-wide; the rest cover symbol-mapped
|
|
1772
|
+
markets, so the two need not reconcile during symbol-map lag.
|
|
1551
1773
|
|
|
1552
1774
|
* @summary Protocol stats overview
|
|
1553
1775
|
*/
|
|
@@ -1668,10 +1890,14 @@ export type listMyTradesResponse500 = {
|
|
|
1668
1890
|
data: InternalErrorResponse;
|
|
1669
1891
|
status: 500;
|
|
1670
1892
|
};
|
|
1893
|
+
export type listMyTradesResponse503 = {
|
|
1894
|
+
data: CursorUnavailableResponse;
|
|
1895
|
+
status: 503;
|
|
1896
|
+
};
|
|
1671
1897
|
export type listMyTradesResponseSuccess = listMyTradesResponse200 & {
|
|
1672
1898
|
headers: Headers;
|
|
1673
1899
|
};
|
|
1674
|
-
export type listMyTradesResponseError = (listMyTradesResponse400 | listMyTradesResponse429 | listMyTradesResponse500) & {
|
|
1900
|
+
export type listMyTradesResponseError = (listMyTradesResponse400 | listMyTradesResponse429 | listMyTradesResponse500 | listMyTradesResponse503) & {
|
|
1675
1901
|
headers: Headers;
|
|
1676
1902
|
};
|
|
1677
1903
|
export type listMyTradesResponse = listMyTradesResponseSuccess | listMyTradesResponseError;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Response header carrying the next page's cursor. Absent on the last page. */
|
|
2
|
+
export declare const NEXT_CURSOR_HEADER = "X-Next-Cursor";
|
|
3
|
+
/**
|
|
4
|
+
* One page of a cursor-paginated feed. `nextCursor` is the resumption point:
|
|
5
|
+
* persist it and pass it back as `cursor` to continue the walk later. `null`
|
|
6
|
+
* means the feed is exhausted.
|
|
7
|
+
*/
|
|
8
|
+
export interface CursorPage<T> {
|
|
9
|
+
rows: T[];
|
|
10
|
+
nextCursor: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** The shape every orval-generated list function resolves to. */
|
|
13
|
+
interface PagedResponse {
|
|
14
|
+
data: unknown;
|
|
15
|
+
status: number;
|
|
16
|
+
headers: Headers;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Walks a cursor-paginated dex-api list endpoint, yielding one page (a bare
|
|
20
|
+
* row array) at a time. Pages, not items, and a generator, not a fetch-all:
|
|
21
|
+
* these feeds are unbounded, so the caller stops on its own condition —
|
|
22
|
+
* enough rows, a timestamp reached, a match found — with `break`.
|
|
23
|
+
*
|
|
24
|
+
* `fetchPage` is a closure over the generated function, e.g.
|
|
25
|
+
* `(p) => api.listMyTrades({ address, ...p })`. Every page repeats the
|
|
26
|
+
* caller's filters; only `cursor` changes between requests. A caller-supplied
|
|
27
|
+
* `params.cursor` resumes a previous walk.
|
|
28
|
+
*/
|
|
29
|
+
export declare function paginate<T>(fetchPage: (params: {
|
|
30
|
+
cursor?: string;
|
|
31
|
+
}) => Promise<PagedResponse>, params?: {
|
|
32
|
+
cursor?: string;
|
|
33
|
+
}): AsyncGenerator<CursorPage<T>, void, void>;
|
|
34
|
+
/**
|
|
35
|
+
* Collects pages into one flat array, stopping at `max` rows. `max` is
|
|
36
|
+
* required on purpose: an unbounded collect against a busy account is a way
|
|
37
|
+
* to exhaust memory, and a caller that truly wants everything can say so
|
|
38
|
+
* with a number.
|
|
39
|
+
*/
|
|
40
|
+
export declare function collectPages<T>(fetchPage: (params: {
|
|
41
|
+
cursor?: string;
|
|
42
|
+
}) => Promise<PagedResponse>, max: number, params?: {
|
|
43
|
+
cursor?: string;
|
|
44
|
+
}): Promise<T[]>;
|
|
45
|
+
export {};
|