@polyester/sdk 0.35.0-devnet-20261111140253 → 0.35.0-devnet-20261112024759

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 (152) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/dist/client.d.ts +6 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +6 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/gen/ai/v1/assistant_pb.d.ts +2 -2
  7. package/dist/gen/ai/v1/assistant_pb.js +2 -2
  8. package/dist/gen/index.d.ts +11 -11
  9. package/dist/gen/index.js +9 -9
  10. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +1 -1
  11. package/dist/gen/orders/v1/orders_read_pb.d.ts +1 -1
  12. package/dist/index.d.ts +10 -2
  13. package/dist/services/accounts/accounts.d.ts +1 -1
  14. package/dist/services/accounts/accounts.js +1 -1
  15. package/dist/services/accounts/accounts.js.map +1 -1
  16. package/dist/services/address-book/address-book.schemas.d.ts +2 -2
  17. package/dist/services/api-keys/api-keys.d.ts +18 -3
  18. package/dist/services/api-keys/api-keys.d.ts.map +1 -1
  19. package/dist/services/api-keys/api-keys.js +27 -3
  20. package/dist/services/api-keys/api-keys.js.map +1 -1
  21. package/dist/services/api-keys/api-keys.schemas.d.ts +112 -1
  22. package/dist/services/api-keys/api-keys.schemas.d.ts.map +1 -1
  23. package/dist/services/api-keys/api-keys.schemas.js +26 -2
  24. package/dist/services/api-keys/api-keys.schemas.js.map +1 -1
  25. package/dist/services/api-keys/api-keys.types.d.ts +2 -2
  26. package/dist/services/api-keys/index.d.ts +2 -2
  27. package/dist/services/assistant/assistant-events.schemas.d.ts +4646 -0
  28. package/dist/services/assistant/assistant-events.schemas.d.ts.map +1 -0
  29. package/dist/services/assistant/assistant-events.schemas.js +485 -0
  30. package/dist/services/assistant/assistant-events.schemas.js.map +1 -0
  31. package/dist/services/assistant/assistant.codecs.d.ts +24 -0
  32. package/dist/services/assistant/assistant.codecs.d.ts.map +1 -0
  33. package/dist/services/assistant/assistant.codecs.js +88 -0
  34. package/dist/services/assistant/assistant.codecs.js.map +1 -0
  35. package/dist/services/assistant/assistant.d.ts +76 -0
  36. package/dist/services/assistant/assistant.d.ts.map +1 -0
  37. package/dist/services/assistant/assistant.js +133 -0
  38. package/dist/services/assistant/assistant.js.map +1 -0
  39. package/dist/services/assistant/assistant.schemas.d.ts +184 -0
  40. package/dist/services/assistant/assistant.schemas.d.ts.map +1 -0
  41. package/dist/services/assistant/assistant.schemas.js +135 -0
  42. package/dist/services/assistant/assistant.schemas.js.map +1 -0
  43. package/dist/services/assistant/assistant.types.d.ts +4 -0
  44. package/dist/services/assistant/service.d.ts +8 -0
  45. package/dist/services/assistant/service.d.ts.map +1 -0
  46. package/dist/services/assistant/service.js +9 -0
  47. package/dist/services/assistant/service.js.map +1 -0
  48. package/dist/services/auth/profile/profile.d.ts +2 -2
  49. package/dist/services/auth/profile/profile.js +2 -2
  50. package/dist/services/auth/profile/profile.js.map +1 -1
  51. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +19 -19
  52. package/dist/services/auto-withdraw/auto-withdraw.schemas.js +1 -1
  53. package/dist/services/balances/balances.js +1 -1
  54. package/dist/services/candles/candles.js +1 -1
  55. package/dist/services/candles/candles.schemas.js +5 -2
  56. package/dist/services/candles/candles.schemas.js.map +1 -1
  57. package/dist/services/changelog/changelog.schemas.d.ts +17 -17
  58. package/dist/services/checkpoints/checkpoints.d.ts +2 -2
  59. package/dist/services/checkpoints/checkpoints.js +2 -2
  60. package/dist/services/checkpoints/checkpoints.js.map +1 -1
  61. package/dist/services/checkpoints/checkpoints.schemas.d.ts +2 -2
  62. package/dist/services/deposit/deposit.d.ts +2 -2
  63. package/dist/services/deposit/deposit.js +2 -2
  64. package/dist/services/deposit/deposit.js.map +1 -1
  65. package/dist/services/guard-signer/guard-signer.d.ts +1 -1
  66. package/dist/services/guard-signer/guard-signer.js +1 -1
  67. package/dist/services/guard-signer/guard-signer.js.map +1 -1
  68. package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
  69. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +3 -3
  70. package/dist/services/lifecycle/lifecycle.schemas.d.ts +54 -54
  71. package/dist/services/market-data/market-data.js +1 -1
  72. package/dist/services/market-overview/market-overview.schemas.d.ts +1 -1
  73. package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
  74. package/dist/services/orders/order-errors.schemas.d.ts +1 -1
  75. package/dist/services/orders/orders-batch.schemas.d.ts +32 -32
  76. package/dist/services/orders/orders-input.schemas.d.ts +4 -4
  77. package/dist/services/orders/orders-input.schemas.js +1 -1
  78. package/dist/services/orders/orders-modify.schemas.js +1 -1
  79. package/dist/services/orders/orders-output.schemas.d.ts +25 -25
  80. package/dist/services/orders/orders-output.schemas.js +3 -3
  81. package/dist/services/orders/orders-risk.schemas.js +1 -1
  82. package/dist/services/orders/orders.codecs.js +1 -1
  83. package/dist/services/orders/orders.js +3 -3
  84. package/dist/services/policies/api-key-policies/api-key-policies.d.ts +2 -2
  85. package/dist/services/policies/api-key-policies/api-key-policies.js +2 -2
  86. package/dist/services/policies/api-key-policies/api-key-policies.js.map +1 -1
  87. package/dist/services/policies/subaccount-policies/subaccount-policies.d.ts +2 -2
  88. package/dist/services/policies/subaccount-policies/subaccount-policies.js +2 -2
  89. package/dist/services/policies/subaccount-policies/subaccount-policies.js.map +1 -1
  90. package/dist/services/price-alerts/price-alerts.codecs.d.ts +20 -0
  91. package/dist/services/price-alerts/price-alerts.codecs.d.ts.map +1 -0
  92. package/dist/services/price-alerts/price-alerts.codecs.js +66 -0
  93. package/dist/services/price-alerts/price-alerts.codecs.js.map +1 -0
  94. package/dist/services/price-alerts/price-alerts.d.ts +38 -0
  95. package/dist/services/price-alerts/price-alerts.d.ts.map +1 -0
  96. package/dist/services/price-alerts/price-alerts.js +60 -0
  97. package/dist/services/price-alerts/price-alerts.js.map +1 -0
  98. package/dist/services/price-alerts/price-alerts.schemas.d.ts +309 -0
  99. package/dist/services/price-alerts/price-alerts.schemas.d.ts.map +1 -0
  100. package/dist/services/price-alerts/price-alerts.schemas.js +130 -0
  101. package/dist/services/price-alerts/price-alerts.schemas.js.map +1 -0
  102. package/dist/services/price-alerts/price-alerts.types.d.ts +3 -0
  103. package/dist/services/price-alerts/service.d.ts +8 -0
  104. package/dist/services/price-alerts/service.d.ts.map +1 -0
  105. package/dist/services/price-alerts/service.js +9 -0
  106. package/dist/services/price-alerts/service.js.map +1 -0
  107. package/dist/services/rewards/rewards.schemas.d.ts +4 -4
  108. package/dist/services/social-verification/social-verification.d.ts +1 -1
  109. package/dist/services/social-verification/social-verification.js +1 -1
  110. package/dist/services/social-verification/social-verification.js.map +1 -1
  111. package/dist/services/subaccounts/subaccounts.d.ts +6 -6
  112. package/dist/services/subaccounts/subaccounts.js +6 -6
  113. package/dist/services/subaccounts/subaccounts.js.map +1 -1
  114. package/dist/services/subaccounts/subaccounts.schemas.d.ts +21 -21
  115. package/dist/services/system/service.d.ts +8 -0
  116. package/dist/services/system/service.d.ts.map +1 -0
  117. package/dist/services/system/service.js +9 -0
  118. package/dist/services/system/service.js.map +1 -0
  119. package/dist/services/system/system.d.ts +25 -0
  120. package/dist/services/system/system.d.ts.map +1 -0
  121. package/dist/services/system/system.js +24 -0
  122. package/dist/services/system/system.js.map +1 -0
  123. package/dist/services/trades/trades.js +1 -1
  124. package/dist/services/trades/trades.schemas.d.ts +2 -2
  125. package/dist/services/trades/trades.schemas.js +1 -1
  126. package/dist/services/trading-withdraws/trading-withdraws.d.ts +1 -1
  127. package/dist/services/trading-withdraws/trading-withdraws.js +1 -1
  128. package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
  129. package/dist/services/triggers/trigger-child-order.schemas.js +1 -1
  130. package/dist/services/triggers/trigger-input.schemas.d.ts +1 -1
  131. package/dist/services/triggers/trigger-input.schemas.js +1 -1
  132. package/dist/services/triggers/triggers-output.schemas.d.ts +63 -63
  133. package/dist/services/triggers/triggers.codecs.js +1 -1
  134. package/dist/services/triggers/triggers.js +2 -2
  135. package/dist/services/vip/vip.d.ts +1 -1
  136. package/dist/services/vip/vip.js +1 -1
  137. package/dist/services/vip/vip.js.map +1 -1
  138. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  139. package/dist/shared/connect-error-mapping.js +1 -0
  140. package/dist/shared/connect-error-mapping.js.map +1 -1
  141. package/dist/shared/error-detail.d.ts +18 -10
  142. package/dist/shared/error-detail.d.ts.map +1 -1
  143. package/dist/shared/error-detail.js +2 -0
  144. package/dist/shared/error-detail.js.map +1 -1
  145. package/dist/shared/error-details/alerts.js +15 -0
  146. package/dist/shared/error-details/alerts.js.map +1 -0
  147. package/dist/shared/error-details/assistant.js +15 -0
  148. package/dist/shared/error-details/assistant.js.map +1 -0
  149. package/dist/wired-services.d.ts.map +1 -1
  150. package/dist/wired-services.js +11 -5
  151. package/dist/wired-services.js.map +1 -1
  152. package/package.json +1 -1
@@ -0,0 +1,4646 @@
1
+ import { ApprovalRequested, OrderPreview, RunEvent, View } from "../../gen/ai/v1/assistant_pb.js";
2
+ import { DecodedEnum } from "../../utils/types.js";
3
+ import { SdkScales } from "../../shared/decimal-surface.js";
4
+ import { EquitySeriesGrouping } from "../balances/balances.schemas.js";
5
+ import { MarketMaxSlippage } from "../orders/orders-risk.schemas.js";
6
+ import { TriggerDetailsOutput } from "../triggers/triggers-output.schemas.js";
7
+ //#region src/services/assistant/assistant-events.schemas.d.ts
8
+ declare function formatOrderPreview(o: OrderPreview): {
9
+ symbolId: number;
10
+ symbol: string;
11
+ baseAsset: string;
12
+ quoteAsset: string;
13
+ side: "unspecified" | "buy" | "sell";
14
+ quantity: string | undefined;
15
+ quoteAmount: string | undefined;
16
+ estimatedValue: string | undefined;
17
+ reservedAmount: string | undefined;
18
+ referencePrice: {
19
+ price: string;
20
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
21
+ observedAt: number | undefined;
22
+ } | undefined;
23
+ /** The order type and its own values; `type: "unspecified"` means show the summary only. */
24
+ order: {
25
+ type: "market";
26
+ maxSlippageBps: number | undefined;
27
+ attached: {
28
+ takeProfit: {
29
+ triggerPrice: string;
30
+ limitPrice: string | undefined;
31
+ } | undefined;
32
+ stopLoss: {
33
+ triggerPrice: string;
34
+ limitPrice: string | undefined;
35
+ } | undefined;
36
+ trailingStop: {
37
+ trailingDistance: {
38
+ kind: "distance";
39
+ distance: string;
40
+ bps?: undefined;
41
+ } | {
42
+ kind: "bps";
43
+ bps: number;
44
+ distance?: undefined;
45
+ } | {
46
+ kind: "unspecified";
47
+ distance?: undefined;
48
+ bps?: undefined;
49
+ };
50
+ activationPrice: string | undefined;
51
+ limitPrice: string | undefined;
52
+ } | undefined;
53
+ oco: boolean;
54
+ } | undefined;
55
+ price?: undefined;
56
+ timeInForce?: undefined;
57
+ expireAt?: undefined;
58
+ postOnly?: undefined;
59
+ trailingDistance?: undefined;
60
+ activationPrice?: undefined;
61
+ triggerPriceSource?: undefined;
62
+ limitPrice?: undefined;
63
+ fundsReserved?: undefined;
64
+ durationMs?: undefined;
65
+ sliceIntervalMs?: undefined;
66
+ sliceCount?: undefined;
67
+ sliceQuantity?: undefined;
68
+ unfilledSlicePolicy?: undefined;
69
+ firstSliceImmediate?: undefined;
70
+ lowPrice?: undefined;
71
+ highPrice?: undefined;
72
+ levels?: undefined;
73
+ allLevelsAtOnce?: undefined;
74
+ } | {
75
+ type: "limit";
76
+ price: string;
77
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
78
+ expireAt: number | undefined;
79
+ postOnly: boolean;
80
+ attached: {
81
+ takeProfit: {
82
+ triggerPrice: string;
83
+ limitPrice: string | undefined;
84
+ } | undefined;
85
+ stopLoss: {
86
+ triggerPrice: string;
87
+ limitPrice: string | undefined;
88
+ } | undefined;
89
+ trailingStop: {
90
+ trailingDistance: {
91
+ kind: "distance";
92
+ distance: string;
93
+ bps?: undefined;
94
+ } | {
95
+ kind: "bps";
96
+ bps: number;
97
+ distance?: undefined;
98
+ } | {
99
+ kind: "unspecified";
100
+ distance?: undefined;
101
+ bps?: undefined;
102
+ };
103
+ activationPrice: string | undefined;
104
+ limitPrice: string | undefined;
105
+ } | undefined;
106
+ oco: boolean;
107
+ } | undefined;
108
+ maxSlippageBps?: undefined;
109
+ trailingDistance?: undefined;
110
+ activationPrice?: undefined;
111
+ triggerPriceSource?: undefined;
112
+ limitPrice?: undefined;
113
+ fundsReserved?: undefined;
114
+ durationMs?: undefined;
115
+ sliceIntervalMs?: undefined;
116
+ sliceCount?: undefined;
117
+ sliceQuantity?: undefined;
118
+ unfilledSlicePolicy?: undefined;
119
+ firstSliceImmediate?: undefined;
120
+ lowPrice?: undefined;
121
+ highPrice?: undefined;
122
+ levels?: undefined;
123
+ allLevelsAtOnce?: undefined;
124
+ } | {
125
+ triggerPrice: string;
126
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
127
+ direction: "unspecified" | "at_or_above" | "at_or_below";
128
+ limitPrice: string | undefined;
129
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
130
+ postOnly: boolean;
131
+ maxSlippageBps: number | undefined;
132
+ fundsReserved: boolean;
133
+ type: "stop_loss";
134
+ attached?: undefined;
135
+ price?: undefined;
136
+ expireAt?: undefined;
137
+ trailingDistance?: undefined;
138
+ activationPrice?: undefined;
139
+ durationMs?: undefined;
140
+ sliceIntervalMs?: undefined;
141
+ sliceCount?: undefined;
142
+ sliceQuantity?: undefined;
143
+ unfilledSlicePolicy?: undefined;
144
+ firstSliceImmediate?: undefined;
145
+ lowPrice?: undefined;
146
+ highPrice?: undefined;
147
+ levels?: undefined;
148
+ allLevelsAtOnce?: undefined;
149
+ } | {
150
+ triggerPrice: string;
151
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
152
+ direction: "unspecified" | "at_or_above" | "at_or_below";
153
+ limitPrice: string | undefined;
154
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
155
+ postOnly: boolean;
156
+ maxSlippageBps: number | undefined;
157
+ fundsReserved: boolean;
158
+ type: "take_profit";
159
+ attached?: undefined;
160
+ price?: undefined;
161
+ expireAt?: undefined;
162
+ trailingDistance?: undefined;
163
+ activationPrice?: undefined;
164
+ durationMs?: undefined;
165
+ sliceIntervalMs?: undefined;
166
+ sliceCount?: undefined;
167
+ sliceQuantity?: undefined;
168
+ unfilledSlicePolicy?: undefined;
169
+ firstSliceImmediate?: undefined;
170
+ lowPrice?: undefined;
171
+ highPrice?: undefined;
172
+ levels?: undefined;
173
+ allLevelsAtOnce?: undefined;
174
+ } | {
175
+ type: "trailing_stop";
176
+ trailingDistance: {
177
+ kind: "distance";
178
+ distance: string;
179
+ bps?: undefined;
180
+ } | {
181
+ kind: "bps";
182
+ bps: number;
183
+ distance?: undefined;
184
+ } | {
185
+ kind: "unspecified";
186
+ distance?: undefined;
187
+ bps?: undefined;
188
+ };
189
+ activationPrice: string | undefined;
190
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
191
+ limitPrice: string | undefined;
192
+ maxSlippageBps: number | undefined;
193
+ fundsReserved: boolean;
194
+ attached?: undefined;
195
+ price?: undefined;
196
+ timeInForce?: undefined;
197
+ expireAt?: undefined;
198
+ postOnly?: undefined;
199
+ durationMs?: undefined;
200
+ sliceIntervalMs?: undefined;
201
+ sliceCount?: undefined;
202
+ sliceQuantity?: undefined;
203
+ unfilledSlicePolicy?: undefined;
204
+ firstSliceImmediate?: undefined;
205
+ lowPrice?: undefined;
206
+ highPrice?: undefined;
207
+ levels?: undefined;
208
+ allLevelsAtOnce?: undefined;
209
+ } | {
210
+ type: "twap";
211
+ durationMs: number;
212
+ sliceIntervalMs: number;
213
+ sliceCount: number;
214
+ sliceQuantity: string;
215
+ limitPrice: string | undefined;
216
+ maxSlippageBps: number | undefined;
217
+ unfilledSlicePolicy: "unspecified" | "cancel_before_next";
218
+ firstSliceImmediate: boolean;
219
+ attached?: undefined;
220
+ price?: undefined;
221
+ timeInForce?: undefined;
222
+ expireAt?: undefined;
223
+ postOnly?: undefined;
224
+ trailingDistance?: undefined;
225
+ activationPrice?: undefined;
226
+ triggerPriceSource?: undefined;
227
+ fundsReserved?: undefined;
228
+ lowPrice?: undefined;
229
+ highPrice?: undefined;
230
+ levels?: undefined;
231
+ allLevelsAtOnce?: undefined;
232
+ } | {
233
+ type: "ladder";
234
+ lowPrice: string;
235
+ highPrice: string;
236
+ levels: {
237
+ price: string;
238
+ quantity: string;
239
+ }[];
240
+ postOnly: boolean;
241
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
242
+ allLevelsAtOnce: boolean;
243
+ maxSlippageBps?: undefined;
244
+ attached?: undefined;
245
+ price?: undefined;
246
+ expireAt?: undefined;
247
+ trailingDistance?: undefined;
248
+ activationPrice?: undefined;
249
+ triggerPriceSource?: undefined;
250
+ limitPrice?: undefined;
251
+ fundsReserved?: undefined;
252
+ durationMs?: undefined;
253
+ sliceIntervalMs?: undefined;
254
+ sliceCount?: undefined;
255
+ sliceQuantity?: undefined;
256
+ unfilledSlicePolicy?: undefined;
257
+ firstSliceImmediate?: undefined;
258
+ } | {
259
+ type: "unspecified";
260
+ maxSlippageBps?: undefined;
261
+ attached?: undefined;
262
+ price?: undefined;
263
+ timeInForce?: undefined;
264
+ expireAt?: undefined;
265
+ postOnly?: undefined;
266
+ trailingDistance?: undefined;
267
+ activationPrice?: undefined;
268
+ triggerPriceSource?: undefined;
269
+ limitPrice?: undefined;
270
+ fundsReserved?: undefined;
271
+ durationMs?: undefined;
272
+ sliceIntervalMs?: undefined;
273
+ sliceCount?: undefined;
274
+ sliceQuantity?: undefined;
275
+ unfilledSlicePolicy?: undefined;
276
+ firstSliceImmediate?: undefined;
277
+ lowPrice?: undefined;
278
+ highPrice?: undefined;
279
+ levels?: undefined;
280
+ allLevelsAtOnce?: undefined;
281
+ };
282
+ relativePrices: {
283
+ field: "unspecified" | "limit_price" | "trigger_price" | "activation_price" | "ladder_low_price" | "ladder_high_price" | "take_profit_trigger_price" | "take_profit_limit_price" | "stop_loss_trigger_price" | "stop_loss_limit_price" | "trailing_stop_activation_price" | "trailing_stop_limit_price";
284
+ /** The resolved absolute price the order carries. */
285
+ price: string;
286
+ direction: "unspecified" | "above" | "below";
287
+ offsetBps: number;
288
+ reference: {
289
+ price: string;
290
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
291
+ observedAt: number | undefined;
292
+ type: "market";
293
+ } | {
294
+ type: "limit_price";
295
+ price: string;
296
+ } | {
297
+ type: "unspecified";
298
+ price?: undefined;
299
+ };
300
+ rounding: "unspecified" | "down" | "up";
301
+ tickSize: string;
302
+ }[];
303
+ };
304
+ type AssistantOrderPreview = ReturnType<typeof formatOrderPreview>;
305
+ declare function formatApprovalPreview(p: ApprovalRequested["preview"]): {
306
+ symbolId: number;
307
+ symbol: string;
308
+ baseAsset: string;
309
+ quoteAsset: string;
310
+ side: "unspecified" | "buy" | "sell";
311
+ quantity: string | undefined;
312
+ quoteAmount: string | undefined;
313
+ estimatedValue: string | undefined;
314
+ reservedAmount: string | undefined;
315
+ referencePrice: {
316
+ price: string;
317
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
318
+ observedAt: number | undefined;
319
+ } | undefined;
320
+ /** The order type and its own values; `type: "unspecified"` means show the summary only. */
321
+ order: {
322
+ type: "market";
323
+ maxSlippageBps: number | undefined;
324
+ attached: {
325
+ takeProfit: {
326
+ triggerPrice: string;
327
+ limitPrice: string | undefined;
328
+ } | undefined;
329
+ stopLoss: {
330
+ triggerPrice: string;
331
+ limitPrice: string | undefined;
332
+ } | undefined;
333
+ trailingStop: {
334
+ trailingDistance: {
335
+ kind: "distance";
336
+ distance: string;
337
+ bps?: undefined;
338
+ } | {
339
+ kind: "bps";
340
+ bps: number;
341
+ distance?: undefined;
342
+ } | {
343
+ kind: "unspecified";
344
+ distance?: undefined;
345
+ bps?: undefined;
346
+ };
347
+ activationPrice: string | undefined;
348
+ limitPrice: string | undefined;
349
+ } | undefined;
350
+ oco: boolean;
351
+ } | undefined;
352
+ price?: undefined;
353
+ timeInForce?: undefined;
354
+ expireAt?: undefined;
355
+ postOnly?: undefined;
356
+ trailingDistance?: undefined;
357
+ activationPrice?: undefined;
358
+ triggerPriceSource?: undefined;
359
+ limitPrice?: undefined;
360
+ fundsReserved?: undefined;
361
+ durationMs?: undefined;
362
+ sliceIntervalMs?: undefined;
363
+ sliceCount?: undefined;
364
+ sliceQuantity?: undefined;
365
+ unfilledSlicePolicy?: undefined;
366
+ firstSliceImmediate?: undefined;
367
+ lowPrice?: undefined;
368
+ highPrice?: undefined;
369
+ levels?: undefined;
370
+ allLevelsAtOnce?: undefined;
371
+ } | {
372
+ type: "limit";
373
+ price: string;
374
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
375
+ expireAt: number | undefined;
376
+ postOnly: boolean;
377
+ attached: {
378
+ takeProfit: {
379
+ triggerPrice: string;
380
+ limitPrice: string | undefined;
381
+ } | undefined;
382
+ stopLoss: {
383
+ triggerPrice: string;
384
+ limitPrice: string | undefined;
385
+ } | undefined;
386
+ trailingStop: {
387
+ trailingDistance: {
388
+ kind: "distance";
389
+ distance: string;
390
+ bps?: undefined;
391
+ } | {
392
+ kind: "bps";
393
+ bps: number;
394
+ distance?: undefined;
395
+ } | {
396
+ kind: "unspecified";
397
+ distance?: undefined;
398
+ bps?: undefined;
399
+ };
400
+ activationPrice: string | undefined;
401
+ limitPrice: string | undefined;
402
+ } | undefined;
403
+ oco: boolean;
404
+ } | undefined;
405
+ maxSlippageBps?: undefined;
406
+ trailingDistance?: undefined;
407
+ activationPrice?: undefined;
408
+ triggerPriceSource?: undefined;
409
+ limitPrice?: undefined;
410
+ fundsReserved?: undefined;
411
+ durationMs?: undefined;
412
+ sliceIntervalMs?: undefined;
413
+ sliceCount?: undefined;
414
+ sliceQuantity?: undefined;
415
+ unfilledSlicePolicy?: undefined;
416
+ firstSliceImmediate?: undefined;
417
+ lowPrice?: undefined;
418
+ highPrice?: undefined;
419
+ levels?: undefined;
420
+ allLevelsAtOnce?: undefined;
421
+ } | {
422
+ triggerPrice: string;
423
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
424
+ direction: "unspecified" | "at_or_above" | "at_or_below";
425
+ limitPrice: string | undefined;
426
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
427
+ postOnly: boolean;
428
+ maxSlippageBps: number | undefined;
429
+ fundsReserved: boolean;
430
+ type: "stop_loss";
431
+ attached?: undefined;
432
+ price?: undefined;
433
+ expireAt?: undefined;
434
+ trailingDistance?: undefined;
435
+ activationPrice?: undefined;
436
+ durationMs?: undefined;
437
+ sliceIntervalMs?: undefined;
438
+ sliceCount?: undefined;
439
+ sliceQuantity?: undefined;
440
+ unfilledSlicePolicy?: undefined;
441
+ firstSliceImmediate?: undefined;
442
+ lowPrice?: undefined;
443
+ highPrice?: undefined;
444
+ levels?: undefined;
445
+ allLevelsAtOnce?: undefined;
446
+ } | {
447
+ triggerPrice: string;
448
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
449
+ direction: "unspecified" | "at_or_above" | "at_or_below";
450
+ limitPrice: string | undefined;
451
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
452
+ postOnly: boolean;
453
+ maxSlippageBps: number | undefined;
454
+ fundsReserved: boolean;
455
+ type: "take_profit";
456
+ attached?: undefined;
457
+ price?: undefined;
458
+ expireAt?: undefined;
459
+ trailingDistance?: undefined;
460
+ activationPrice?: undefined;
461
+ durationMs?: undefined;
462
+ sliceIntervalMs?: undefined;
463
+ sliceCount?: undefined;
464
+ sliceQuantity?: undefined;
465
+ unfilledSlicePolicy?: undefined;
466
+ firstSliceImmediate?: undefined;
467
+ lowPrice?: undefined;
468
+ highPrice?: undefined;
469
+ levels?: undefined;
470
+ allLevelsAtOnce?: undefined;
471
+ } | {
472
+ type: "trailing_stop";
473
+ trailingDistance: {
474
+ kind: "distance";
475
+ distance: string;
476
+ bps?: undefined;
477
+ } | {
478
+ kind: "bps";
479
+ bps: number;
480
+ distance?: undefined;
481
+ } | {
482
+ kind: "unspecified";
483
+ distance?: undefined;
484
+ bps?: undefined;
485
+ };
486
+ activationPrice: string | undefined;
487
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
488
+ limitPrice: string | undefined;
489
+ maxSlippageBps: number | undefined;
490
+ fundsReserved: boolean;
491
+ attached?: undefined;
492
+ price?: undefined;
493
+ timeInForce?: undefined;
494
+ expireAt?: undefined;
495
+ postOnly?: undefined;
496
+ durationMs?: undefined;
497
+ sliceIntervalMs?: undefined;
498
+ sliceCount?: undefined;
499
+ sliceQuantity?: undefined;
500
+ unfilledSlicePolicy?: undefined;
501
+ firstSliceImmediate?: undefined;
502
+ lowPrice?: undefined;
503
+ highPrice?: undefined;
504
+ levels?: undefined;
505
+ allLevelsAtOnce?: undefined;
506
+ } | {
507
+ type: "twap";
508
+ durationMs: number;
509
+ sliceIntervalMs: number;
510
+ sliceCount: number;
511
+ sliceQuantity: string;
512
+ limitPrice: string | undefined;
513
+ maxSlippageBps: number | undefined;
514
+ unfilledSlicePolicy: "unspecified" | "cancel_before_next";
515
+ firstSliceImmediate: boolean;
516
+ attached?: undefined;
517
+ price?: undefined;
518
+ timeInForce?: undefined;
519
+ expireAt?: undefined;
520
+ postOnly?: undefined;
521
+ trailingDistance?: undefined;
522
+ activationPrice?: undefined;
523
+ triggerPriceSource?: undefined;
524
+ fundsReserved?: undefined;
525
+ lowPrice?: undefined;
526
+ highPrice?: undefined;
527
+ levels?: undefined;
528
+ allLevelsAtOnce?: undefined;
529
+ } | {
530
+ type: "ladder";
531
+ lowPrice: string;
532
+ highPrice: string;
533
+ levels: {
534
+ price: string;
535
+ quantity: string;
536
+ }[];
537
+ postOnly: boolean;
538
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
539
+ allLevelsAtOnce: boolean;
540
+ maxSlippageBps?: undefined;
541
+ attached?: undefined;
542
+ price?: undefined;
543
+ expireAt?: undefined;
544
+ trailingDistance?: undefined;
545
+ activationPrice?: undefined;
546
+ triggerPriceSource?: undefined;
547
+ limitPrice?: undefined;
548
+ fundsReserved?: undefined;
549
+ durationMs?: undefined;
550
+ sliceIntervalMs?: undefined;
551
+ sliceCount?: undefined;
552
+ sliceQuantity?: undefined;
553
+ unfilledSlicePolicy?: undefined;
554
+ firstSliceImmediate?: undefined;
555
+ } | {
556
+ type: "unspecified";
557
+ maxSlippageBps?: undefined;
558
+ attached?: undefined;
559
+ price?: undefined;
560
+ timeInForce?: undefined;
561
+ expireAt?: undefined;
562
+ postOnly?: undefined;
563
+ trailingDistance?: undefined;
564
+ activationPrice?: undefined;
565
+ triggerPriceSource?: undefined;
566
+ limitPrice?: undefined;
567
+ fundsReserved?: undefined;
568
+ durationMs?: undefined;
569
+ sliceIntervalMs?: undefined;
570
+ sliceCount?: undefined;
571
+ sliceQuantity?: undefined;
572
+ unfilledSlicePolicy?: undefined;
573
+ firstSliceImmediate?: undefined;
574
+ lowPrice?: undefined;
575
+ highPrice?: undefined;
576
+ levels?: undefined;
577
+ allLevelsAtOnce?: undefined;
578
+ };
579
+ relativePrices: {
580
+ field: "unspecified" | "limit_price" | "trigger_price" | "activation_price" | "ladder_low_price" | "ladder_high_price" | "take_profit_trigger_price" | "take_profit_limit_price" | "stop_loss_trigger_price" | "stop_loss_limit_price" | "trailing_stop_activation_price" | "trailing_stop_limit_price";
581
+ /** The resolved absolute price the order carries. */
582
+ price: string;
583
+ direction: "unspecified" | "above" | "below";
584
+ offsetBps: number;
585
+ reference: {
586
+ price: string;
587
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
588
+ observedAt: number | undefined;
589
+ type: "market";
590
+ } | {
591
+ type: "limit_price";
592
+ price: string;
593
+ } | {
594
+ type: "unspecified";
595
+ price?: undefined;
596
+ };
597
+ rounding: "unspecified" | "down" | "up";
598
+ tickSize: string;
599
+ }[];
600
+ type: "order";
601
+ orders?: undefined;
602
+ totalValues?: undefined;
603
+ cancelAll?: undefined;
604
+ symbols?: undefined;
605
+ liveTriggersKept?: undefined;
606
+ liveTriggersKeptLowerBound?: undefined;
607
+ triggerId?: undefined;
608
+ triggerType?: undefined;
609
+ action?: undefined;
610
+ before?: undefined;
611
+ after?: undefined;
612
+ direction?: undefined;
613
+ reserveIncrease?: undefined;
614
+ reserveRelease?: undefined;
615
+ firesOnResume?: undefined;
616
+ triggerPrice?: undefined;
617
+ filledQuantity?: undefined;
618
+ slicesDone?: undefined;
619
+ sliceCount?: undefined;
620
+ levelsFilled?: undefined;
621
+ levelCount?: undefined;
622
+ cancelsOpenOrders?: undefined;
623
+ sourceAsset?: undefined;
624
+ destinationAsset?: undefined;
625
+ amount?: undefined;
626
+ expectedAmountOut?: undefined;
627
+ minAmountOut?: undefined;
628
+ maxSlippageBps?: undefined;
629
+ legs?: undefined;
630
+ quotedAt?: undefined;
631
+ /** Approving after this executes nothing. */
632
+ expiresAt?: undefined;
633
+ } | {
634
+ type: "place_orders";
635
+ orders: {
636
+ symbolId: number;
637
+ symbol: string;
638
+ baseAsset: string;
639
+ quoteAsset: string;
640
+ side: "unspecified" | "buy" | "sell";
641
+ quantity: string | undefined;
642
+ quoteAmount: string | undefined;
643
+ estimatedValue: string | undefined;
644
+ reservedAmount: string | undefined;
645
+ referencePrice: {
646
+ price: string;
647
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
648
+ observedAt: number | undefined;
649
+ } | undefined;
650
+ /** The order type and its own values; `type: "unspecified"` means show the summary only. */
651
+ order: {
652
+ type: "market";
653
+ maxSlippageBps: number | undefined;
654
+ attached: {
655
+ takeProfit: {
656
+ triggerPrice: string;
657
+ limitPrice: string | undefined;
658
+ } | undefined;
659
+ stopLoss: {
660
+ triggerPrice: string;
661
+ limitPrice: string | undefined;
662
+ } | undefined;
663
+ trailingStop: {
664
+ trailingDistance: {
665
+ kind: "distance";
666
+ distance: string;
667
+ bps?: undefined;
668
+ } | {
669
+ kind: "bps";
670
+ bps: number;
671
+ distance?: undefined;
672
+ } | {
673
+ kind: "unspecified";
674
+ distance?: undefined;
675
+ bps?: undefined;
676
+ };
677
+ activationPrice: string | undefined;
678
+ limitPrice: string | undefined;
679
+ } | undefined;
680
+ oco: boolean;
681
+ } | undefined;
682
+ price?: undefined;
683
+ timeInForce?: undefined;
684
+ expireAt?: undefined;
685
+ postOnly?: undefined;
686
+ trailingDistance?: undefined;
687
+ activationPrice?: undefined;
688
+ triggerPriceSource?: undefined;
689
+ limitPrice?: undefined;
690
+ fundsReserved?: undefined;
691
+ durationMs?: undefined;
692
+ sliceIntervalMs?: undefined;
693
+ sliceCount?: undefined;
694
+ sliceQuantity?: undefined;
695
+ unfilledSlicePolicy?: undefined;
696
+ firstSliceImmediate?: undefined;
697
+ lowPrice?: undefined;
698
+ highPrice?: undefined;
699
+ levels?: undefined;
700
+ allLevelsAtOnce?: undefined;
701
+ } | {
702
+ type: "limit";
703
+ price: string;
704
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
705
+ expireAt: number | undefined;
706
+ postOnly: boolean;
707
+ attached: {
708
+ takeProfit: {
709
+ triggerPrice: string;
710
+ limitPrice: string | undefined;
711
+ } | undefined;
712
+ stopLoss: {
713
+ triggerPrice: string;
714
+ limitPrice: string | undefined;
715
+ } | undefined;
716
+ trailingStop: {
717
+ trailingDistance: {
718
+ kind: "distance";
719
+ distance: string;
720
+ bps?: undefined;
721
+ } | {
722
+ kind: "bps";
723
+ bps: number;
724
+ distance?: undefined;
725
+ } | {
726
+ kind: "unspecified";
727
+ distance?: undefined;
728
+ bps?: undefined;
729
+ };
730
+ activationPrice: string | undefined;
731
+ limitPrice: string | undefined;
732
+ } | undefined;
733
+ oco: boolean;
734
+ } | undefined;
735
+ maxSlippageBps?: undefined;
736
+ trailingDistance?: undefined;
737
+ activationPrice?: undefined;
738
+ triggerPriceSource?: undefined;
739
+ limitPrice?: undefined;
740
+ fundsReserved?: undefined;
741
+ durationMs?: undefined;
742
+ sliceIntervalMs?: undefined;
743
+ sliceCount?: undefined;
744
+ sliceQuantity?: undefined;
745
+ unfilledSlicePolicy?: undefined;
746
+ firstSliceImmediate?: undefined;
747
+ lowPrice?: undefined;
748
+ highPrice?: undefined;
749
+ levels?: undefined;
750
+ allLevelsAtOnce?: undefined;
751
+ } | {
752
+ triggerPrice: string;
753
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
754
+ direction: "unspecified" | "at_or_above" | "at_or_below";
755
+ limitPrice: string | undefined;
756
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
757
+ postOnly: boolean;
758
+ maxSlippageBps: number | undefined;
759
+ fundsReserved: boolean;
760
+ type: "stop_loss";
761
+ attached?: undefined;
762
+ price?: undefined;
763
+ expireAt?: undefined;
764
+ trailingDistance?: undefined;
765
+ activationPrice?: undefined;
766
+ durationMs?: undefined;
767
+ sliceIntervalMs?: undefined;
768
+ sliceCount?: undefined;
769
+ sliceQuantity?: undefined;
770
+ unfilledSlicePolicy?: undefined;
771
+ firstSliceImmediate?: undefined;
772
+ lowPrice?: undefined;
773
+ highPrice?: undefined;
774
+ levels?: undefined;
775
+ allLevelsAtOnce?: undefined;
776
+ } | {
777
+ triggerPrice: string;
778
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
779
+ direction: "unspecified" | "at_or_above" | "at_or_below";
780
+ limitPrice: string | undefined;
781
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
782
+ postOnly: boolean;
783
+ maxSlippageBps: number | undefined;
784
+ fundsReserved: boolean;
785
+ type: "take_profit";
786
+ attached?: undefined;
787
+ price?: undefined;
788
+ expireAt?: undefined;
789
+ trailingDistance?: undefined;
790
+ activationPrice?: undefined;
791
+ durationMs?: undefined;
792
+ sliceIntervalMs?: undefined;
793
+ sliceCount?: undefined;
794
+ sliceQuantity?: undefined;
795
+ unfilledSlicePolicy?: undefined;
796
+ firstSliceImmediate?: undefined;
797
+ lowPrice?: undefined;
798
+ highPrice?: undefined;
799
+ levels?: undefined;
800
+ allLevelsAtOnce?: undefined;
801
+ } | {
802
+ type: "trailing_stop";
803
+ trailingDistance: {
804
+ kind: "distance";
805
+ distance: string;
806
+ bps?: undefined;
807
+ } | {
808
+ kind: "bps";
809
+ bps: number;
810
+ distance?: undefined;
811
+ } | {
812
+ kind: "unspecified";
813
+ distance?: undefined;
814
+ bps?: undefined;
815
+ };
816
+ activationPrice: string | undefined;
817
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
818
+ limitPrice: string | undefined;
819
+ maxSlippageBps: number | undefined;
820
+ fundsReserved: boolean;
821
+ attached?: undefined;
822
+ price?: undefined;
823
+ timeInForce?: undefined;
824
+ expireAt?: undefined;
825
+ postOnly?: undefined;
826
+ durationMs?: undefined;
827
+ sliceIntervalMs?: undefined;
828
+ sliceCount?: undefined;
829
+ sliceQuantity?: undefined;
830
+ unfilledSlicePolicy?: undefined;
831
+ firstSliceImmediate?: undefined;
832
+ lowPrice?: undefined;
833
+ highPrice?: undefined;
834
+ levels?: undefined;
835
+ allLevelsAtOnce?: undefined;
836
+ } | {
837
+ type: "twap";
838
+ durationMs: number;
839
+ sliceIntervalMs: number;
840
+ sliceCount: number;
841
+ sliceQuantity: string;
842
+ limitPrice: string | undefined;
843
+ maxSlippageBps: number | undefined;
844
+ unfilledSlicePolicy: "unspecified" | "cancel_before_next";
845
+ firstSliceImmediate: boolean;
846
+ attached?: undefined;
847
+ price?: undefined;
848
+ timeInForce?: undefined;
849
+ expireAt?: undefined;
850
+ postOnly?: undefined;
851
+ trailingDistance?: undefined;
852
+ activationPrice?: undefined;
853
+ triggerPriceSource?: undefined;
854
+ fundsReserved?: undefined;
855
+ lowPrice?: undefined;
856
+ highPrice?: undefined;
857
+ levels?: undefined;
858
+ allLevelsAtOnce?: undefined;
859
+ } | {
860
+ type: "ladder";
861
+ lowPrice: string;
862
+ highPrice: string;
863
+ levels: {
864
+ price: string;
865
+ quantity: string;
866
+ }[];
867
+ postOnly: boolean;
868
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
869
+ allLevelsAtOnce: boolean;
870
+ maxSlippageBps?: undefined;
871
+ attached?: undefined;
872
+ price?: undefined;
873
+ expireAt?: undefined;
874
+ trailingDistance?: undefined;
875
+ activationPrice?: undefined;
876
+ triggerPriceSource?: undefined;
877
+ limitPrice?: undefined;
878
+ fundsReserved?: undefined;
879
+ durationMs?: undefined;
880
+ sliceIntervalMs?: undefined;
881
+ sliceCount?: undefined;
882
+ sliceQuantity?: undefined;
883
+ unfilledSlicePolicy?: undefined;
884
+ firstSliceImmediate?: undefined;
885
+ } | {
886
+ type: "unspecified";
887
+ maxSlippageBps?: undefined;
888
+ attached?: undefined;
889
+ price?: undefined;
890
+ timeInForce?: undefined;
891
+ expireAt?: undefined;
892
+ postOnly?: undefined;
893
+ trailingDistance?: undefined;
894
+ activationPrice?: undefined;
895
+ triggerPriceSource?: undefined;
896
+ limitPrice?: undefined;
897
+ fundsReserved?: undefined;
898
+ durationMs?: undefined;
899
+ sliceIntervalMs?: undefined;
900
+ sliceCount?: undefined;
901
+ sliceQuantity?: undefined;
902
+ unfilledSlicePolicy?: undefined;
903
+ firstSliceImmediate?: undefined;
904
+ lowPrice?: undefined;
905
+ highPrice?: undefined;
906
+ levels?: undefined;
907
+ allLevelsAtOnce?: undefined;
908
+ };
909
+ relativePrices: {
910
+ field: "unspecified" | "limit_price" | "trigger_price" | "activation_price" | "ladder_low_price" | "ladder_high_price" | "take_profit_trigger_price" | "take_profit_limit_price" | "stop_loss_trigger_price" | "stop_loss_limit_price" | "trailing_stop_activation_price" | "trailing_stop_limit_price";
911
+ /** The resolved absolute price the order carries. */
912
+ price: string;
913
+ direction: "unspecified" | "above" | "below";
914
+ offsetBps: number;
915
+ reference: {
916
+ price: string;
917
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
918
+ observedAt: number | undefined;
919
+ type: "market";
920
+ } | {
921
+ type: "limit_price";
922
+ price: string;
923
+ } | {
924
+ type: "unspecified";
925
+ price?: undefined;
926
+ };
927
+ rounding: "unspecified" | "down" | "up";
928
+ tickSize: string;
929
+ }[];
930
+ }[];
931
+ totalValues: {
932
+ quoteAsset: string;
933
+ value: string;
934
+ }[];
935
+ cancelAll?: undefined;
936
+ symbols?: undefined;
937
+ side?: undefined;
938
+ liveTriggersKept?: undefined;
939
+ liveTriggersKeptLowerBound?: undefined;
940
+ symbolId?: undefined;
941
+ symbol?: undefined;
942
+ baseAsset?: undefined;
943
+ quoteAsset?: undefined;
944
+ triggerId?: undefined;
945
+ triggerType?: undefined;
946
+ quantity?: undefined;
947
+ action?: undefined;
948
+ before?: undefined;
949
+ after?: undefined;
950
+ referencePrice?: undefined;
951
+ direction?: undefined;
952
+ reserveIncrease?: undefined;
953
+ reserveRelease?: undefined;
954
+ firesOnResume?: undefined;
955
+ triggerPrice?: undefined;
956
+ filledQuantity?: undefined;
957
+ slicesDone?: undefined;
958
+ sliceCount?: undefined;
959
+ levelsFilled?: undefined;
960
+ levelCount?: undefined;
961
+ cancelsOpenOrders?: undefined;
962
+ sourceAsset?: undefined;
963
+ destinationAsset?: undefined;
964
+ amount?: undefined;
965
+ expectedAmountOut?: undefined;
966
+ minAmountOut?: undefined;
967
+ maxSlippageBps?: undefined;
968
+ legs?: undefined;
969
+ quotedAt?: undefined;
970
+ /** Approving after this executes nothing. */
971
+ expiresAt?: undefined;
972
+ } | {
973
+ type: "cancel_orders";
974
+ orders: {
975
+ orderId: string;
976
+ symbol: string;
977
+ side: "unspecified" | "buy" | "sell";
978
+ price: string | undefined;
979
+ quantity: string;
980
+ filledQuantity: string;
981
+ }[];
982
+ cancelAll: boolean;
983
+ symbols: string[];
984
+ side: "unspecified" | "buy" | "sell";
985
+ liveTriggersKept: number;
986
+ liveTriggersKeptLowerBound: boolean;
987
+ totalValues?: undefined;
988
+ symbolId?: undefined;
989
+ symbol?: undefined;
990
+ baseAsset?: undefined;
991
+ quoteAsset?: undefined;
992
+ triggerId?: undefined;
993
+ triggerType?: undefined;
994
+ quantity?: undefined;
995
+ action?: undefined;
996
+ before?: undefined;
997
+ after?: undefined;
998
+ referencePrice?: undefined;
999
+ direction?: undefined;
1000
+ reserveIncrease?: undefined;
1001
+ reserveRelease?: undefined;
1002
+ firesOnResume?: undefined;
1003
+ triggerPrice?: undefined;
1004
+ filledQuantity?: undefined;
1005
+ slicesDone?: undefined;
1006
+ sliceCount?: undefined;
1007
+ levelsFilled?: undefined;
1008
+ levelCount?: undefined;
1009
+ cancelsOpenOrders?: undefined;
1010
+ sourceAsset?: undefined;
1011
+ destinationAsset?: undefined;
1012
+ amount?: undefined;
1013
+ expectedAmountOut?: undefined;
1014
+ minAmountOut?: undefined;
1015
+ maxSlippageBps?: undefined;
1016
+ legs?: undefined;
1017
+ quotedAt?: undefined;
1018
+ /** Approving after this executes nothing. */
1019
+ expiresAt?: undefined;
1020
+ } | {
1021
+ type: "order_change";
1022
+ symbolId: number;
1023
+ symbol: string;
1024
+ baseAsset: string;
1025
+ quoteAsset: string;
1026
+ orders: {
1027
+ orderId: string;
1028
+ side: "unspecified" | "buy" | "sell";
1029
+ price: string;
1030
+ newPrice: string | undefined;
1031
+ quantity: string;
1032
+ newQuantity: string | undefined;
1033
+ filledQuantity: string;
1034
+ replaced: boolean;
1035
+ }[];
1036
+ totalValues?: undefined;
1037
+ cancelAll?: undefined;
1038
+ symbols?: undefined;
1039
+ side?: undefined;
1040
+ liveTriggersKept?: undefined;
1041
+ liveTriggersKeptLowerBound?: undefined;
1042
+ triggerId?: undefined;
1043
+ triggerType?: undefined;
1044
+ quantity?: undefined;
1045
+ action?: undefined;
1046
+ before?: undefined;
1047
+ after?: undefined;
1048
+ referencePrice?: undefined;
1049
+ direction?: undefined;
1050
+ reserveIncrease?: undefined;
1051
+ reserveRelease?: undefined;
1052
+ firesOnResume?: undefined;
1053
+ triggerPrice?: undefined;
1054
+ filledQuantity?: undefined;
1055
+ slicesDone?: undefined;
1056
+ sliceCount?: undefined;
1057
+ levelsFilled?: undefined;
1058
+ levelCount?: undefined;
1059
+ cancelsOpenOrders?: undefined;
1060
+ sourceAsset?: undefined;
1061
+ destinationAsset?: undefined;
1062
+ amount?: undefined;
1063
+ expectedAmountOut?: undefined;
1064
+ minAmountOut?: undefined;
1065
+ maxSlippageBps?: undefined;
1066
+ legs?: undefined;
1067
+ quotedAt?: undefined;
1068
+ /** Approving after this executes nothing. */
1069
+ expiresAt?: undefined;
1070
+ } | {
1071
+ type: "trigger_change";
1072
+ triggerId: string;
1073
+ symbolId: number;
1074
+ symbol: string;
1075
+ baseAsset: string;
1076
+ quoteAsset: string;
1077
+ triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
1078
+ side: "unspecified" | "buy" | "sell";
1079
+ quantity: string;
1080
+ action: "unspecified" | "pause" | "modify" | "resume";
1081
+ before: {
1082
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
1083
+ triggerPrice: string | undefined;
1084
+ trailingDistance: {
1085
+ kind: "distance";
1086
+ distance: string;
1087
+ bps?: undefined;
1088
+ } | {
1089
+ kind: "bps";
1090
+ bps: number;
1091
+ distance?: undefined;
1092
+ } | undefined;
1093
+ activationPrice: string | undefined;
1094
+ maxSlippage: {
1095
+ kind: "bps";
1096
+ bps: number;
1097
+ slippage?: undefined;
1098
+ } | {
1099
+ kind: "slippage";
1100
+ slippage: string;
1101
+ bps?: undefined;
1102
+ } | undefined;
1103
+ limitPrice: string | undefined;
1104
+ } | undefined;
1105
+ after: {
1106
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
1107
+ triggerPrice: string | undefined;
1108
+ trailingDistance: {
1109
+ kind: "distance";
1110
+ distance: string;
1111
+ bps?: undefined;
1112
+ } | {
1113
+ kind: "bps";
1114
+ bps: number;
1115
+ distance?: undefined;
1116
+ } | undefined;
1117
+ activationPrice: string | undefined;
1118
+ maxSlippage: {
1119
+ kind: "bps";
1120
+ bps: number;
1121
+ slippage?: undefined;
1122
+ } | {
1123
+ kind: "slippage";
1124
+ slippage: string;
1125
+ bps?: undefined;
1126
+ } | undefined;
1127
+ limitPrice: string | undefined;
1128
+ } | undefined;
1129
+ referencePrice: {
1130
+ price: string;
1131
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
1132
+ observedAt: number | undefined;
1133
+ } | undefined;
1134
+ direction: "unspecified" | "at_or_above" | "at_or_below";
1135
+ reserveIncrease: string | undefined;
1136
+ reserveRelease: string | undefined;
1137
+ firesOnResume: boolean;
1138
+ orders?: undefined;
1139
+ totalValues?: undefined;
1140
+ cancelAll?: undefined;
1141
+ symbols?: undefined;
1142
+ liveTriggersKept?: undefined;
1143
+ liveTriggersKeptLowerBound?: undefined;
1144
+ triggerPrice?: undefined;
1145
+ filledQuantity?: undefined;
1146
+ slicesDone?: undefined;
1147
+ sliceCount?: undefined;
1148
+ levelsFilled?: undefined;
1149
+ levelCount?: undefined;
1150
+ cancelsOpenOrders?: undefined;
1151
+ sourceAsset?: undefined;
1152
+ destinationAsset?: undefined;
1153
+ amount?: undefined;
1154
+ expectedAmountOut?: undefined;
1155
+ minAmountOut?: undefined;
1156
+ maxSlippageBps?: undefined;
1157
+ legs?: undefined;
1158
+ quotedAt?: undefined;
1159
+ /** Approving after this executes nothing. */
1160
+ expiresAt?: undefined;
1161
+ } | {
1162
+ type: "cancel_trigger";
1163
+ triggerId: string;
1164
+ symbolId: number;
1165
+ symbol: string;
1166
+ triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
1167
+ side: "unspecified" | "buy" | "sell";
1168
+ quantity: string;
1169
+ triggerPrice: string | undefined;
1170
+ filledQuantity: string | undefined;
1171
+ slicesDone: number | undefined;
1172
+ sliceCount: number | undefined;
1173
+ levelsFilled: number | undefined;
1174
+ levelCount: number | undefined;
1175
+ cancelsOpenOrders: boolean;
1176
+ orders?: undefined;
1177
+ totalValues?: undefined;
1178
+ cancelAll?: undefined;
1179
+ symbols?: undefined;
1180
+ liveTriggersKept?: undefined;
1181
+ liveTriggersKeptLowerBound?: undefined;
1182
+ baseAsset?: undefined;
1183
+ quoteAsset?: undefined;
1184
+ action?: undefined;
1185
+ before?: undefined;
1186
+ after?: undefined;
1187
+ referencePrice?: undefined;
1188
+ direction?: undefined;
1189
+ reserveIncrease?: undefined;
1190
+ reserveRelease?: undefined;
1191
+ firesOnResume?: undefined;
1192
+ sourceAsset?: undefined;
1193
+ destinationAsset?: undefined;
1194
+ amount?: undefined;
1195
+ expectedAmountOut?: undefined;
1196
+ minAmountOut?: undefined;
1197
+ maxSlippageBps?: undefined;
1198
+ legs?: undefined;
1199
+ quotedAt?: undefined;
1200
+ /** Approving after this executes nothing. */
1201
+ expiresAt?: undefined;
1202
+ } | {
1203
+ type: "swap";
1204
+ sourceAsset: string;
1205
+ destinationAsset: string;
1206
+ amount: string;
1207
+ expectedAmountOut: string;
1208
+ minAmountOut: string;
1209
+ maxSlippageBps: number;
1210
+ legs: {
1211
+ symbol: string;
1212
+ side: "unspecified" | "buy" | "sell";
1213
+ averagePrice: string;
1214
+ priceImpactBps: number;
1215
+ takerFeeRatePercent: string;
1216
+ fee: string;
1217
+ feeAsset: string;
1218
+ }[];
1219
+ quotedAt: number | undefined;
1220
+ /** Approving after this executes nothing. */
1221
+ expiresAt: number | undefined;
1222
+ orders?: undefined;
1223
+ totalValues?: undefined;
1224
+ cancelAll?: undefined;
1225
+ symbols?: undefined;
1226
+ side?: undefined;
1227
+ liveTriggersKept?: undefined;
1228
+ liveTriggersKeptLowerBound?: undefined;
1229
+ symbolId?: undefined;
1230
+ symbol?: undefined;
1231
+ baseAsset?: undefined;
1232
+ quoteAsset?: undefined;
1233
+ triggerId?: undefined;
1234
+ triggerType?: undefined;
1235
+ quantity?: undefined;
1236
+ action?: undefined;
1237
+ before?: undefined;
1238
+ after?: undefined;
1239
+ referencePrice?: undefined;
1240
+ direction?: undefined;
1241
+ reserveIncrease?: undefined;
1242
+ reserveRelease?: undefined;
1243
+ firesOnResume?: undefined;
1244
+ triggerPrice?: undefined;
1245
+ filledQuantity?: undefined;
1246
+ slicesDone?: undefined;
1247
+ sliceCount?: undefined;
1248
+ levelsFilled?: undefined;
1249
+ levelCount?: undefined;
1250
+ cancelsOpenOrders?: undefined;
1251
+ } | {
1252
+ type: "unspecified";
1253
+ orders?: undefined;
1254
+ totalValues?: undefined;
1255
+ cancelAll?: undefined;
1256
+ symbols?: undefined;
1257
+ side?: undefined;
1258
+ liveTriggersKept?: undefined;
1259
+ liveTriggersKeptLowerBound?: undefined;
1260
+ symbolId?: undefined;
1261
+ symbol?: undefined;
1262
+ baseAsset?: undefined;
1263
+ quoteAsset?: undefined;
1264
+ triggerId?: undefined;
1265
+ triggerType?: undefined;
1266
+ quantity?: undefined;
1267
+ action?: undefined;
1268
+ before?: undefined;
1269
+ after?: undefined;
1270
+ referencePrice?: undefined;
1271
+ direction?: undefined;
1272
+ reserveIncrease?: undefined;
1273
+ reserveRelease?: undefined;
1274
+ firesOnResume?: undefined;
1275
+ triggerPrice?: undefined;
1276
+ filledQuantity?: undefined;
1277
+ slicesDone?: undefined;
1278
+ sliceCount?: undefined;
1279
+ levelsFilled?: undefined;
1280
+ levelCount?: undefined;
1281
+ cancelsOpenOrders?: undefined;
1282
+ sourceAsset?: undefined;
1283
+ destinationAsset?: undefined;
1284
+ amount?: undefined;
1285
+ expectedAmountOut?: undefined;
1286
+ minAmountOut?: undefined;
1287
+ maxSlippageBps?: undefined;
1288
+ legs?: undefined;
1289
+ quotedAt?: undefined;
1290
+ /** Approving after this executes nothing. */
1291
+ expiresAt?: undefined;
1292
+ };
1293
+ type AssistantApprovalPreview = ReturnType<typeof formatApprovalPreview>;
1294
+ declare function formatView(view: View, scales: SdkScales): {
1295
+ type: "orders_table";
1296
+ orders: {
1297
+ version: number;
1298
+ expireAt?: number | undefined;
1299
+ submittedMaxQuoteDebit?: string | undefined;
1300
+ batchRequestId?: string | undefined;
1301
+ marketMaxSlippage?: MarketMaxSlippage | undefined;
1302
+ marketClientRefPrice?: string | undefined;
1303
+ origin?: {
1304
+ scope: "unspecified" | "direct" | "attached_risk" | "standalone_trigger" | "system";
1305
+ triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
1306
+ triggerId?: string | undefined;
1307
+ parentOrderId?: string | undefined;
1308
+ childSeq: number;
1309
+ } | undefined;
1310
+ attachedRisk: {
1311
+ takeProfit: {
1312
+ state: {
1313
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running" | "not_configured";
1314
+ armedTs: number | undefined;
1315
+ armedTsNs: string | undefined;
1316
+ terminalTs: number | undefined;
1317
+ terminalTsNs: string | undefined;
1318
+ triggerId: string | undefined;
1319
+ childOrderId: string | undefined;
1320
+ } | undefined;
1321
+ triggerPrice?: string | undefined;
1322
+ execution?: {
1323
+ readonly type: "market_ioc";
1324
+ price?: undefined;
1325
+ } | {
1326
+ readonly type: "limit_gtc";
1327
+ readonly price: string;
1328
+ } | undefined;
1329
+ triggerPriceSource?: "unspecified" | "last" | "index" | "mark" | undefined;
1330
+ } | undefined;
1331
+ stopLoss: {
1332
+ state: {
1333
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running" | "not_configured";
1334
+ armedTs: number | undefined;
1335
+ armedTsNs: string | undefined;
1336
+ terminalTs: number | undefined;
1337
+ terminalTsNs: string | undefined;
1338
+ triggerId: string | undefined;
1339
+ childOrderId: string | undefined;
1340
+ } | undefined;
1341
+ triggerPrice?: string | undefined;
1342
+ execution?: {
1343
+ readonly type: "market_ioc";
1344
+ price?: undefined;
1345
+ } | {
1346
+ readonly type: "limit_gtc";
1347
+ readonly price: string;
1348
+ } | undefined;
1349
+ triggerPriceSource?: "unspecified" | "last" | "index" | "mark" | undefined;
1350
+ } | undefined;
1351
+ trailingStop: {
1352
+ state: {
1353
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running" | "not_configured";
1354
+ armedTs: number | undefined;
1355
+ armedTsNs: string | undefined;
1356
+ terminalTs: number | undefined;
1357
+ terminalTsNs: string | undefined;
1358
+ triggerId: string | undefined;
1359
+ childOrderId: string | undefined;
1360
+ } | undefined;
1361
+ trailingDistance?: ({
1362
+ kind: "distance";
1363
+ distance: string;
1364
+ } | {
1365
+ kind: "bps";
1366
+ bps: number;
1367
+ } | {
1368
+ kind: "none";
1369
+ }) | undefined;
1370
+ maxSlippage?: ({
1371
+ kind: "slippage";
1372
+ slippage: string;
1373
+ } | {
1374
+ kind: "bps";
1375
+ bps: number;
1376
+ }) | undefined;
1377
+ activationPrice?: string | undefined;
1378
+ limitPrice?: string | undefined;
1379
+ triggerPriceSource?: "unspecified" | "last" | "index" | "mark" | undefined;
1380
+ } | undefined;
1381
+ oco: boolean;
1382
+ } | undefined;
1383
+ cancelReason?: "unspecified" | "system" | "user_request" | "ioc_remainder" | "market_remainder" | "stp_expire_maker" | "stp_expire_taker" | "stp_expire_both" | "replaced" | "gtd_expired" | "qty_at_or_below_filled" | "pair_drain" | "attached_risk_refused" | "cancel_all_after" | "account_repair" | "twap_rollover" | "strategy_cancel" | "market_halted" | "attached_exit_fired" | undefined;
1384
+ rejectReason?: "STALE_QUOTE" | "UNSPECIFIED" | "BAD_REQUEST" | "INVALID_ARGUMENT" | "INSUFFICIENT_FUNDS" | "UNKNOWN_SYMBOL" | "BAD_PRICE" | "BAD_QTY" | "MIN_NOTIONAL" | "QTY_STEP_SIZE" | "CONFLICT_DUPLICATE_CLIENT_ORDER_ID" | "UNAVAILABLE" | "UNAUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "UPSTREAM_ERROR" | "FEE_ASSET_NOT_ALLOWED" | "PAIR_DISABLED" | "ORDER_UNKNOWN" | "INTERNAL_ERROR" | "SUBACCOUNT_INACTIVE" | "POLICY_MARKET_DENY" | "POLICY_MAX_NOTIONAL" | "POLICY_TRADING_HALTED" | "POLICY_SPOT_TRADE_DENY" | "API_KEY_ROOT_SCOPE_ONLY" | "API_KEY_SUB_SCOPE_ONLY" | "API_KEY_SUBACCOUNT_MISMATCH" | "API_KEY_POLICY_REQUIRED" | "API_KEY_UNKNOWN" | "API_KEY_MARKET_DENY" | "PRICE_TICK_SIZE" | "MIN_QTY" | "POST_ONLY_LIMIT_ONLY" | "BATCH_TOO_LARGE" | "POLICY_MAX_OPEN_ORDERS" | "MODIFICATION_REQUIRES_REPLACE" | "CONFLICT_IDEMPOTENCY_KEY_REUSE" | "MARKET_PRICE_UNAVAILABLE" | "PAIR_NOT_LISTED_YET" | "PAIR_DELISTED" | "PAIR_CANCEL_ONLY" | "PAIR_POST_ONLY" | "PAIR_REDUCE_ONLY" | "RISK_LIMIT" | "MARKET_HALTED" | "ACCOUNT_UNKNOWN" | "POST_ONLY_CROSS" | "REDUCE_ONLY_BLOCKED" | "PRICE_BAND_VIOLATION" | "MARKET_CAP_VIOLATION" | "EMPTY_BOOK" | "FOK_INSUFFICIENT_LIQUIDITY" | "ORDER_ALREADY_TERMINAL" | "TRIGGER_PRICE_INVALID" | "TRIGGER_PRICE_SOURCE_UNSUPPORTED" | "TRAILING_DISTANCE_INVALID" | "TRIGGER_NOT_FOUND" | "TRIGGER_STATUS_INVALID" | "TRIGGER_NOT_MODIFIABLE" | "CONFLICT_DUPLICATE_CLIENT_TRIGGER_ID" | "MAX_SLIPPAGE_INVALID" | "VALIDATION_ERROR" | "OVERLOADED" | "MAX_QUOTE_DEBIT_TOO_SMALL" | "RATE_LIMIT_EXCEEDED" | "SUBACCOUNT_READ_FORBIDDEN" | "POLICY_SPOT_READ_DENY" | "API_KEY_SPOT_READ_DENY" | "CANCEL_REQUEST_EXPIRED" | "MAX_QTY" | "MAX_NOTIONAL" | "QTY_AT_OR_BELOW_FILLED" | "GATEWAY_MISCONFIGURED" | "INVALID_ORDER_ID" | "CHILD_QTY_RAISE_NOT_ALLOWED" | "ATTACHED_RISK_NOT_SUPPORTED" | "SETTLEMENT_BACKLOGGED" | "PRICE_LEVEL_QUANTITY_LIMIT" | "MARKET_QUOTE_STALE" | "MARKET_QUOTE_UNHEALTHY" | "INVALID_TIME_IN_FORCE" | "QUICKSWAP_NOT_PERMITTED" | "DUPLICATE_ORDER_ID" | "MAX_OPEN_ORDERS_TOTAL" | "STP_MODE_NOT_ALLOWED" | "PAIR_BACKLOGGED" | "PRICE_LEVELS_EXHAUSTED" | "CLIENT_ORDER_IDS_EXHAUSTED" | "ORDER_ID_CONFLICT" | "INVALID_SIDE" | "INVALID_ORDER_TYPE" | "INVALID_STP_MODE" | "INVALID_ORDER_FLAGS" | "BATCH_OTHER_ITEM_INVALID" | "REPLACE_ONTO_OWN_ID" | "INVALID_CLIENT_ORDER_ID" | "ORDER_SEQUENCE_EXHAUSTED" | "INVALID_HANDLING_MODE" | "FEE_SCHEDULE_UNAVAILABLE" | "POLICY_UNAVAILABLE" | "CANCEL_ALL_AFTER_TIMEOUT_INVALID" | "CANCEL_SCOPE_TOO_LARGE" | "RATE_LIMIT_POLICY_UNAVAILABLE" | "SYSTEM_RATE_LIMITED" | "ORDER_MODIFY_IN_PROGRESS" | "ORDER_PLACEMENT_PENDING" | "INVALID_MODIFY_BEHAVIOR" | "BATCH_REPLACE_ONLY_REQUIRED" | "BATCH_SINGLE_SYMBOL_REQUIRED" | "REQUEST_RECEIPTS_EXHAUSTED" | "INTENT_ID_INVALID" | "DRY_RUN_INVALID" | "CANCEL_ALL_AFTER_SCOPE_CONFLICT" | "NEW_ACCOUNT_CAPACITY_REACHED" | "TRIGGER_CHILD_PRICE_NOT_MODIFIABLE" | "TRIGGER_GENERATIONS_EXHAUSTED" | "TRIGGER_CONTROL_SHARE_EXHAUSTED" | "TRIGGER_CONTROLS_BUSY" | "TRIGGER_TYPE_NOT_SUPPORTED" | "INVALID_TRIGGER_TYPE" | "TRIGGER_DIRECTION_INVALID" | "TRIGGER_QTY_INVALID" | "TRIGGER_BUY_REQUIRES_LIMIT" | "ACCOUNT_ROUTING_INVALID" | "TRIGGER_LIMIT_EXCEEDED" | "TRIGGER_CONTROL_IN_PROGRESS" | "TRIGGER_PATCH_EMPTY" | "CLIENT_TRIGGER_ID_INVALID" | "TRIGGER_ACTIVATION_PRICE_INVALID" | "SLIPPAGE_TICKS_INVALID" | "SLIPPAGE_BPS_INVALID" | "TRIGGER_CONTROL_OUTCOME_UNKNOWN" | "TRIGGER_CAPACITY_REACHED" | "RESERVATION_CAPACITY_REACHED" | "CLIENT_ORDER_ID_CAPACITY_REACHED" | "ACCOUNT_RESERVATION_LIMIT_REACHED" | "INVALID_TRIGGER_CONTROL" | "TRIGGER_PATCH_NOT_ALLOWED" | "TRIGGER_PATCH_FIELD_UNKNOWN" | "TRIGGER_PATCH_VALUE_UNMASKED" | "TRIGGER_PATCH_PRICE_MODE_INVALID" | "ACCOUNT_ORDERS_SUSPENDED" | "TRAILING_SIDE_NOT_SUPPORTED" | "TRAILING_CHILD_NOT_MARKET" | "TWAP_DURATION_INVALID" | "LIMIT_CHILD_SLIPPAGE_SET" | "SLIPPAGE_BOUNDS_CONFLICT" | "TWAP_INTERVAL_INVALID" | "LADDER_LEVEL_REJECTED" | "LADDER_RANGE_TOO_NARROW" | "LADDER_LEVELS_INVALID" | "ORDER_LIMITS_UNAVAILABLE" | "ORDER_TYPE_NOT_ALLOWED_IN_AUCTION" | "POST_ONLY_NOT_ALLOWED_IN_AUCTION" | "QUICKSWAP_FEE_DETAILS_INCOMPLETE" | "QUICKSWAP_MARKET_NOT_PRICED" | "QUICKSWAP_BROKER_FEE_TERMS_MISMATCH" | "QUICKSWAP_FEE_RECIPIENT_IS_PAYER" | "QUICKSWAP_BROKER_FEE_TERMS_UNAVAILABLE" | "QUICKSWAP_BROKER_ACCOUNT_UNAVAILABLE" | "QUICKSWAP_ACCOUNT_OWNER_UNKNOWN" | "QUICKSWAP_DISABLED" | "QUICKSWAP_ATTACHED_RISK_NOT_ALLOWED" | "QUICKSWAP_ORDER_NOT_MODIFIABLE" | "QUICKSWAP_FEE_TOTAL_TOO_HIGH" | "QUICKSWAP_BROKER_FEE_TERMS_INVALID" | "QUICKSWAP_BROKER_INVALID" | "QUICKSWAP_FEE_SCHEDULE_INVALID" | "QUICKSWAP_MARKET_FEE_INVALID" | "QUICKSWAP_SETUP_INVALID" | "QUICKSWAP_CAPACITY_REACHED" | "ATTACHED_EXIT_WORKING" | "MARKET_TRIGGER_LIMIT_EXCEEDED" | "MARKET_TWAP_LIMIT_EXCEEDED" | "MARKET_LADDER_LIMIT_EXCEEDED" | "CHILD_QTY_EXCEEDS_REMAINING" | "ORDER_CANCEL_OUTCOME_UNKNOWN" | "ORDER_MODIFY_OUTCOME_UNKNOWN" | "ORDER_REPAIRING" | "ACCOUNT_REPAIRING" | "TRIGGER_WOULD_TRIGGER_IMMEDIATELY" | "ORDER_CREATE_OUTCOME_UNKNOWN" | "TRIGGER_CREATE_OUTCOME_UNKNOWN" | "TRIGGER_SYMBOL_MISMATCH" | "MAX_OPEN_ORDERS_PER_PAIR" | "SELF_TRADE_PREVENTED" | "ATTACHED_LEGS_EXCEEDED" | "FEE_ASSET_INVALID" | "FEE_CEILING_INVALID" | "UNSUPPORTED_FIELD_SET" | "TRIGGER_FIRE_LIMIT_REACHED" | "CONDITION_FLAGS_INVALID" | "CONDITION_PARAMETER_SET" | "TWAP_CAPACITY_REACHED" | "CHILD_ORDER_INCONSISTENT" | "PATH_BODY_ID_MISMATCH" | "REQUEST_DEADLINE_EXCEEDED" | undefined;
1385
+ price: string;
1386
+ createdTs: number;
1387
+ terminalTs: number;
1388
+ feeTotal?: {
1389
+ amount: string;
1390
+ isRebate: boolean;
1391
+ qty: string;
1392
+ } | undefined;
1393
+ symbolId: number;
1394
+ clientOrderId: string;
1395
+ status: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled" | "partial";
1396
+ side: "unspecified" | "buy" | "sell";
1397
+ orderType: "unspecified" | "limit" | "market";
1398
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
1399
+ selfTradePreventionMode: "unspecified" | "expire_taker" | "expire_maker" | "expire_both";
1400
+ feeAsset: "unspecified" | "quote" | "base";
1401
+ postOnly: boolean;
1402
+ totalQty: string;
1403
+ cumQty: string;
1404
+ inheritedCumQty: string;
1405
+ leavesQty: string;
1406
+ avgPx: string;
1407
+ cumQuote: string;
1408
+ lineage?: {
1409
+ id: string;
1410
+ generation: number;
1411
+ } | undefined;
1412
+ orderId: string;
1413
+ }[];
1414
+ truncated: boolean;
1415
+ accountId: string;
1416
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
1417
+ triggers?: undefined;
1418
+ balances?: undefined;
1419
+ symbolId?: undefined;
1420
+ timeframe?: undefined;
1421
+ candles?: undefined;
1422
+ columns?: undefined;
1423
+ /** A row may have fewer cells than columns; missing cells are empty. */
1424
+ rows?: undefined;
1425
+ alert?: undefined;
1426
+ depositAddress?: undefined;
1427
+ assetId?: undefined;
1428
+ history?: undefined;
1429
+ transfers?: undefined;
1430
+ } | {
1431
+ type: "triggers_table";
1432
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
1433
+ triggers: ({
1434
+ runtimeDetails: TriggerDetailsOutput;
1435
+ version: number;
1436
+ cancelReason: "unspecified" | "internal_error" | "oco" | "user_request" | "account_repair" | "market_halted" | "parent_canceled_no_fill" | "self_trade_prevention" | "pair_drain_trigger" | "pair_drain_twap" | "pair_drain_ladder" | "pair_drain_attached_leg" | "missing_reason_code";
1437
+ failureReason: undefined;
1438
+ triggerId: string;
1439
+ subaccountId: string;
1440
+ symbolId: number;
1441
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
1442
+ parentOrderId: string | undefined;
1443
+ qty: string;
1444
+ feeAsset: "unspecified" | "quote" | "base";
1445
+ selfTradePreventionMode: "unspecified" | "expire_taker" | "expire_maker" | "expire_both";
1446
+ configuration: {
1447
+ type: "stop_loss" | "take_profit";
1448
+ side: "unspecified" | "buy" | "sell";
1449
+ triggerPrice: string;
1450
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
1451
+ execution: {
1452
+ readonly type: "market_ioc";
1453
+ readonly maxSlippage: {
1454
+ kind: "slippage";
1455
+ slippage: string;
1456
+ bps?: undefined;
1457
+ } | {
1458
+ kind: "bps";
1459
+ bps: number;
1460
+ slippage?: undefined;
1461
+ } | {
1462
+ kind: "none";
1463
+ slippage?: undefined;
1464
+ bps?: undefined;
1465
+ };
1466
+ price?: undefined;
1467
+ postOnly?: undefined;
1468
+ } | {
1469
+ readonly type: "limit_gtc";
1470
+ readonly price: string;
1471
+ readonly postOnly: boolean;
1472
+ readonly maxSlippage?: undefined;
1473
+ } | {
1474
+ readonly type: "limit_ioc";
1475
+ readonly price: string;
1476
+ readonly maxSlippage?: undefined;
1477
+ postOnly?: undefined;
1478
+ } | {
1479
+ readonly type: "limit_fok";
1480
+ readonly price: string;
1481
+ readonly maxSlippage?: undefined;
1482
+ postOnly?: undefined;
1483
+ } | {
1484
+ readonly type: "unspecified";
1485
+ readonly maxSlippage?: undefined;
1486
+ price?: undefined;
1487
+ postOnly?: undefined;
1488
+ };
1489
+ trailingDistance?: undefined;
1490
+ activationPrice?: undefined;
1491
+ readonly maxSlippage?: undefined;
1492
+ limitPrice?: undefined;
1493
+ durationMs?: undefined;
1494
+ sliceIntervalMs?: undefined;
1495
+ priceMin?: undefined;
1496
+ priceMax?: undefined;
1497
+ levels?: undefined;
1498
+ postOnly?: undefined;
1499
+ } | {
1500
+ type: "trailing_stop";
1501
+ side: "unspecified" | "buy" | "sell";
1502
+ trailingDistance: {
1503
+ kind: "distance";
1504
+ distance: string;
1505
+ bps?: undefined;
1506
+ } | {
1507
+ kind: "bps";
1508
+ bps: number;
1509
+ distance?: undefined;
1510
+ } | {
1511
+ kind: "unspecified";
1512
+ distance?: undefined;
1513
+ bps?: undefined;
1514
+ };
1515
+ activationPrice: string | undefined;
1516
+ maxSlippage: {
1517
+ kind: "slippage";
1518
+ slippage: string;
1519
+ bps?: undefined;
1520
+ } | {
1521
+ kind: "bps";
1522
+ bps: number;
1523
+ slippage?: undefined;
1524
+ } | {
1525
+ kind: "none";
1526
+ slippage?: undefined;
1527
+ bps?: undefined;
1528
+ };
1529
+ limitPrice: string | undefined;
1530
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
1531
+ triggerPrice?: undefined;
1532
+ execution?: undefined;
1533
+ durationMs?: undefined;
1534
+ sliceIntervalMs?: undefined;
1535
+ priceMin?: undefined;
1536
+ priceMax?: undefined;
1537
+ levels?: undefined;
1538
+ postOnly?: undefined;
1539
+ } | {
1540
+ type: "twap";
1541
+ side: "unspecified" | "buy" | "sell";
1542
+ durationMs: number;
1543
+ sliceIntervalMs: number;
1544
+ execution: {
1545
+ readonly type: "market_ioc";
1546
+ readonly maxSlippage: {
1547
+ kind: "slippage";
1548
+ slippage: string;
1549
+ bps?: undefined;
1550
+ } | {
1551
+ kind: "bps";
1552
+ bps: number;
1553
+ slippage?: undefined;
1554
+ } | {
1555
+ kind: "none";
1556
+ slippage?: undefined;
1557
+ bps?: undefined;
1558
+ };
1559
+ price?: undefined;
1560
+ } | {
1561
+ readonly type: "limit_gtc";
1562
+ readonly price: string;
1563
+ readonly maxSlippage?: undefined;
1564
+ } | {
1565
+ readonly type: "unspecified";
1566
+ readonly maxSlippage?: undefined;
1567
+ price?: undefined;
1568
+ };
1569
+ triggerPrice?: undefined;
1570
+ triggerPriceSource?: undefined;
1571
+ trailingDistance?: undefined;
1572
+ activationPrice?: undefined;
1573
+ readonly maxSlippage?: undefined;
1574
+ limitPrice?: undefined;
1575
+ priceMin?: undefined;
1576
+ priceMax?: undefined;
1577
+ levels?: undefined;
1578
+ postOnly?: undefined;
1579
+ } | {
1580
+ type: "ladder";
1581
+ side: "unspecified" | "buy" | "sell";
1582
+ priceMin: string;
1583
+ priceMax: string;
1584
+ levels: number;
1585
+ postOnly: boolean;
1586
+ triggerPrice?: undefined;
1587
+ triggerPriceSource?: undefined;
1588
+ execution?: undefined;
1589
+ trailingDistance?: undefined;
1590
+ activationPrice?: undefined;
1591
+ readonly maxSlippage?: undefined;
1592
+ limitPrice?: undefined;
1593
+ durationMs?: undefined;
1594
+ sliceIntervalMs?: undefined;
1595
+ } | {
1596
+ type: "unspecified";
1597
+ side?: undefined;
1598
+ triggerPrice?: undefined;
1599
+ triggerPriceSource?: undefined;
1600
+ execution?: undefined;
1601
+ trailingDistance?: undefined;
1602
+ activationPrice?: undefined;
1603
+ readonly maxSlippage?: undefined;
1604
+ limitPrice?: undefined;
1605
+ durationMs?: undefined;
1606
+ sliceIntervalMs?: undefined;
1607
+ priceMin?: undefined;
1608
+ priceMax?: undefined;
1609
+ levels?: undefined;
1610
+ postOnly?: undefined;
1611
+ };
1612
+ clientTriggerId: string;
1613
+ createdTs: number | undefined;
1614
+ updatedTs: number | undefined;
1615
+ armedTs: number | undefined;
1616
+ completedTs: number | undefined;
1617
+ } | {
1618
+ runtimeDetails: TriggerDetailsOutput;
1619
+ version: number;
1620
+ cancelReason: undefined;
1621
+ failureReason: "unspecified" | "internal_error" | "market_halted" | "missing_reason_code" | "unknown_symbol" | "pair_disabled" | "min_notional" | "tick_size" | "insufficient_funds" | "risk_limit" | "duplicate_client_id" | "engine_busy" | "account_unknown" | "order_unknown" | "post_only_cross" | "reduce_only_blocked" | "price_band_violation" | "market_cap_violation" | "empty_book" | "fok_insufficient_liquidity" | "fee_asset_not_allowed" | "market_price_unavailable" | "stale_quote" | "min_quantity" | "step_size" | "invalid_sizing" | "max_quote_debit_too_small" | "fee_ceiling_exceeded" | "trigger_price_invalid" | "trigger_price_source_unsupported" | "trailing_distance_invalid" | "modification_requires_replace" | "order_already_terminal" | "conflict_idempotency_key_reuse" | "rate_limited" | "policy_spot_trade_deny" | "policy_market_deny" | "policy_max_notional" | "policy_max_open_orders" | "policy_trading_halted" | "max_slippage_invalid" | "invalid_time_in_force" | "duplicate_order_id" | "max_quantity" | "max_notional" | "pair_post_only" | "max_open_orders_total" | "stp_mode_not_allowed" | "pair_backlogged" | "mode_not_supported" | "market_quote_stale" | "market_quote_unhealthy" | "qty_invalid" | "limit_price_invalid" | "twap_interval_invalid" | "ladder_range_too_narrow" | "ladder_levels_invalid" | "attached_legs_exceeded" | "price_levels_exhausted" | "settlement_backlogged" | "client_order_ids_exhausted" | "invalid_order_id" | "order_id_conflict" | "invalid_side" | "invalid_order_type" | "invalid_stp_mode" | "invalid_order_flags" | "price_level_quantity_limit" | "child_qty_raise_not_allowed" | "triggers_exhausted" | "order_sequence_exhausted" | "fee_schedule_unavailable" | "policy_unavailable" | "account_routing_invalid" | "client_trigger_id_invalid" | "trigger_direction_invalid" | "fee_asset_invalid" | "fee_ceiling_invalid" | "unsupported_field_set" | "trigger_fire_limit_reached" | "condition_flags_invalid" | "condition_parameter_set" | "slippage_ticks_invalid" | "slippage_bps_invalid" | "slippage_bounds_conflict" | "limit_child_slippage_set" | "new_account_capacity_reached" | "order_type_not_allowed_in_auction" | "post_only_not_allowed_in_auction" | "twap_capacity_reached" | "order_limits_unavailable" | "child_order_inconsistent" | "index_price_unavailable" | "trigger_would_trigger_immediately" | "max_open_orders_per_pair" | "account_repairing" | "self_trade_prevented";
1622
+ triggerId: string;
1623
+ subaccountId: string;
1624
+ symbolId: number;
1625
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
1626
+ parentOrderId: string | undefined;
1627
+ qty: string;
1628
+ feeAsset: "unspecified" | "quote" | "base";
1629
+ selfTradePreventionMode: "unspecified" | "expire_taker" | "expire_maker" | "expire_both";
1630
+ configuration: {
1631
+ type: "stop_loss" | "take_profit";
1632
+ side: "unspecified" | "buy" | "sell";
1633
+ triggerPrice: string;
1634
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
1635
+ execution: {
1636
+ readonly type: "market_ioc";
1637
+ readonly maxSlippage: {
1638
+ kind: "slippage";
1639
+ slippage: string;
1640
+ bps?: undefined;
1641
+ } | {
1642
+ kind: "bps";
1643
+ bps: number;
1644
+ slippage?: undefined;
1645
+ } | {
1646
+ kind: "none";
1647
+ slippage?: undefined;
1648
+ bps?: undefined;
1649
+ };
1650
+ price?: undefined;
1651
+ postOnly?: undefined;
1652
+ } | {
1653
+ readonly type: "limit_gtc";
1654
+ readonly price: string;
1655
+ readonly postOnly: boolean;
1656
+ readonly maxSlippage?: undefined;
1657
+ } | {
1658
+ readonly type: "limit_ioc";
1659
+ readonly price: string;
1660
+ readonly maxSlippage?: undefined;
1661
+ postOnly?: undefined;
1662
+ } | {
1663
+ readonly type: "limit_fok";
1664
+ readonly price: string;
1665
+ readonly maxSlippage?: undefined;
1666
+ postOnly?: undefined;
1667
+ } | {
1668
+ readonly type: "unspecified";
1669
+ readonly maxSlippage?: undefined;
1670
+ price?: undefined;
1671
+ postOnly?: undefined;
1672
+ };
1673
+ trailingDistance?: undefined;
1674
+ activationPrice?: undefined;
1675
+ readonly maxSlippage?: undefined;
1676
+ limitPrice?: undefined;
1677
+ durationMs?: undefined;
1678
+ sliceIntervalMs?: undefined;
1679
+ priceMin?: undefined;
1680
+ priceMax?: undefined;
1681
+ levels?: undefined;
1682
+ postOnly?: undefined;
1683
+ } | {
1684
+ type: "trailing_stop";
1685
+ side: "unspecified" | "buy" | "sell";
1686
+ trailingDistance: {
1687
+ kind: "distance";
1688
+ distance: string;
1689
+ bps?: undefined;
1690
+ } | {
1691
+ kind: "bps";
1692
+ bps: number;
1693
+ distance?: undefined;
1694
+ } | {
1695
+ kind: "unspecified";
1696
+ distance?: undefined;
1697
+ bps?: undefined;
1698
+ };
1699
+ activationPrice: string | undefined;
1700
+ maxSlippage: {
1701
+ kind: "slippage";
1702
+ slippage: string;
1703
+ bps?: undefined;
1704
+ } | {
1705
+ kind: "bps";
1706
+ bps: number;
1707
+ slippage?: undefined;
1708
+ } | {
1709
+ kind: "none";
1710
+ slippage?: undefined;
1711
+ bps?: undefined;
1712
+ };
1713
+ limitPrice: string | undefined;
1714
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
1715
+ triggerPrice?: undefined;
1716
+ execution?: undefined;
1717
+ durationMs?: undefined;
1718
+ sliceIntervalMs?: undefined;
1719
+ priceMin?: undefined;
1720
+ priceMax?: undefined;
1721
+ levels?: undefined;
1722
+ postOnly?: undefined;
1723
+ } | {
1724
+ type: "twap";
1725
+ side: "unspecified" | "buy" | "sell";
1726
+ durationMs: number;
1727
+ sliceIntervalMs: number;
1728
+ execution: {
1729
+ readonly type: "market_ioc";
1730
+ readonly maxSlippage: {
1731
+ kind: "slippage";
1732
+ slippage: string;
1733
+ bps?: undefined;
1734
+ } | {
1735
+ kind: "bps";
1736
+ bps: number;
1737
+ slippage?: undefined;
1738
+ } | {
1739
+ kind: "none";
1740
+ slippage?: undefined;
1741
+ bps?: undefined;
1742
+ };
1743
+ price?: undefined;
1744
+ } | {
1745
+ readonly type: "limit_gtc";
1746
+ readonly price: string;
1747
+ readonly maxSlippage?: undefined;
1748
+ } | {
1749
+ readonly type: "unspecified";
1750
+ readonly maxSlippage?: undefined;
1751
+ price?: undefined;
1752
+ };
1753
+ triggerPrice?: undefined;
1754
+ triggerPriceSource?: undefined;
1755
+ trailingDistance?: undefined;
1756
+ activationPrice?: undefined;
1757
+ readonly maxSlippage?: undefined;
1758
+ limitPrice?: undefined;
1759
+ priceMin?: undefined;
1760
+ priceMax?: undefined;
1761
+ levels?: undefined;
1762
+ postOnly?: undefined;
1763
+ } | {
1764
+ type: "ladder";
1765
+ side: "unspecified" | "buy" | "sell";
1766
+ priceMin: string;
1767
+ priceMax: string;
1768
+ levels: number;
1769
+ postOnly: boolean;
1770
+ triggerPrice?: undefined;
1771
+ triggerPriceSource?: undefined;
1772
+ execution?: undefined;
1773
+ trailingDistance?: undefined;
1774
+ activationPrice?: undefined;
1775
+ readonly maxSlippage?: undefined;
1776
+ limitPrice?: undefined;
1777
+ durationMs?: undefined;
1778
+ sliceIntervalMs?: undefined;
1779
+ } | {
1780
+ type: "unspecified";
1781
+ side?: undefined;
1782
+ triggerPrice?: undefined;
1783
+ triggerPriceSource?: undefined;
1784
+ execution?: undefined;
1785
+ trailingDistance?: undefined;
1786
+ activationPrice?: undefined;
1787
+ readonly maxSlippage?: undefined;
1788
+ limitPrice?: undefined;
1789
+ durationMs?: undefined;
1790
+ sliceIntervalMs?: undefined;
1791
+ priceMin?: undefined;
1792
+ priceMax?: undefined;
1793
+ levels?: undefined;
1794
+ postOnly?: undefined;
1795
+ };
1796
+ clientTriggerId: string;
1797
+ createdTs: number | undefined;
1798
+ updatedTs: number | undefined;
1799
+ armedTs: number | undefined;
1800
+ completedTs: number | undefined;
1801
+ } | {
1802
+ runtimeDetails: TriggerDetailsOutput;
1803
+ version: number;
1804
+ cancelReason: undefined;
1805
+ failureReason: undefined;
1806
+ triggerId: string;
1807
+ subaccountId: string;
1808
+ symbolId: number;
1809
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
1810
+ parentOrderId: string | undefined;
1811
+ qty: string;
1812
+ feeAsset: "unspecified" | "quote" | "base";
1813
+ selfTradePreventionMode: "unspecified" | "expire_taker" | "expire_maker" | "expire_both";
1814
+ configuration: {
1815
+ type: "stop_loss" | "take_profit";
1816
+ side: "unspecified" | "buy" | "sell";
1817
+ triggerPrice: string;
1818
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
1819
+ execution: {
1820
+ readonly type: "market_ioc";
1821
+ readonly maxSlippage: {
1822
+ kind: "slippage";
1823
+ slippage: string;
1824
+ bps?: undefined;
1825
+ } | {
1826
+ kind: "bps";
1827
+ bps: number;
1828
+ slippage?: undefined;
1829
+ } | {
1830
+ kind: "none";
1831
+ slippage?: undefined;
1832
+ bps?: undefined;
1833
+ };
1834
+ price?: undefined;
1835
+ postOnly?: undefined;
1836
+ } | {
1837
+ readonly type: "limit_gtc";
1838
+ readonly price: string;
1839
+ readonly postOnly: boolean;
1840
+ readonly maxSlippage?: undefined;
1841
+ } | {
1842
+ readonly type: "limit_ioc";
1843
+ readonly price: string;
1844
+ readonly maxSlippage?: undefined;
1845
+ postOnly?: undefined;
1846
+ } | {
1847
+ readonly type: "limit_fok";
1848
+ readonly price: string;
1849
+ readonly maxSlippage?: undefined;
1850
+ postOnly?: undefined;
1851
+ } | {
1852
+ readonly type: "unspecified";
1853
+ readonly maxSlippage?: undefined;
1854
+ price?: undefined;
1855
+ postOnly?: undefined;
1856
+ };
1857
+ trailingDistance?: undefined;
1858
+ activationPrice?: undefined;
1859
+ readonly maxSlippage?: undefined;
1860
+ limitPrice?: undefined;
1861
+ durationMs?: undefined;
1862
+ sliceIntervalMs?: undefined;
1863
+ priceMin?: undefined;
1864
+ priceMax?: undefined;
1865
+ levels?: undefined;
1866
+ postOnly?: undefined;
1867
+ } | {
1868
+ type: "trailing_stop";
1869
+ side: "unspecified" | "buy" | "sell";
1870
+ trailingDistance: {
1871
+ kind: "distance";
1872
+ distance: string;
1873
+ bps?: undefined;
1874
+ } | {
1875
+ kind: "bps";
1876
+ bps: number;
1877
+ distance?: undefined;
1878
+ } | {
1879
+ kind: "unspecified";
1880
+ distance?: undefined;
1881
+ bps?: undefined;
1882
+ };
1883
+ activationPrice: string | undefined;
1884
+ maxSlippage: {
1885
+ kind: "slippage";
1886
+ slippage: string;
1887
+ bps?: undefined;
1888
+ } | {
1889
+ kind: "bps";
1890
+ bps: number;
1891
+ slippage?: undefined;
1892
+ } | {
1893
+ kind: "none";
1894
+ slippage?: undefined;
1895
+ bps?: undefined;
1896
+ };
1897
+ limitPrice: string | undefined;
1898
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
1899
+ triggerPrice?: undefined;
1900
+ execution?: undefined;
1901
+ durationMs?: undefined;
1902
+ sliceIntervalMs?: undefined;
1903
+ priceMin?: undefined;
1904
+ priceMax?: undefined;
1905
+ levels?: undefined;
1906
+ postOnly?: undefined;
1907
+ } | {
1908
+ type: "twap";
1909
+ side: "unspecified" | "buy" | "sell";
1910
+ durationMs: number;
1911
+ sliceIntervalMs: number;
1912
+ execution: {
1913
+ readonly type: "market_ioc";
1914
+ readonly maxSlippage: {
1915
+ kind: "slippage";
1916
+ slippage: string;
1917
+ bps?: undefined;
1918
+ } | {
1919
+ kind: "bps";
1920
+ bps: number;
1921
+ slippage?: undefined;
1922
+ } | {
1923
+ kind: "none";
1924
+ slippage?: undefined;
1925
+ bps?: undefined;
1926
+ };
1927
+ price?: undefined;
1928
+ } | {
1929
+ readonly type: "limit_gtc";
1930
+ readonly price: string;
1931
+ readonly maxSlippage?: undefined;
1932
+ } | {
1933
+ readonly type: "unspecified";
1934
+ readonly maxSlippage?: undefined;
1935
+ price?: undefined;
1936
+ };
1937
+ triggerPrice?: undefined;
1938
+ triggerPriceSource?: undefined;
1939
+ trailingDistance?: undefined;
1940
+ activationPrice?: undefined;
1941
+ readonly maxSlippage?: undefined;
1942
+ limitPrice?: undefined;
1943
+ priceMin?: undefined;
1944
+ priceMax?: undefined;
1945
+ levels?: undefined;
1946
+ postOnly?: undefined;
1947
+ } | {
1948
+ type: "ladder";
1949
+ side: "unspecified" | "buy" | "sell";
1950
+ priceMin: string;
1951
+ priceMax: string;
1952
+ levels: number;
1953
+ postOnly: boolean;
1954
+ triggerPrice?: undefined;
1955
+ triggerPriceSource?: undefined;
1956
+ execution?: undefined;
1957
+ trailingDistance?: undefined;
1958
+ activationPrice?: undefined;
1959
+ readonly maxSlippage?: undefined;
1960
+ limitPrice?: undefined;
1961
+ durationMs?: undefined;
1962
+ sliceIntervalMs?: undefined;
1963
+ } | {
1964
+ type: "unspecified";
1965
+ side?: undefined;
1966
+ triggerPrice?: undefined;
1967
+ triggerPriceSource?: undefined;
1968
+ execution?: undefined;
1969
+ trailingDistance?: undefined;
1970
+ activationPrice?: undefined;
1971
+ readonly maxSlippage?: undefined;
1972
+ limitPrice?: undefined;
1973
+ durationMs?: undefined;
1974
+ sliceIntervalMs?: undefined;
1975
+ priceMin?: undefined;
1976
+ priceMax?: undefined;
1977
+ levels?: undefined;
1978
+ postOnly?: undefined;
1979
+ };
1980
+ clientTriggerId: string;
1981
+ createdTs: number | undefined;
1982
+ updatedTs: number | undefined;
1983
+ armedTs: number | undefined;
1984
+ completedTs: number | undefined;
1985
+ })[];
1986
+ truncated: boolean;
1987
+ accountId: string;
1988
+ orders?: undefined;
1989
+ balances?: undefined;
1990
+ symbolId?: undefined;
1991
+ timeframe?: undefined;
1992
+ candles?: undefined;
1993
+ columns?: undefined;
1994
+ /** A row may have fewer cells than columns; missing cells are empty. */
1995
+ rows?: undefined;
1996
+ alert?: undefined;
1997
+ depositAddress?: undefined;
1998
+ assetId?: undefined;
1999
+ history?: undefined;
2000
+ transfers?: undefined;
2001
+ } | {
2002
+ type: "balances_table";
2003
+ balances: {
2004
+ assetId: number;
2005
+ funding: string;
2006
+ trading: string;
2007
+ reserved: string;
2008
+ available: string;
2009
+ tradingRevision: string;
2010
+ fundingRevision: string;
2011
+ }[];
2012
+ accountId: string;
2013
+ orders?: undefined;
2014
+ truncated?: undefined;
2015
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2016
+ triggers?: undefined;
2017
+ symbolId?: undefined;
2018
+ timeframe?: undefined;
2019
+ candles?: undefined;
2020
+ columns?: undefined;
2021
+ /** A row may have fewer cells than columns; missing cells are empty. */
2022
+ rows?: undefined;
2023
+ alert?: undefined;
2024
+ depositAddress?: undefined;
2025
+ assetId?: undefined;
2026
+ history?: undefined;
2027
+ transfers?: undefined;
2028
+ } | {
2029
+ type: "price_chart";
2030
+ symbolId: number;
2031
+ timeframe: "unspecified" | "1d" | "1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo";
2032
+ candles: {
2033
+ symbolId: number;
2034
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">;
2035
+ time: number;
2036
+ open: string;
2037
+ high: string;
2038
+ low: string;
2039
+ close: string;
2040
+ volume: string;
2041
+ quoteVolume: string;
2042
+ isClosed: boolean;
2043
+ }[];
2044
+ orders?: undefined;
2045
+ truncated?: undefined;
2046
+ accountId?: undefined;
2047
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2048
+ triggers?: undefined;
2049
+ balances?: undefined;
2050
+ columns?: undefined;
2051
+ /** A row may have fewer cells than columns; missing cells are empty. */
2052
+ rows?: undefined;
2053
+ alert?: undefined;
2054
+ depositAddress?: undefined;
2055
+ assetId?: undefined;
2056
+ history?: undefined;
2057
+ transfers?: undefined;
2058
+ } | {
2059
+ type: "markdown_table";
2060
+ columns: string[];
2061
+ /** A row may have fewer cells than columns; missing cells are empty. */
2062
+ rows: string[][];
2063
+ truncated: boolean;
2064
+ orders?: undefined;
2065
+ accountId?: undefined;
2066
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2067
+ triggers?: undefined;
2068
+ balances?: undefined;
2069
+ symbolId?: undefined;
2070
+ timeframe?: undefined;
2071
+ candles?: undefined;
2072
+ alert?: undefined;
2073
+ depositAddress?: undefined;
2074
+ assetId?: undefined;
2075
+ history?: undefined;
2076
+ transfers?: undefined;
2077
+ } | {
2078
+ type: "price_alert";
2079
+ alert: {
2080
+ alertId: string;
2081
+ symbolId: number;
2082
+ direction: "unspecified" | "above" | "below";
2083
+ priceSource: "unspecified" | "last_price" | "index_price";
2084
+ price: string;
2085
+ referencePrice: string;
2086
+ armed: boolean;
2087
+ status: "unspecified" | "active" | "triggered" | "cancelled";
2088
+ channels: ("unspecified" | "telegram" | "in_app")[];
2089
+ revision: string;
2090
+ createdAt: number | null;
2091
+ updatedAt: number | null;
2092
+ triggeredAt: number | null;
2093
+ triggeredPrice: string | null;
2094
+ };
2095
+ orders?: undefined;
2096
+ truncated?: undefined;
2097
+ accountId?: undefined;
2098
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2099
+ triggers?: undefined;
2100
+ balances?: undefined;
2101
+ symbolId?: undefined;
2102
+ timeframe?: undefined;
2103
+ candles?: undefined;
2104
+ columns?: undefined;
2105
+ /** A row may have fewer cells than columns; missing cells are empty. */
2106
+ rows?: undefined;
2107
+ depositAddress?: undefined;
2108
+ assetId?: undefined;
2109
+ history?: undefined;
2110
+ transfers?: undefined;
2111
+ } | {
2112
+ type: "deposit_address";
2113
+ depositAddress: {
2114
+ chainId: number;
2115
+ depositAddress: string;
2116
+ } | undefined;
2117
+ assetId: number | undefined;
2118
+ accountId: string;
2119
+ orders?: undefined;
2120
+ truncated?: undefined;
2121
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2122
+ triggers?: undefined;
2123
+ balances?: undefined;
2124
+ symbolId?: undefined;
2125
+ timeframe?: undefined;
2126
+ candles?: undefined;
2127
+ columns?: undefined;
2128
+ /** A row may have fewer cells than columns; missing cells are empty. */
2129
+ rows?: undefined;
2130
+ alert?: undefined;
2131
+ history?: undefined;
2132
+ transfers?: undefined;
2133
+ } | {
2134
+ type: "balance_history_chart";
2135
+ history: {
2136
+ range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d";
2137
+ bucket: string;
2138
+ startTsSec: number;
2139
+ endTsSec: number;
2140
+ points: number;
2141
+ series: {
2142
+ assetId: number;
2143
+ accountCode: "unspecified" | "trading" | "funding";
2144
+ balance: string[];
2145
+ }[];
2146
+ } | undefined;
2147
+ accountId: string;
2148
+ orders?: undefined;
2149
+ truncated?: undefined;
2150
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2151
+ triggers?: undefined;
2152
+ balances?: undefined;
2153
+ symbolId?: undefined;
2154
+ timeframe?: undefined;
2155
+ candles?: undefined;
2156
+ columns?: undefined;
2157
+ /** A row may have fewer cells than columns; missing cells are empty. */
2158
+ rows?: undefined;
2159
+ alert?: undefined;
2160
+ depositAddress?: undefined;
2161
+ assetId?: undefined;
2162
+ transfers?: undefined;
2163
+ } | {
2164
+ type: "equity_history_chart";
2165
+ history: {
2166
+ range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d";
2167
+ bucket: string;
2168
+ startTsSec: number;
2169
+ endTsSec: number;
2170
+ quoteAsset: string;
2171
+ points: number;
2172
+ series: {
2173
+ grouping: EquitySeriesGrouping;
2174
+ equity: string[];
2175
+ }[];
2176
+ btcPrices: string[];
2177
+ } | undefined;
2178
+ accountId: string;
2179
+ orders?: undefined;
2180
+ truncated?: undefined;
2181
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2182
+ triggers?: undefined;
2183
+ balances?: undefined;
2184
+ symbolId?: undefined;
2185
+ timeframe?: undefined;
2186
+ candles?: undefined;
2187
+ columns?: undefined;
2188
+ /** A row may have fewer cells than columns; missing cells are empty. */
2189
+ rows?: undefined;
2190
+ alert?: undefined;
2191
+ depositAddress?: undefined;
2192
+ assetId?: undefined;
2193
+ transfers?: undefined;
2194
+ } | {
2195
+ type: "transfers_table";
2196
+ transfers: {
2197
+ destination?: {
2198
+ kind: "unspecified" | "funding_account" | "trading_account" | "external_address" | "private_counterparty" | "fee_account" | "system_account";
2199
+ accountId?: string | undefined;
2200
+ address: string;
2201
+ chainId?: number | undefined;
2202
+ } | undefined;
2203
+ source?: {
2204
+ kind: "unspecified" | "funding_account" | "trading_account" | "external_address" | "private_counterparty" | "fee_account" | "system_account";
2205
+ accountId?: string | undefined;
2206
+ address: string;
2207
+ chainId?: number | undefined;
2208
+ } | undefined;
2209
+ transferId: string;
2210
+ assetId: number;
2211
+ amount: string;
2212
+ balanceAfter: string | undefined;
2213
+ type: "unspecified" | "internal_transfer" | "deposit" | "withdraw" | "maker_fee" | "taker_fee" | "trade_base" | "trade_quote" | "rebate" | "funding_to_trading" | "trading_to_funding" | "trading_withdraw_reserve" | "funding_user_transfer" | "trading_withdraw_request_fee" | "trading_withdraw_fee_leg" | "quickswap_polyester_fee" | "quickswap_broker_fee" | "quickswap_affiliate_fee" | "fee_sweep" | "fee_refill" | "system_adjustment" | "withdraw_failed";
2214
+ accountCode: "unspecified" | "trading" | "funding";
2215
+ timestamp: number;
2216
+ isDebit: boolean;
2217
+ linkId: string | undefined;
2218
+ flowId: string;
2219
+ }[];
2220
+ truncated: boolean;
2221
+ accountId: string;
2222
+ orders?: undefined;
2223
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2224
+ triggers?: undefined;
2225
+ balances?: undefined;
2226
+ symbolId?: undefined;
2227
+ timeframe?: undefined;
2228
+ candles?: undefined;
2229
+ columns?: undefined;
2230
+ /** A row may have fewer cells than columns; missing cells are empty. */
2231
+ rows?: undefined;
2232
+ alert?: undefined;
2233
+ depositAddress?: undefined;
2234
+ assetId?: undefined;
2235
+ history?: undefined;
2236
+ } | {
2237
+ type: "unspecified";
2238
+ orders?: undefined;
2239
+ truncated?: undefined;
2240
+ accountId?: undefined;
2241
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
2242
+ triggers?: undefined;
2243
+ balances?: undefined;
2244
+ symbolId?: undefined;
2245
+ timeframe?: undefined;
2246
+ candles?: undefined;
2247
+ columns?: undefined;
2248
+ /** A row may have fewer cells than columns; missing cells are empty. */
2249
+ rows?: undefined;
2250
+ alert?: undefined;
2251
+ depositAddress?: undefined;
2252
+ assetId?: undefined;
2253
+ history?: undefined;
2254
+ transfers?: undefined;
2255
+ };
2256
+ type AssistantView = ReturnType<typeof formatView>;
2257
+ declare function formatRunEvent(event: RunEvent, scales: SdkScales): {
2258
+ type: "text_delta";
2259
+ text: string;
2260
+ fromSeq?: undefined;
2261
+ toolCallId?: undefined;
2262
+ name?: undefined;
2263
+ input?: undefined;
2264
+ ok?: undefined;
2265
+ errorMessage?: undefined;
2266
+ memories?: undefined;
2267
+ destinationIds?: undefined;
2268
+ subagentId?: undefined;
2269
+ summary?: undefined;
2270
+ approvalId?: undefined;
2271
+ /** Approving after this executes nothing. */
2272
+ expiresAt?: undefined;
2273
+ parameters?: undefined;
2274
+ accountId?: undefined;
2275
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2276
+ preview?: undefined;
2277
+ status?: undefined;
2278
+ view?: undefined;
2279
+ usage?: undefined;
2280
+ category?: undefined;
2281
+ message?: undefined;
2282
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2283
+ seq: number;
2284
+ createdAt: number | undefined;
2285
+ } | {
2286
+ type: "discard_partial";
2287
+ fromSeq: number;
2288
+ text?: undefined;
2289
+ toolCallId?: undefined;
2290
+ name?: undefined;
2291
+ input?: undefined;
2292
+ ok?: undefined;
2293
+ errorMessage?: undefined;
2294
+ memories?: undefined;
2295
+ destinationIds?: undefined;
2296
+ subagentId?: undefined;
2297
+ summary?: undefined;
2298
+ approvalId?: undefined;
2299
+ /** Approving after this executes nothing. */
2300
+ expiresAt?: undefined;
2301
+ parameters?: undefined;
2302
+ accountId?: undefined;
2303
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2304
+ preview?: undefined;
2305
+ status?: undefined;
2306
+ view?: undefined;
2307
+ usage?: undefined;
2308
+ category?: undefined;
2309
+ message?: undefined;
2310
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2311
+ seq: number;
2312
+ createdAt: number | undefined;
2313
+ } | {
2314
+ type: "tool_started";
2315
+ toolCallId: string;
2316
+ name: string;
2317
+ input: import("@bufbuild/protobuf").JsonObject;
2318
+ text?: undefined;
2319
+ fromSeq?: undefined;
2320
+ ok?: undefined;
2321
+ errorMessage?: undefined;
2322
+ memories?: undefined;
2323
+ destinationIds?: undefined;
2324
+ subagentId?: undefined;
2325
+ summary?: undefined;
2326
+ approvalId?: undefined;
2327
+ /** Approving after this executes nothing. */
2328
+ expiresAt?: undefined;
2329
+ parameters?: undefined;
2330
+ accountId?: undefined;
2331
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2332
+ preview?: undefined;
2333
+ status?: undefined;
2334
+ view?: undefined;
2335
+ usage?: undefined;
2336
+ category?: undefined;
2337
+ message?: undefined;
2338
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2339
+ seq: number;
2340
+ createdAt: number | undefined;
2341
+ } | {
2342
+ type: "tool_finished";
2343
+ toolCallId: string;
2344
+ name: string;
2345
+ ok: boolean;
2346
+ errorMessage: string | undefined;
2347
+ text?: undefined;
2348
+ fromSeq?: undefined;
2349
+ input?: undefined;
2350
+ memories?: undefined;
2351
+ destinationIds?: undefined;
2352
+ subagentId?: undefined;
2353
+ summary?: undefined;
2354
+ approvalId?: undefined;
2355
+ /** Approving after this executes nothing. */
2356
+ expiresAt?: undefined;
2357
+ parameters?: undefined;
2358
+ accountId?: undefined;
2359
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2360
+ preview?: undefined;
2361
+ status?: undefined;
2362
+ view?: undefined;
2363
+ usage?: undefined;
2364
+ category?: undefined;
2365
+ message?: undefined;
2366
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2367
+ seq: number;
2368
+ createdAt: number | undefined;
2369
+ } | {
2370
+ type: "memories_recalled";
2371
+ toolCallId: string;
2372
+ memories: {
2373
+ memoryId: string;
2374
+ text: string;
2375
+ kind: "unspecified" | "profile" | "fact" | "planning_figure";
2376
+ }[];
2377
+ text?: undefined;
2378
+ fromSeq?: undefined;
2379
+ name?: undefined;
2380
+ input?: undefined;
2381
+ ok?: undefined;
2382
+ errorMessage?: undefined;
2383
+ destinationIds?: undefined;
2384
+ subagentId?: undefined;
2385
+ summary?: undefined;
2386
+ approvalId?: undefined;
2387
+ /** Approving after this executes nothing. */
2388
+ expiresAt?: undefined;
2389
+ parameters?: undefined;
2390
+ accountId?: undefined;
2391
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2392
+ preview?: undefined;
2393
+ status?: undefined;
2394
+ view?: undefined;
2395
+ usage?: undefined;
2396
+ category?: undefined;
2397
+ message?: undefined;
2398
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2399
+ seq: number;
2400
+ createdAt: number | undefined;
2401
+ } | {
2402
+ type: "destinations_suggested";
2403
+ toolCallId: string;
2404
+ destinationIds: string[];
2405
+ text?: undefined;
2406
+ fromSeq?: undefined;
2407
+ name?: undefined;
2408
+ input?: undefined;
2409
+ ok?: undefined;
2410
+ errorMessage?: undefined;
2411
+ memories?: undefined;
2412
+ subagentId?: undefined;
2413
+ summary?: undefined;
2414
+ approvalId?: undefined;
2415
+ /** Approving after this executes nothing. */
2416
+ expiresAt?: undefined;
2417
+ parameters?: undefined;
2418
+ accountId?: undefined;
2419
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2420
+ preview?: undefined;
2421
+ status?: undefined;
2422
+ view?: undefined;
2423
+ usage?: undefined;
2424
+ category?: undefined;
2425
+ message?: undefined;
2426
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2427
+ seq: number;
2428
+ createdAt: number | undefined;
2429
+ } | {
2430
+ type: "skill_loaded";
2431
+ name: string;
2432
+ text?: undefined;
2433
+ fromSeq?: undefined;
2434
+ toolCallId?: undefined;
2435
+ input?: undefined;
2436
+ ok?: undefined;
2437
+ errorMessage?: undefined;
2438
+ memories?: undefined;
2439
+ destinationIds?: undefined;
2440
+ subagentId?: undefined;
2441
+ summary?: undefined;
2442
+ approvalId?: undefined;
2443
+ /** Approving after this executes nothing. */
2444
+ expiresAt?: undefined;
2445
+ parameters?: undefined;
2446
+ accountId?: undefined;
2447
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2448
+ preview?: undefined;
2449
+ status?: undefined;
2450
+ view?: undefined;
2451
+ usage?: undefined;
2452
+ category?: undefined;
2453
+ message?: undefined;
2454
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2455
+ seq: number;
2456
+ createdAt: number | undefined;
2457
+ } | {
2458
+ type: "subagent_started";
2459
+ subagentId: string;
2460
+ name: string;
2461
+ text?: undefined;
2462
+ fromSeq?: undefined;
2463
+ toolCallId?: undefined;
2464
+ input?: undefined;
2465
+ ok?: undefined;
2466
+ errorMessage?: undefined;
2467
+ memories?: undefined;
2468
+ destinationIds?: undefined;
2469
+ summary?: undefined;
2470
+ approvalId?: undefined;
2471
+ /** Approving after this executes nothing. */
2472
+ expiresAt?: undefined;
2473
+ parameters?: undefined;
2474
+ accountId?: undefined;
2475
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2476
+ preview?: undefined;
2477
+ status?: undefined;
2478
+ view?: undefined;
2479
+ usage?: undefined;
2480
+ category?: undefined;
2481
+ message?: undefined;
2482
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2483
+ seq: number;
2484
+ createdAt: number | undefined;
2485
+ } | {
2486
+ type: "subagent_finished";
2487
+ subagentId: string;
2488
+ name: string;
2489
+ ok: boolean;
2490
+ summary: string | undefined;
2491
+ text?: undefined;
2492
+ fromSeq?: undefined;
2493
+ toolCallId?: undefined;
2494
+ input?: undefined;
2495
+ errorMessage?: undefined;
2496
+ memories?: undefined;
2497
+ destinationIds?: undefined;
2498
+ approvalId?: undefined;
2499
+ /** Approving after this executes nothing. */
2500
+ expiresAt?: undefined;
2501
+ parameters?: undefined;
2502
+ accountId?: undefined;
2503
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2504
+ preview?: undefined;
2505
+ status?: undefined;
2506
+ view?: undefined;
2507
+ usage?: undefined;
2508
+ category?: undefined;
2509
+ message?: undefined;
2510
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
2511
+ seq: number;
2512
+ createdAt: number | undefined;
2513
+ } | {
2514
+ type: "approval_requested";
2515
+ approvalId: string;
2516
+ summary: string;
2517
+ expiresAt: number | undefined;
2518
+ parameters: {
2519
+ label: string;
2520
+ value: string;
2521
+ }[];
2522
+ accountId: string;
2523
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
2524
+ preview: {
2525
+ symbolId: number;
2526
+ symbol: string;
2527
+ baseAsset: string;
2528
+ quoteAsset: string;
2529
+ side: "unspecified" | "buy" | "sell";
2530
+ quantity: string | undefined;
2531
+ quoteAmount: string | undefined;
2532
+ estimatedValue: string | undefined;
2533
+ reservedAmount: string | undefined;
2534
+ referencePrice: {
2535
+ price: string;
2536
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
2537
+ observedAt: number | undefined;
2538
+ } | undefined;
2539
+ /** The order type and its own values; `type: "unspecified"` means show the summary only. */
2540
+ order: {
2541
+ type: "market";
2542
+ maxSlippageBps: number | undefined;
2543
+ attached: {
2544
+ takeProfit: {
2545
+ triggerPrice: string;
2546
+ limitPrice: string | undefined;
2547
+ } | undefined;
2548
+ stopLoss: {
2549
+ triggerPrice: string;
2550
+ limitPrice: string | undefined;
2551
+ } | undefined;
2552
+ trailingStop: {
2553
+ trailingDistance: {
2554
+ kind: "distance";
2555
+ distance: string;
2556
+ bps?: undefined;
2557
+ } | {
2558
+ kind: "bps";
2559
+ bps: number;
2560
+ distance?: undefined;
2561
+ } | {
2562
+ kind: "unspecified";
2563
+ distance?: undefined;
2564
+ bps?: undefined;
2565
+ };
2566
+ activationPrice: string | undefined;
2567
+ limitPrice: string | undefined;
2568
+ } | undefined;
2569
+ oco: boolean;
2570
+ } | undefined;
2571
+ price?: undefined;
2572
+ timeInForce?: undefined;
2573
+ expireAt?: undefined;
2574
+ postOnly?: undefined;
2575
+ trailingDistance?: undefined;
2576
+ activationPrice?: undefined;
2577
+ triggerPriceSource?: undefined;
2578
+ limitPrice?: undefined;
2579
+ fundsReserved?: undefined;
2580
+ durationMs?: undefined;
2581
+ sliceIntervalMs?: undefined;
2582
+ sliceCount?: undefined;
2583
+ sliceQuantity?: undefined;
2584
+ unfilledSlicePolicy?: undefined;
2585
+ firstSliceImmediate?: undefined;
2586
+ lowPrice?: undefined;
2587
+ highPrice?: undefined;
2588
+ levels?: undefined;
2589
+ allLevelsAtOnce?: undefined;
2590
+ } | {
2591
+ type: "limit";
2592
+ price: string;
2593
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
2594
+ expireAt: number | undefined;
2595
+ postOnly: boolean;
2596
+ attached: {
2597
+ takeProfit: {
2598
+ triggerPrice: string;
2599
+ limitPrice: string | undefined;
2600
+ } | undefined;
2601
+ stopLoss: {
2602
+ triggerPrice: string;
2603
+ limitPrice: string | undefined;
2604
+ } | undefined;
2605
+ trailingStop: {
2606
+ trailingDistance: {
2607
+ kind: "distance";
2608
+ distance: string;
2609
+ bps?: undefined;
2610
+ } | {
2611
+ kind: "bps";
2612
+ bps: number;
2613
+ distance?: undefined;
2614
+ } | {
2615
+ kind: "unspecified";
2616
+ distance?: undefined;
2617
+ bps?: undefined;
2618
+ };
2619
+ activationPrice: string | undefined;
2620
+ limitPrice: string | undefined;
2621
+ } | undefined;
2622
+ oco: boolean;
2623
+ } | undefined;
2624
+ maxSlippageBps?: undefined;
2625
+ trailingDistance?: undefined;
2626
+ activationPrice?: undefined;
2627
+ triggerPriceSource?: undefined;
2628
+ limitPrice?: undefined;
2629
+ fundsReserved?: undefined;
2630
+ durationMs?: undefined;
2631
+ sliceIntervalMs?: undefined;
2632
+ sliceCount?: undefined;
2633
+ sliceQuantity?: undefined;
2634
+ unfilledSlicePolicy?: undefined;
2635
+ firstSliceImmediate?: undefined;
2636
+ lowPrice?: undefined;
2637
+ highPrice?: undefined;
2638
+ levels?: undefined;
2639
+ allLevelsAtOnce?: undefined;
2640
+ } | {
2641
+ triggerPrice: string;
2642
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
2643
+ direction: "unspecified" | "at_or_above" | "at_or_below";
2644
+ limitPrice: string | undefined;
2645
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
2646
+ postOnly: boolean;
2647
+ maxSlippageBps: number | undefined;
2648
+ fundsReserved: boolean;
2649
+ type: "stop_loss";
2650
+ attached?: undefined;
2651
+ price?: undefined;
2652
+ expireAt?: undefined;
2653
+ trailingDistance?: undefined;
2654
+ activationPrice?: undefined;
2655
+ durationMs?: undefined;
2656
+ sliceIntervalMs?: undefined;
2657
+ sliceCount?: undefined;
2658
+ sliceQuantity?: undefined;
2659
+ unfilledSlicePolicy?: undefined;
2660
+ firstSliceImmediate?: undefined;
2661
+ lowPrice?: undefined;
2662
+ highPrice?: undefined;
2663
+ levels?: undefined;
2664
+ allLevelsAtOnce?: undefined;
2665
+ } | {
2666
+ triggerPrice: string;
2667
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
2668
+ direction: "unspecified" | "at_or_above" | "at_or_below";
2669
+ limitPrice: string | undefined;
2670
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
2671
+ postOnly: boolean;
2672
+ maxSlippageBps: number | undefined;
2673
+ fundsReserved: boolean;
2674
+ type: "take_profit";
2675
+ attached?: undefined;
2676
+ price?: undefined;
2677
+ expireAt?: undefined;
2678
+ trailingDistance?: undefined;
2679
+ activationPrice?: undefined;
2680
+ durationMs?: undefined;
2681
+ sliceIntervalMs?: undefined;
2682
+ sliceCount?: undefined;
2683
+ sliceQuantity?: undefined;
2684
+ unfilledSlicePolicy?: undefined;
2685
+ firstSliceImmediate?: undefined;
2686
+ lowPrice?: undefined;
2687
+ highPrice?: undefined;
2688
+ levels?: undefined;
2689
+ allLevelsAtOnce?: undefined;
2690
+ } | {
2691
+ type: "trailing_stop";
2692
+ trailingDistance: {
2693
+ kind: "distance";
2694
+ distance: string;
2695
+ bps?: undefined;
2696
+ } | {
2697
+ kind: "bps";
2698
+ bps: number;
2699
+ distance?: undefined;
2700
+ } | {
2701
+ kind: "unspecified";
2702
+ distance?: undefined;
2703
+ bps?: undefined;
2704
+ };
2705
+ activationPrice: string | undefined;
2706
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
2707
+ limitPrice: string | undefined;
2708
+ maxSlippageBps: number | undefined;
2709
+ fundsReserved: boolean;
2710
+ attached?: undefined;
2711
+ price?: undefined;
2712
+ timeInForce?: undefined;
2713
+ expireAt?: undefined;
2714
+ postOnly?: undefined;
2715
+ durationMs?: undefined;
2716
+ sliceIntervalMs?: undefined;
2717
+ sliceCount?: undefined;
2718
+ sliceQuantity?: undefined;
2719
+ unfilledSlicePolicy?: undefined;
2720
+ firstSliceImmediate?: undefined;
2721
+ lowPrice?: undefined;
2722
+ highPrice?: undefined;
2723
+ levels?: undefined;
2724
+ allLevelsAtOnce?: undefined;
2725
+ } | {
2726
+ type: "twap";
2727
+ durationMs: number;
2728
+ sliceIntervalMs: number;
2729
+ sliceCount: number;
2730
+ sliceQuantity: string;
2731
+ limitPrice: string | undefined;
2732
+ maxSlippageBps: number | undefined;
2733
+ unfilledSlicePolicy: "unspecified" | "cancel_before_next";
2734
+ firstSliceImmediate: boolean;
2735
+ attached?: undefined;
2736
+ price?: undefined;
2737
+ timeInForce?: undefined;
2738
+ expireAt?: undefined;
2739
+ postOnly?: undefined;
2740
+ trailingDistance?: undefined;
2741
+ activationPrice?: undefined;
2742
+ triggerPriceSource?: undefined;
2743
+ fundsReserved?: undefined;
2744
+ lowPrice?: undefined;
2745
+ highPrice?: undefined;
2746
+ levels?: undefined;
2747
+ allLevelsAtOnce?: undefined;
2748
+ } | {
2749
+ type: "ladder";
2750
+ lowPrice: string;
2751
+ highPrice: string;
2752
+ levels: {
2753
+ price: string;
2754
+ quantity: string;
2755
+ }[];
2756
+ postOnly: boolean;
2757
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
2758
+ allLevelsAtOnce: boolean;
2759
+ maxSlippageBps?: undefined;
2760
+ attached?: undefined;
2761
+ price?: undefined;
2762
+ expireAt?: undefined;
2763
+ trailingDistance?: undefined;
2764
+ activationPrice?: undefined;
2765
+ triggerPriceSource?: undefined;
2766
+ limitPrice?: undefined;
2767
+ fundsReserved?: undefined;
2768
+ durationMs?: undefined;
2769
+ sliceIntervalMs?: undefined;
2770
+ sliceCount?: undefined;
2771
+ sliceQuantity?: undefined;
2772
+ unfilledSlicePolicy?: undefined;
2773
+ firstSliceImmediate?: undefined;
2774
+ } | {
2775
+ type: "unspecified";
2776
+ maxSlippageBps?: undefined;
2777
+ attached?: undefined;
2778
+ price?: undefined;
2779
+ timeInForce?: undefined;
2780
+ expireAt?: undefined;
2781
+ postOnly?: undefined;
2782
+ trailingDistance?: undefined;
2783
+ activationPrice?: undefined;
2784
+ triggerPriceSource?: undefined;
2785
+ limitPrice?: undefined;
2786
+ fundsReserved?: undefined;
2787
+ durationMs?: undefined;
2788
+ sliceIntervalMs?: undefined;
2789
+ sliceCount?: undefined;
2790
+ sliceQuantity?: undefined;
2791
+ unfilledSlicePolicy?: undefined;
2792
+ firstSliceImmediate?: undefined;
2793
+ lowPrice?: undefined;
2794
+ highPrice?: undefined;
2795
+ levels?: undefined;
2796
+ allLevelsAtOnce?: undefined;
2797
+ };
2798
+ relativePrices: {
2799
+ field: "unspecified" | "limit_price" | "trigger_price" | "activation_price" | "ladder_low_price" | "ladder_high_price" | "take_profit_trigger_price" | "take_profit_limit_price" | "stop_loss_trigger_price" | "stop_loss_limit_price" | "trailing_stop_activation_price" | "trailing_stop_limit_price";
2800
+ /** The resolved absolute price the order carries. */
2801
+ price: string;
2802
+ direction: "unspecified" | "above" | "below";
2803
+ offsetBps: number;
2804
+ reference: {
2805
+ price: string;
2806
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
2807
+ observedAt: number | undefined;
2808
+ type: "market";
2809
+ } | {
2810
+ type: "limit_price";
2811
+ price: string;
2812
+ } | {
2813
+ type: "unspecified";
2814
+ price?: undefined;
2815
+ };
2816
+ rounding: "unspecified" | "down" | "up";
2817
+ tickSize: string;
2818
+ }[];
2819
+ type: "order";
2820
+ orders?: undefined;
2821
+ totalValues?: undefined;
2822
+ cancelAll?: undefined;
2823
+ symbols?: undefined;
2824
+ liveTriggersKept?: undefined;
2825
+ liveTriggersKeptLowerBound?: undefined;
2826
+ triggerId?: undefined;
2827
+ triggerType?: undefined;
2828
+ action?: undefined;
2829
+ before?: undefined;
2830
+ after?: undefined;
2831
+ direction?: undefined;
2832
+ reserveIncrease?: undefined;
2833
+ reserveRelease?: undefined;
2834
+ firesOnResume?: undefined;
2835
+ triggerPrice?: undefined;
2836
+ filledQuantity?: undefined;
2837
+ slicesDone?: undefined;
2838
+ sliceCount?: undefined;
2839
+ levelsFilled?: undefined;
2840
+ levelCount?: undefined;
2841
+ cancelsOpenOrders?: undefined;
2842
+ sourceAsset?: undefined;
2843
+ destinationAsset?: undefined;
2844
+ amount?: undefined;
2845
+ expectedAmountOut?: undefined;
2846
+ minAmountOut?: undefined;
2847
+ maxSlippageBps?: undefined;
2848
+ legs?: undefined;
2849
+ quotedAt?: undefined;
2850
+ /** Approving after this executes nothing. */
2851
+ expiresAt?: undefined;
2852
+ } | {
2853
+ type: "place_orders";
2854
+ orders: {
2855
+ symbolId: number;
2856
+ symbol: string;
2857
+ baseAsset: string;
2858
+ quoteAsset: string;
2859
+ side: "unspecified" | "buy" | "sell";
2860
+ quantity: string | undefined;
2861
+ quoteAmount: string | undefined;
2862
+ estimatedValue: string | undefined;
2863
+ reservedAmount: string | undefined;
2864
+ referencePrice: {
2865
+ price: string;
2866
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
2867
+ observedAt: number | undefined;
2868
+ } | undefined;
2869
+ /** The order type and its own values; `type: "unspecified"` means show the summary only. */
2870
+ order: {
2871
+ type: "market";
2872
+ maxSlippageBps: number | undefined;
2873
+ attached: {
2874
+ takeProfit: {
2875
+ triggerPrice: string;
2876
+ limitPrice: string | undefined;
2877
+ } | undefined;
2878
+ stopLoss: {
2879
+ triggerPrice: string;
2880
+ limitPrice: string | undefined;
2881
+ } | undefined;
2882
+ trailingStop: {
2883
+ trailingDistance: {
2884
+ kind: "distance";
2885
+ distance: string;
2886
+ bps?: undefined;
2887
+ } | {
2888
+ kind: "bps";
2889
+ bps: number;
2890
+ distance?: undefined;
2891
+ } | {
2892
+ kind: "unspecified";
2893
+ distance?: undefined;
2894
+ bps?: undefined;
2895
+ };
2896
+ activationPrice: string | undefined;
2897
+ limitPrice: string | undefined;
2898
+ } | undefined;
2899
+ oco: boolean;
2900
+ } | undefined;
2901
+ price?: undefined;
2902
+ timeInForce?: undefined;
2903
+ expireAt?: undefined;
2904
+ postOnly?: undefined;
2905
+ trailingDistance?: undefined;
2906
+ activationPrice?: undefined;
2907
+ triggerPriceSource?: undefined;
2908
+ limitPrice?: undefined;
2909
+ fundsReserved?: undefined;
2910
+ durationMs?: undefined;
2911
+ sliceIntervalMs?: undefined;
2912
+ sliceCount?: undefined;
2913
+ sliceQuantity?: undefined;
2914
+ unfilledSlicePolicy?: undefined;
2915
+ firstSliceImmediate?: undefined;
2916
+ lowPrice?: undefined;
2917
+ highPrice?: undefined;
2918
+ levels?: undefined;
2919
+ allLevelsAtOnce?: undefined;
2920
+ } | {
2921
+ type: "limit";
2922
+ price: string;
2923
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
2924
+ expireAt: number | undefined;
2925
+ postOnly: boolean;
2926
+ attached: {
2927
+ takeProfit: {
2928
+ triggerPrice: string;
2929
+ limitPrice: string | undefined;
2930
+ } | undefined;
2931
+ stopLoss: {
2932
+ triggerPrice: string;
2933
+ limitPrice: string | undefined;
2934
+ } | undefined;
2935
+ trailingStop: {
2936
+ trailingDistance: {
2937
+ kind: "distance";
2938
+ distance: string;
2939
+ bps?: undefined;
2940
+ } | {
2941
+ kind: "bps";
2942
+ bps: number;
2943
+ distance?: undefined;
2944
+ } | {
2945
+ kind: "unspecified";
2946
+ distance?: undefined;
2947
+ bps?: undefined;
2948
+ };
2949
+ activationPrice: string | undefined;
2950
+ limitPrice: string | undefined;
2951
+ } | undefined;
2952
+ oco: boolean;
2953
+ } | undefined;
2954
+ maxSlippageBps?: undefined;
2955
+ trailingDistance?: undefined;
2956
+ activationPrice?: undefined;
2957
+ triggerPriceSource?: undefined;
2958
+ limitPrice?: undefined;
2959
+ fundsReserved?: undefined;
2960
+ durationMs?: undefined;
2961
+ sliceIntervalMs?: undefined;
2962
+ sliceCount?: undefined;
2963
+ sliceQuantity?: undefined;
2964
+ unfilledSlicePolicy?: undefined;
2965
+ firstSliceImmediate?: undefined;
2966
+ lowPrice?: undefined;
2967
+ highPrice?: undefined;
2968
+ levels?: undefined;
2969
+ allLevelsAtOnce?: undefined;
2970
+ } | {
2971
+ triggerPrice: string;
2972
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
2973
+ direction: "unspecified" | "at_or_above" | "at_or_below";
2974
+ limitPrice: string | undefined;
2975
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
2976
+ postOnly: boolean;
2977
+ maxSlippageBps: number | undefined;
2978
+ fundsReserved: boolean;
2979
+ type: "stop_loss";
2980
+ attached?: undefined;
2981
+ price?: undefined;
2982
+ expireAt?: undefined;
2983
+ trailingDistance?: undefined;
2984
+ activationPrice?: undefined;
2985
+ durationMs?: undefined;
2986
+ sliceIntervalMs?: undefined;
2987
+ sliceCount?: undefined;
2988
+ sliceQuantity?: undefined;
2989
+ unfilledSlicePolicy?: undefined;
2990
+ firstSliceImmediate?: undefined;
2991
+ lowPrice?: undefined;
2992
+ highPrice?: undefined;
2993
+ levels?: undefined;
2994
+ allLevelsAtOnce?: undefined;
2995
+ } | {
2996
+ triggerPrice: string;
2997
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
2998
+ direction: "unspecified" | "at_or_above" | "at_or_below";
2999
+ limitPrice: string | undefined;
3000
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
3001
+ postOnly: boolean;
3002
+ maxSlippageBps: number | undefined;
3003
+ fundsReserved: boolean;
3004
+ type: "take_profit";
3005
+ attached?: undefined;
3006
+ price?: undefined;
3007
+ expireAt?: undefined;
3008
+ trailingDistance?: undefined;
3009
+ activationPrice?: undefined;
3010
+ durationMs?: undefined;
3011
+ sliceIntervalMs?: undefined;
3012
+ sliceCount?: undefined;
3013
+ sliceQuantity?: undefined;
3014
+ unfilledSlicePolicy?: undefined;
3015
+ firstSliceImmediate?: undefined;
3016
+ lowPrice?: undefined;
3017
+ highPrice?: undefined;
3018
+ levels?: undefined;
3019
+ allLevelsAtOnce?: undefined;
3020
+ } | {
3021
+ type: "trailing_stop";
3022
+ trailingDistance: {
3023
+ kind: "distance";
3024
+ distance: string;
3025
+ bps?: undefined;
3026
+ } | {
3027
+ kind: "bps";
3028
+ bps: number;
3029
+ distance?: undefined;
3030
+ } | {
3031
+ kind: "unspecified";
3032
+ distance?: undefined;
3033
+ bps?: undefined;
3034
+ };
3035
+ activationPrice: string | undefined;
3036
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
3037
+ limitPrice: string | undefined;
3038
+ maxSlippageBps: number | undefined;
3039
+ fundsReserved: boolean;
3040
+ attached?: undefined;
3041
+ price?: undefined;
3042
+ timeInForce?: undefined;
3043
+ expireAt?: undefined;
3044
+ postOnly?: undefined;
3045
+ durationMs?: undefined;
3046
+ sliceIntervalMs?: undefined;
3047
+ sliceCount?: undefined;
3048
+ sliceQuantity?: undefined;
3049
+ unfilledSlicePolicy?: undefined;
3050
+ firstSliceImmediate?: undefined;
3051
+ lowPrice?: undefined;
3052
+ highPrice?: undefined;
3053
+ levels?: undefined;
3054
+ allLevelsAtOnce?: undefined;
3055
+ } | {
3056
+ type: "twap";
3057
+ durationMs: number;
3058
+ sliceIntervalMs: number;
3059
+ sliceCount: number;
3060
+ sliceQuantity: string;
3061
+ limitPrice: string | undefined;
3062
+ maxSlippageBps: number | undefined;
3063
+ unfilledSlicePolicy: "unspecified" | "cancel_before_next";
3064
+ firstSliceImmediate: boolean;
3065
+ attached?: undefined;
3066
+ price?: undefined;
3067
+ timeInForce?: undefined;
3068
+ expireAt?: undefined;
3069
+ postOnly?: undefined;
3070
+ trailingDistance?: undefined;
3071
+ activationPrice?: undefined;
3072
+ triggerPriceSource?: undefined;
3073
+ fundsReserved?: undefined;
3074
+ lowPrice?: undefined;
3075
+ highPrice?: undefined;
3076
+ levels?: undefined;
3077
+ allLevelsAtOnce?: undefined;
3078
+ } | {
3079
+ type: "ladder";
3080
+ lowPrice: string;
3081
+ highPrice: string;
3082
+ levels: {
3083
+ price: string;
3084
+ quantity: string;
3085
+ }[];
3086
+ postOnly: boolean;
3087
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
3088
+ allLevelsAtOnce: boolean;
3089
+ maxSlippageBps?: undefined;
3090
+ attached?: undefined;
3091
+ price?: undefined;
3092
+ expireAt?: undefined;
3093
+ trailingDistance?: undefined;
3094
+ activationPrice?: undefined;
3095
+ triggerPriceSource?: undefined;
3096
+ limitPrice?: undefined;
3097
+ fundsReserved?: undefined;
3098
+ durationMs?: undefined;
3099
+ sliceIntervalMs?: undefined;
3100
+ sliceCount?: undefined;
3101
+ sliceQuantity?: undefined;
3102
+ unfilledSlicePolicy?: undefined;
3103
+ firstSliceImmediate?: undefined;
3104
+ } | {
3105
+ type: "unspecified";
3106
+ maxSlippageBps?: undefined;
3107
+ attached?: undefined;
3108
+ price?: undefined;
3109
+ timeInForce?: undefined;
3110
+ expireAt?: undefined;
3111
+ postOnly?: undefined;
3112
+ trailingDistance?: undefined;
3113
+ activationPrice?: undefined;
3114
+ triggerPriceSource?: undefined;
3115
+ limitPrice?: undefined;
3116
+ fundsReserved?: undefined;
3117
+ durationMs?: undefined;
3118
+ sliceIntervalMs?: undefined;
3119
+ sliceCount?: undefined;
3120
+ sliceQuantity?: undefined;
3121
+ unfilledSlicePolicy?: undefined;
3122
+ firstSliceImmediate?: undefined;
3123
+ lowPrice?: undefined;
3124
+ highPrice?: undefined;
3125
+ levels?: undefined;
3126
+ allLevelsAtOnce?: undefined;
3127
+ };
3128
+ relativePrices: {
3129
+ field: "unspecified" | "limit_price" | "trigger_price" | "activation_price" | "ladder_low_price" | "ladder_high_price" | "take_profit_trigger_price" | "take_profit_limit_price" | "stop_loss_trigger_price" | "stop_loss_limit_price" | "trailing_stop_activation_price" | "trailing_stop_limit_price";
3130
+ /** The resolved absolute price the order carries. */
3131
+ price: string;
3132
+ direction: "unspecified" | "above" | "below";
3133
+ offsetBps: number;
3134
+ reference: {
3135
+ price: string;
3136
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
3137
+ observedAt: number | undefined;
3138
+ type: "market";
3139
+ } | {
3140
+ type: "limit_price";
3141
+ price: string;
3142
+ } | {
3143
+ type: "unspecified";
3144
+ price?: undefined;
3145
+ };
3146
+ rounding: "unspecified" | "down" | "up";
3147
+ tickSize: string;
3148
+ }[];
3149
+ }[];
3150
+ totalValues: {
3151
+ quoteAsset: string;
3152
+ value: string;
3153
+ }[];
3154
+ cancelAll?: undefined;
3155
+ symbols?: undefined;
3156
+ side?: undefined;
3157
+ liveTriggersKept?: undefined;
3158
+ liveTriggersKeptLowerBound?: undefined;
3159
+ symbolId?: undefined;
3160
+ symbol?: undefined;
3161
+ baseAsset?: undefined;
3162
+ quoteAsset?: undefined;
3163
+ triggerId?: undefined;
3164
+ triggerType?: undefined;
3165
+ quantity?: undefined;
3166
+ action?: undefined;
3167
+ before?: undefined;
3168
+ after?: undefined;
3169
+ referencePrice?: undefined;
3170
+ direction?: undefined;
3171
+ reserveIncrease?: undefined;
3172
+ reserveRelease?: undefined;
3173
+ firesOnResume?: undefined;
3174
+ triggerPrice?: undefined;
3175
+ filledQuantity?: undefined;
3176
+ slicesDone?: undefined;
3177
+ sliceCount?: undefined;
3178
+ levelsFilled?: undefined;
3179
+ levelCount?: undefined;
3180
+ cancelsOpenOrders?: undefined;
3181
+ sourceAsset?: undefined;
3182
+ destinationAsset?: undefined;
3183
+ amount?: undefined;
3184
+ expectedAmountOut?: undefined;
3185
+ minAmountOut?: undefined;
3186
+ maxSlippageBps?: undefined;
3187
+ legs?: undefined;
3188
+ quotedAt?: undefined;
3189
+ /** Approving after this executes nothing. */
3190
+ expiresAt?: undefined;
3191
+ } | {
3192
+ type: "cancel_orders";
3193
+ orders: {
3194
+ orderId: string;
3195
+ symbol: string;
3196
+ side: "unspecified" | "buy" | "sell";
3197
+ price: string | undefined;
3198
+ quantity: string;
3199
+ filledQuantity: string;
3200
+ }[];
3201
+ cancelAll: boolean;
3202
+ symbols: string[];
3203
+ side: "unspecified" | "buy" | "sell";
3204
+ liveTriggersKept: number;
3205
+ liveTriggersKeptLowerBound: boolean;
3206
+ totalValues?: undefined;
3207
+ symbolId?: undefined;
3208
+ symbol?: undefined;
3209
+ baseAsset?: undefined;
3210
+ quoteAsset?: undefined;
3211
+ triggerId?: undefined;
3212
+ triggerType?: undefined;
3213
+ quantity?: undefined;
3214
+ action?: undefined;
3215
+ before?: undefined;
3216
+ after?: undefined;
3217
+ referencePrice?: undefined;
3218
+ direction?: undefined;
3219
+ reserveIncrease?: undefined;
3220
+ reserveRelease?: undefined;
3221
+ firesOnResume?: undefined;
3222
+ triggerPrice?: undefined;
3223
+ filledQuantity?: undefined;
3224
+ slicesDone?: undefined;
3225
+ sliceCount?: undefined;
3226
+ levelsFilled?: undefined;
3227
+ levelCount?: undefined;
3228
+ cancelsOpenOrders?: undefined;
3229
+ sourceAsset?: undefined;
3230
+ destinationAsset?: undefined;
3231
+ amount?: undefined;
3232
+ expectedAmountOut?: undefined;
3233
+ minAmountOut?: undefined;
3234
+ maxSlippageBps?: undefined;
3235
+ legs?: undefined;
3236
+ quotedAt?: undefined;
3237
+ /** Approving after this executes nothing. */
3238
+ expiresAt?: undefined;
3239
+ } | {
3240
+ type: "order_change";
3241
+ symbolId: number;
3242
+ symbol: string;
3243
+ baseAsset: string;
3244
+ quoteAsset: string;
3245
+ orders: {
3246
+ orderId: string;
3247
+ side: "unspecified" | "buy" | "sell";
3248
+ price: string;
3249
+ newPrice: string | undefined;
3250
+ quantity: string;
3251
+ newQuantity: string | undefined;
3252
+ filledQuantity: string;
3253
+ replaced: boolean;
3254
+ }[];
3255
+ totalValues?: undefined;
3256
+ cancelAll?: undefined;
3257
+ symbols?: undefined;
3258
+ side?: undefined;
3259
+ liveTriggersKept?: undefined;
3260
+ liveTriggersKeptLowerBound?: undefined;
3261
+ triggerId?: undefined;
3262
+ triggerType?: undefined;
3263
+ quantity?: undefined;
3264
+ action?: undefined;
3265
+ before?: undefined;
3266
+ after?: undefined;
3267
+ referencePrice?: undefined;
3268
+ direction?: undefined;
3269
+ reserveIncrease?: undefined;
3270
+ reserveRelease?: undefined;
3271
+ firesOnResume?: undefined;
3272
+ triggerPrice?: undefined;
3273
+ filledQuantity?: undefined;
3274
+ slicesDone?: undefined;
3275
+ sliceCount?: undefined;
3276
+ levelsFilled?: undefined;
3277
+ levelCount?: undefined;
3278
+ cancelsOpenOrders?: undefined;
3279
+ sourceAsset?: undefined;
3280
+ destinationAsset?: undefined;
3281
+ amount?: undefined;
3282
+ expectedAmountOut?: undefined;
3283
+ minAmountOut?: undefined;
3284
+ maxSlippageBps?: undefined;
3285
+ legs?: undefined;
3286
+ quotedAt?: undefined;
3287
+ /** Approving after this executes nothing. */
3288
+ expiresAt?: undefined;
3289
+ } | {
3290
+ type: "trigger_change";
3291
+ triggerId: string;
3292
+ symbolId: number;
3293
+ symbol: string;
3294
+ baseAsset: string;
3295
+ quoteAsset: string;
3296
+ triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
3297
+ side: "unspecified" | "buy" | "sell";
3298
+ quantity: string;
3299
+ action: "unspecified" | "pause" | "modify" | "resume";
3300
+ before: {
3301
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
3302
+ triggerPrice: string | undefined;
3303
+ trailingDistance: {
3304
+ kind: "distance";
3305
+ distance: string;
3306
+ bps?: undefined;
3307
+ } | {
3308
+ kind: "bps";
3309
+ bps: number;
3310
+ distance?: undefined;
3311
+ } | undefined;
3312
+ activationPrice: string | undefined;
3313
+ maxSlippage: {
3314
+ kind: "bps";
3315
+ bps: number;
3316
+ slippage?: undefined;
3317
+ } | {
3318
+ kind: "slippage";
3319
+ slippage: string;
3320
+ bps?: undefined;
3321
+ } | undefined;
3322
+ limitPrice: string | undefined;
3323
+ } | undefined;
3324
+ after: {
3325
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
3326
+ triggerPrice: string | undefined;
3327
+ trailingDistance: {
3328
+ kind: "distance";
3329
+ distance: string;
3330
+ bps?: undefined;
3331
+ } | {
3332
+ kind: "bps";
3333
+ bps: number;
3334
+ distance?: undefined;
3335
+ } | undefined;
3336
+ activationPrice: string | undefined;
3337
+ maxSlippage: {
3338
+ kind: "bps";
3339
+ bps: number;
3340
+ slippage?: undefined;
3341
+ } | {
3342
+ kind: "slippage";
3343
+ slippage: string;
3344
+ bps?: undefined;
3345
+ } | undefined;
3346
+ limitPrice: string | undefined;
3347
+ } | undefined;
3348
+ referencePrice: {
3349
+ price: string;
3350
+ source: "unspecified" | "best_bid" | "best_ask" | "last_price" | "index_price";
3351
+ observedAt: number | undefined;
3352
+ } | undefined;
3353
+ direction: "unspecified" | "at_or_above" | "at_or_below";
3354
+ reserveIncrease: string | undefined;
3355
+ reserveRelease: string | undefined;
3356
+ firesOnResume: boolean;
3357
+ orders?: undefined;
3358
+ totalValues?: undefined;
3359
+ cancelAll?: undefined;
3360
+ symbols?: undefined;
3361
+ liveTriggersKept?: undefined;
3362
+ liveTriggersKeptLowerBound?: undefined;
3363
+ triggerPrice?: undefined;
3364
+ filledQuantity?: undefined;
3365
+ slicesDone?: undefined;
3366
+ sliceCount?: undefined;
3367
+ levelsFilled?: undefined;
3368
+ levelCount?: undefined;
3369
+ cancelsOpenOrders?: undefined;
3370
+ sourceAsset?: undefined;
3371
+ destinationAsset?: undefined;
3372
+ amount?: undefined;
3373
+ expectedAmountOut?: undefined;
3374
+ minAmountOut?: undefined;
3375
+ maxSlippageBps?: undefined;
3376
+ legs?: undefined;
3377
+ quotedAt?: undefined;
3378
+ /** Approving after this executes nothing. */
3379
+ expiresAt?: undefined;
3380
+ } | {
3381
+ type: "cancel_trigger";
3382
+ triggerId: string;
3383
+ symbolId: number;
3384
+ symbol: string;
3385
+ triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
3386
+ side: "unspecified" | "buy" | "sell";
3387
+ quantity: string;
3388
+ triggerPrice: string | undefined;
3389
+ filledQuantity: string | undefined;
3390
+ slicesDone: number | undefined;
3391
+ sliceCount: number | undefined;
3392
+ levelsFilled: number | undefined;
3393
+ levelCount: number | undefined;
3394
+ cancelsOpenOrders: boolean;
3395
+ orders?: undefined;
3396
+ totalValues?: undefined;
3397
+ cancelAll?: undefined;
3398
+ symbols?: undefined;
3399
+ liveTriggersKept?: undefined;
3400
+ liveTriggersKeptLowerBound?: undefined;
3401
+ baseAsset?: undefined;
3402
+ quoteAsset?: undefined;
3403
+ action?: undefined;
3404
+ before?: undefined;
3405
+ after?: undefined;
3406
+ referencePrice?: undefined;
3407
+ direction?: undefined;
3408
+ reserveIncrease?: undefined;
3409
+ reserveRelease?: undefined;
3410
+ firesOnResume?: undefined;
3411
+ sourceAsset?: undefined;
3412
+ destinationAsset?: undefined;
3413
+ amount?: undefined;
3414
+ expectedAmountOut?: undefined;
3415
+ minAmountOut?: undefined;
3416
+ maxSlippageBps?: undefined;
3417
+ legs?: undefined;
3418
+ quotedAt?: undefined;
3419
+ /** Approving after this executes nothing. */
3420
+ expiresAt?: undefined;
3421
+ } | {
3422
+ type: "swap";
3423
+ sourceAsset: string;
3424
+ destinationAsset: string;
3425
+ amount: string;
3426
+ expectedAmountOut: string;
3427
+ minAmountOut: string;
3428
+ maxSlippageBps: number;
3429
+ legs: {
3430
+ symbol: string;
3431
+ side: "unspecified" | "buy" | "sell";
3432
+ averagePrice: string;
3433
+ priceImpactBps: number;
3434
+ takerFeeRatePercent: string;
3435
+ fee: string;
3436
+ feeAsset: string;
3437
+ }[];
3438
+ quotedAt: number | undefined;
3439
+ /** Approving after this executes nothing. */
3440
+ expiresAt: number | undefined;
3441
+ orders?: undefined;
3442
+ totalValues?: undefined;
3443
+ cancelAll?: undefined;
3444
+ symbols?: undefined;
3445
+ side?: undefined;
3446
+ liveTriggersKept?: undefined;
3447
+ liveTriggersKeptLowerBound?: undefined;
3448
+ symbolId?: undefined;
3449
+ symbol?: undefined;
3450
+ baseAsset?: undefined;
3451
+ quoteAsset?: undefined;
3452
+ triggerId?: undefined;
3453
+ triggerType?: undefined;
3454
+ quantity?: undefined;
3455
+ action?: undefined;
3456
+ before?: undefined;
3457
+ after?: undefined;
3458
+ referencePrice?: undefined;
3459
+ direction?: undefined;
3460
+ reserveIncrease?: undefined;
3461
+ reserveRelease?: undefined;
3462
+ firesOnResume?: undefined;
3463
+ triggerPrice?: undefined;
3464
+ filledQuantity?: undefined;
3465
+ slicesDone?: undefined;
3466
+ sliceCount?: undefined;
3467
+ levelsFilled?: undefined;
3468
+ levelCount?: undefined;
3469
+ cancelsOpenOrders?: undefined;
3470
+ } | {
3471
+ type: "unspecified";
3472
+ orders?: undefined;
3473
+ totalValues?: undefined;
3474
+ cancelAll?: undefined;
3475
+ symbols?: undefined;
3476
+ side?: undefined;
3477
+ liveTriggersKept?: undefined;
3478
+ liveTriggersKeptLowerBound?: undefined;
3479
+ symbolId?: undefined;
3480
+ symbol?: undefined;
3481
+ baseAsset?: undefined;
3482
+ quoteAsset?: undefined;
3483
+ triggerId?: undefined;
3484
+ triggerType?: undefined;
3485
+ quantity?: undefined;
3486
+ action?: undefined;
3487
+ before?: undefined;
3488
+ after?: undefined;
3489
+ referencePrice?: undefined;
3490
+ direction?: undefined;
3491
+ reserveIncrease?: undefined;
3492
+ reserveRelease?: undefined;
3493
+ firesOnResume?: undefined;
3494
+ triggerPrice?: undefined;
3495
+ filledQuantity?: undefined;
3496
+ slicesDone?: undefined;
3497
+ sliceCount?: undefined;
3498
+ levelsFilled?: undefined;
3499
+ levelCount?: undefined;
3500
+ cancelsOpenOrders?: undefined;
3501
+ sourceAsset?: undefined;
3502
+ destinationAsset?: undefined;
3503
+ amount?: undefined;
3504
+ expectedAmountOut?: undefined;
3505
+ minAmountOut?: undefined;
3506
+ maxSlippageBps?: undefined;
3507
+ legs?: undefined;
3508
+ quotedAt?: undefined;
3509
+ /** Approving after this executes nothing. */
3510
+ expiresAt?: undefined;
3511
+ };
3512
+ text?: undefined;
3513
+ fromSeq?: undefined;
3514
+ toolCallId?: undefined;
3515
+ name?: undefined;
3516
+ input?: undefined;
3517
+ ok?: undefined;
3518
+ errorMessage?: undefined;
3519
+ memories?: undefined;
3520
+ destinationIds?: undefined;
3521
+ subagentId?: undefined;
3522
+ status?: undefined;
3523
+ view?: undefined;
3524
+ usage?: undefined;
3525
+ category?: undefined;
3526
+ message?: undefined;
3527
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
3528
+ seq: number;
3529
+ createdAt: number | undefined;
3530
+ } | {
3531
+ type: "approval_resolved";
3532
+ approvalId: string;
3533
+ status: "unspecified" | "pending" | "expired" | "approved" | "rejected";
3534
+ text?: undefined;
3535
+ fromSeq?: undefined;
3536
+ toolCallId?: undefined;
3537
+ name?: undefined;
3538
+ input?: undefined;
3539
+ ok?: undefined;
3540
+ errorMessage?: undefined;
3541
+ memories?: undefined;
3542
+ destinationIds?: undefined;
3543
+ subagentId?: undefined;
3544
+ summary?: undefined;
3545
+ /** Approving after this executes nothing. */
3546
+ expiresAt?: undefined;
3547
+ parameters?: undefined;
3548
+ accountId?: undefined;
3549
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
3550
+ preview?: undefined;
3551
+ view?: undefined;
3552
+ usage?: undefined;
3553
+ category?: undefined;
3554
+ message?: undefined;
3555
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
3556
+ seq: number;
3557
+ createdAt: number | undefined;
3558
+ } | {
3559
+ type: "view";
3560
+ view: {
3561
+ type: "orders_table";
3562
+ orders: {
3563
+ version: number;
3564
+ expireAt?: number | undefined;
3565
+ submittedMaxQuoteDebit?: string | undefined;
3566
+ batchRequestId?: string | undefined;
3567
+ marketMaxSlippage?: MarketMaxSlippage | undefined;
3568
+ marketClientRefPrice?: string | undefined;
3569
+ origin?: {
3570
+ scope: "unspecified" | "direct" | "attached_risk" | "standalone_trigger" | "system";
3571
+ triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
3572
+ triggerId?: string | undefined;
3573
+ parentOrderId?: string | undefined;
3574
+ childSeq: number;
3575
+ } | undefined;
3576
+ attachedRisk: {
3577
+ takeProfit: {
3578
+ state: {
3579
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running" | "not_configured";
3580
+ armedTs: number | undefined;
3581
+ armedTsNs: string | undefined;
3582
+ terminalTs: number | undefined;
3583
+ terminalTsNs: string | undefined;
3584
+ triggerId: string | undefined;
3585
+ childOrderId: string | undefined;
3586
+ } | undefined;
3587
+ triggerPrice?: string | undefined;
3588
+ execution?: {
3589
+ readonly type: "market_ioc";
3590
+ price?: undefined;
3591
+ } | {
3592
+ readonly type: "limit_gtc";
3593
+ readonly price: string;
3594
+ } | undefined;
3595
+ triggerPriceSource?: "unspecified" | "last" | "index" | "mark" | undefined;
3596
+ } | undefined;
3597
+ stopLoss: {
3598
+ state: {
3599
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running" | "not_configured";
3600
+ armedTs: number | undefined;
3601
+ armedTsNs: string | undefined;
3602
+ terminalTs: number | undefined;
3603
+ terminalTsNs: string | undefined;
3604
+ triggerId: string | undefined;
3605
+ childOrderId: string | undefined;
3606
+ } | undefined;
3607
+ triggerPrice?: string | undefined;
3608
+ execution?: {
3609
+ readonly type: "market_ioc";
3610
+ price?: undefined;
3611
+ } | {
3612
+ readonly type: "limit_gtc";
3613
+ readonly price: string;
3614
+ } | undefined;
3615
+ triggerPriceSource?: "unspecified" | "last" | "index" | "mark" | undefined;
3616
+ } | undefined;
3617
+ trailingStop: {
3618
+ state: {
3619
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running" | "not_configured";
3620
+ armedTs: number | undefined;
3621
+ armedTsNs: string | undefined;
3622
+ terminalTs: number | undefined;
3623
+ terminalTsNs: string | undefined;
3624
+ triggerId: string | undefined;
3625
+ childOrderId: string | undefined;
3626
+ } | undefined;
3627
+ trailingDistance?: ({
3628
+ kind: "distance";
3629
+ distance: string;
3630
+ } | {
3631
+ kind: "bps";
3632
+ bps: number;
3633
+ } | {
3634
+ kind: "none";
3635
+ }) | undefined;
3636
+ maxSlippage?: ({
3637
+ kind: "slippage";
3638
+ slippage: string;
3639
+ } | {
3640
+ kind: "bps";
3641
+ bps: number;
3642
+ }) | undefined;
3643
+ activationPrice?: string | undefined;
3644
+ limitPrice?: string | undefined;
3645
+ triggerPriceSource?: "unspecified" | "last" | "index" | "mark" | undefined;
3646
+ } | undefined;
3647
+ oco: boolean;
3648
+ } | undefined;
3649
+ cancelReason?: "unspecified" | "system" | "user_request" | "ioc_remainder" | "market_remainder" | "stp_expire_maker" | "stp_expire_taker" | "stp_expire_both" | "replaced" | "gtd_expired" | "qty_at_or_below_filled" | "pair_drain" | "attached_risk_refused" | "cancel_all_after" | "account_repair" | "twap_rollover" | "strategy_cancel" | "market_halted" | "attached_exit_fired" | undefined;
3650
+ rejectReason?: "STALE_QUOTE" | "UNSPECIFIED" | "BAD_REQUEST" | "INVALID_ARGUMENT" | "INSUFFICIENT_FUNDS" | "UNKNOWN_SYMBOL" | "BAD_PRICE" | "BAD_QTY" | "MIN_NOTIONAL" | "QTY_STEP_SIZE" | "CONFLICT_DUPLICATE_CLIENT_ORDER_ID" | "UNAVAILABLE" | "UNAUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "UPSTREAM_ERROR" | "FEE_ASSET_NOT_ALLOWED" | "PAIR_DISABLED" | "ORDER_UNKNOWN" | "INTERNAL_ERROR" | "SUBACCOUNT_INACTIVE" | "POLICY_MARKET_DENY" | "POLICY_MAX_NOTIONAL" | "POLICY_TRADING_HALTED" | "POLICY_SPOT_TRADE_DENY" | "API_KEY_ROOT_SCOPE_ONLY" | "API_KEY_SUB_SCOPE_ONLY" | "API_KEY_SUBACCOUNT_MISMATCH" | "API_KEY_POLICY_REQUIRED" | "API_KEY_UNKNOWN" | "API_KEY_MARKET_DENY" | "PRICE_TICK_SIZE" | "MIN_QTY" | "POST_ONLY_LIMIT_ONLY" | "BATCH_TOO_LARGE" | "POLICY_MAX_OPEN_ORDERS" | "MODIFICATION_REQUIRES_REPLACE" | "CONFLICT_IDEMPOTENCY_KEY_REUSE" | "MARKET_PRICE_UNAVAILABLE" | "PAIR_NOT_LISTED_YET" | "PAIR_DELISTED" | "PAIR_CANCEL_ONLY" | "PAIR_POST_ONLY" | "PAIR_REDUCE_ONLY" | "RISK_LIMIT" | "MARKET_HALTED" | "ACCOUNT_UNKNOWN" | "POST_ONLY_CROSS" | "REDUCE_ONLY_BLOCKED" | "PRICE_BAND_VIOLATION" | "MARKET_CAP_VIOLATION" | "EMPTY_BOOK" | "FOK_INSUFFICIENT_LIQUIDITY" | "ORDER_ALREADY_TERMINAL" | "TRIGGER_PRICE_INVALID" | "TRIGGER_PRICE_SOURCE_UNSUPPORTED" | "TRAILING_DISTANCE_INVALID" | "TRIGGER_NOT_FOUND" | "TRIGGER_STATUS_INVALID" | "TRIGGER_NOT_MODIFIABLE" | "CONFLICT_DUPLICATE_CLIENT_TRIGGER_ID" | "MAX_SLIPPAGE_INVALID" | "VALIDATION_ERROR" | "OVERLOADED" | "MAX_QUOTE_DEBIT_TOO_SMALL" | "RATE_LIMIT_EXCEEDED" | "SUBACCOUNT_READ_FORBIDDEN" | "POLICY_SPOT_READ_DENY" | "API_KEY_SPOT_READ_DENY" | "CANCEL_REQUEST_EXPIRED" | "MAX_QTY" | "MAX_NOTIONAL" | "QTY_AT_OR_BELOW_FILLED" | "GATEWAY_MISCONFIGURED" | "INVALID_ORDER_ID" | "CHILD_QTY_RAISE_NOT_ALLOWED" | "ATTACHED_RISK_NOT_SUPPORTED" | "SETTLEMENT_BACKLOGGED" | "PRICE_LEVEL_QUANTITY_LIMIT" | "MARKET_QUOTE_STALE" | "MARKET_QUOTE_UNHEALTHY" | "INVALID_TIME_IN_FORCE" | "QUICKSWAP_NOT_PERMITTED" | "DUPLICATE_ORDER_ID" | "MAX_OPEN_ORDERS_TOTAL" | "STP_MODE_NOT_ALLOWED" | "PAIR_BACKLOGGED" | "PRICE_LEVELS_EXHAUSTED" | "CLIENT_ORDER_IDS_EXHAUSTED" | "ORDER_ID_CONFLICT" | "INVALID_SIDE" | "INVALID_ORDER_TYPE" | "INVALID_STP_MODE" | "INVALID_ORDER_FLAGS" | "BATCH_OTHER_ITEM_INVALID" | "REPLACE_ONTO_OWN_ID" | "INVALID_CLIENT_ORDER_ID" | "ORDER_SEQUENCE_EXHAUSTED" | "INVALID_HANDLING_MODE" | "FEE_SCHEDULE_UNAVAILABLE" | "POLICY_UNAVAILABLE" | "CANCEL_ALL_AFTER_TIMEOUT_INVALID" | "CANCEL_SCOPE_TOO_LARGE" | "RATE_LIMIT_POLICY_UNAVAILABLE" | "SYSTEM_RATE_LIMITED" | "ORDER_MODIFY_IN_PROGRESS" | "ORDER_PLACEMENT_PENDING" | "INVALID_MODIFY_BEHAVIOR" | "BATCH_REPLACE_ONLY_REQUIRED" | "BATCH_SINGLE_SYMBOL_REQUIRED" | "REQUEST_RECEIPTS_EXHAUSTED" | "INTENT_ID_INVALID" | "DRY_RUN_INVALID" | "CANCEL_ALL_AFTER_SCOPE_CONFLICT" | "NEW_ACCOUNT_CAPACITY_REACHED" | "TRIGGER_CHILD_PRICE_NOT_MODIFIABLE" | "TRIGGER_GENERATIONS_EXHAUSTED" | "TRIGGER_CONTROL_SHARE_EXHAUSTED" | "TRIGGER_CONTROLS_BUSY" | "TRIGGER_TYPE_NOT_SUPPORTED" | "INVALID_TRIGGER_TYPE" | "TRIGGER_DIRECTION_INVALID" | "TRIGGER_QTY_INVALID" | "TRIGGER_BUY_REQUIRES_LIMIT" | "ACCOUNT_ROUTING_INVALID" | "TRIGGER_LIMIT_EXCEEDED" | "TRIGGER_CONTROL_IN_PROGRESS" | "TRIGGER_PATCH_EMPTY" | "CLIENT_TRIGGER_ID_INVALID" | "TRIGGER_ACTIVATION_PRICE_INVALID" | "SLIPPAGE_TICKS_INVALID" | "SLIPPAGE_BPS_INVALID" | "TRIGGER_CONTROL_OUTCOME_UNKNOWN" | "TRIGGER_CAPACITY_REACHED" | "RESERVATION_CAPACITY_REACHED" | "CLIENT_ORDER_ID_CAPACITY_REACHED" | "ACCOUNT_RESERVATION_LIMIT_REACHED" | "INVALID_TRIGGER_CONTROL" | "TRIGGER_PATCH_NOT_ALLOWED" | "TRIGGER_PATCH_FIELD_UNKNOWN" | "TRIGGER_PATCH_VALUE_UNMASKED" | "TRIGGER_PATCH_PRICE_MODE_INVALID" | "ACCOUNT_ORDERS_SUSPENDED" | "TRAILING_SIDE_NOT_SUPPORTED" | "TRAILING_CHILD_NOT_MARKET" | "TWAP_DURATION_INVALID" | "LIMIT_CHILD_SLIPPAGE_SET" | "SLIPPAGE_BOUNDS_CONFLICT" | "TWAP_INTERVAL_INVALID" | "LADDER_LEVEL_REJECTED" | "LADDER_RANGE_TOO_NARROW" | "LADDER_LEVELS_INVALID" | "ORDER_LIMITS_UNAVAILABLE" | "ORDER_TYPE_NOT_ALLOWED_IN_AUCTION" | "POST_ONLY_NOT_ALLOWED_IN_AUCTION" | "QUICKSWAP_FEE_DETAILS_INCOMPLETE" | "QUICKSWAP_MARKET_NOT_PRICED" | "QUICKSWAP_BROKER_FEE_TERMS_MISMATCH" | "QUICKSWAP_FEE_RECIPIENT_IS_PAYER" | "QUICKSWAP_BROKER_FEE_TERMS_UNAVAILABLE" | "QUICKSWAP_BROKER_ACCOUNT_UNAVAILABLE" | "QUICKSWAP_ACCOUNT_OWNER_UNKNOWN" | "QUICKSWAP_DISABLED" | "QUICKSWAP_ATTACHED_RISK_NOT_ALLOWED" | "QUICKSWAP_ORDER_NOT_MODIFIABLE" | "QUICKSWAP_FEE_TOTAL_TOO_HIGH" | "QUICKSWAP_BROKER_FEE_TERMS_INVALID" | "QUICKSWAP_BROKER_INVALID" | "QUICKSWAP_FEE_SCHEDULE_INVALID" | "QUICKSWAP_MARKET_FEE_INVALID" | "QUICKSWAP_SETUP_INVALID" | "QUICKSWAP_CAPACITY_REACHED" | "ATTACHED_EXIT_WORKING" | "MARKET_TRIGGER_LIMIT_EXCEEDED" | "MARKET_TWAP_LIMIT_EXCEEDED" | "MARKET_LADDER_LIMIT_EXCEEDED" | "CHILD_QTY_EXCEEDS_REMAINING" | "ORDER_CANCEL_OUTCOME_UNKNOWN" | "ORDER_MODIFY_OUTCOME_UNKNOWN" | "ORDER_REPAIRING" | "ACCOUNT_REPAIRING" | "TRIGGER_WOULD_TRIGGER_IMMEDIATELY" | "ORDER_CREATE_OUTCOME_UNKNOWN" | "TRIGGER_CREATE_OUTCOME_UNKNOWN" | "TRIGGER_SYMBOL_MISMATCH" | "MAX_OPEN_ORDERS_PER_PAIR" | "SELF_TRADE_PREVENTED" | "ATTACHED_LEGS_EXCEEDED" | "FEE_ASSET_INVALID" | "FEE_CEILING_INVALID" | "UNSUPPORTED_FIELD_SET" | "TRIGGER_FIRE_LIMIT_REACHED" | "CONDITION_FLAGS_INVALID" | "CONDITION_PARAMETER_SET" | "TWAP_CAPACITY_REACHED" | "CHILD_ORDER_INCONSISTENT" | "PATH_BODY_ID_MISMATCH" | "REQUEST_DEADLINE_EXCEEDED" | undefined;
3651
+ price: string;
3652
+ createdTs: number;
3653
+ terminalTs: number;
3654
+ feeTotal?: {
3655
+ amount: string;
3656
+ isRebate: boolean;
3657
+ qty: string;
3658
+ } | undefined;
3659
+ symbolId: number;
3660
+ clientOrderId: string;
3661
+ status: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled" | "partial";
3662
+ side: "unspecified" | "buy" | "sell";
3663
+ orderType: "unspecified" | "limit" | "market";
3664
+ timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
3665
+ selfTradePreventionMode: "unspecified" | "expire_taker" | "expire_maker" | "expire_both";
3666
+ feeAsset: "unspecified" | "quote" | "base";
3667
+ postOnly: boolean;
3668
+ totalQty: string;
3669
+ cumQty: string;
3670
+ inheritedCumQty: string;
3671
+ leavesQty: string;
3672
+ avgPx: string;
3673
+ cumQuote: string;
3674
+ lineage?: {
3675
+ id: string;
3676
+ generation: number;
3677
+ } | undefined;
3678
+ orderId: string;
3679
+ }[];
3680
+ truncated: boolean;
3681
+ accountId: string;
3682
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
3683
+ triggers?: undefined;
3684
+ balances?: undefined;
3685
+ symbolId?: undefined;
3686
+ timeframe?: undefined;
3687
+ candles?: undefined;
3688
+ columns?: undefined;
3689
+ /** A row may have fewer cells than columns; missing cells are empty. */
3690
+ rows?: undefined;
3691
+ alert?: undefined;
3692
+ depositAddress?: undefined;
3693
+ assetId?: undefined;
3694
+ history?: undefined;
3695
+ transfers?: undefined;
3696
+ } | {
3697
+ type: "triggers_table";
3698
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
3699
+ triggers: ({
3700
+ runtimeDetails: TriggerDetailsOutput;
3701
+ version: number;
3702
+ cancelReason: "unspecified" | "internal_error" | "oco" | "user_request" | "account_repair" | "market_halted" | "parent_canceled_no_fill" | "self_trade_prevention" | "pair_drain_trigger" | "pair_drain_twap" | "pair_drain_ladder" | "pair_drain_attached_leg" | "missing_reason_code";
3703
+ failureReason: undefined;
3704
+ triggerId: string;
3705
+ subaccountId: string;
3706
+ symbolId: number;
3707
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
3708
+ parentOrderId: string | undefined;
3709
+ qty: string;
3710
+ feeAsset: "unspecified" | "quote" | "base";
3711
+ selfTradePreventionMode: "unspecified" | "expire_taker" | "expire_maker" | "expire_both";
3712
+ configuration: {
3713
+ type: "stop_loss" | "take_profit";
3714
+ side: "unspecified" | "buy" | "sell";
3715
+ triggerPrice: string;
3716
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
3717
+ execution: {
3718
+ readonly type: "market_ioc";
3719
+ readonly maxSlippage: {
3720
+ kind: "slippage";
3721
+ slippage: string;
3722
+ bps?: undefined;
3723
+ } | {
3724
+ kind: "bps";
3725
+ bps: number;
3726
+ slippage?: undefined;
3727
+ } | {
3728
+ kind: "none";
3729
+ slippage?: undefined;
3730
+ bps?: undefined;
3731
+ };
3732
+ price?: undefined;
3733
+ postOnly?: undefined;
3734
+ } | {
3735
+ readonly type: "limit_gtc";
3736
+ readonly price: string;
3737
+ readonly postOnly: boolean;
3738
+ readonly maxSlippage?: undefined;
3739
+ } | {
3740
+ readonly type: "limit_ioc";
3741
+ readonly price: string;
3742
+ readonly maxSlippage?: undefined;
3743
+ postOnly?: undefined;
3744
+ } | {
3745
+ readonly type: "limit_fok";
3746
+ readonly price: string;
3747
+ readonly maxSlippage?: undefined;
3748
+ postOnly?: undefined;
3749
+ } | {
3750
+ readonly type: "unspecified";
3751
+ readonly maxSlippage?: undefined;
3752
+ price?: undefined;
3753
+ postOnly?: undefined;
3754
+ };
3755
+ trailingDistance?: undefined;
3756
+ activationPrice?: undefined;
3757
+ readonly maxSlippage?: undefined;
3758
+ limitPrice?: undefined;
3759
+ durationMs?: undefined;
3760
+ sliceIntervalMs?: undefined;
3761
+ priceMin?: undefined;
3762
+ priceMax?: undefined;
3763
+ levels?: undefined;
3764
+ postOnly?: undefined;
3765
+ } | {
3766
+ type: "trailing_stop";
3767
+ side: "unspecified" | "buy" | "sell";
3768
+ trailingDistance: {
3769
+ kind: "distance";
3770
+ distance: string;
3771
+ bps?: undefined;
3772
+ } | {
3773
+ kind: "bps";
3774
+ bps: number;
3775
+ distance?: undefined;
3776
+ } | {
3777
+ kind: "unspecified";
3778
+ distance?: undefined;
3779
+ bps?: undefined;
3780
+ };
3781
+ activationPrice: string | undefined;
3782
+ maxSlippage: {
3783
+ kind: "slippage";
3784
+ slippage: string;
3785
+ bps?: undefined;
3786
+ } | {
3787
+ kind: "bps";
3788
+ bps: number;
3789
+ slippage?: undefined;
3790
+ } | {
3791
+ kind: "none";
3792
+ slippage?: undefined;
3793
+ bps?: undefined;
3794
+ };
3795
+ limitPrice: string | undefined;
3796
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
3797
+ triggerPrice?: undefined;
3798
+ execution?: undefined;
3799
+ durationMs?: undefined;
3800
+ sliceIntervalMs?: undefined;
3801
+ priceMin?: undefined;
3802
+ priceMax?: undefined;
3803
+ levels?: undefined;
3804
+ postOnly?: undefined;
3805
+ } | {
3806
+ type: "twap";
3807
+ side: "unspecified" | "buy" | "sell";
3808
+ durationMs: number;
3809
+ sliceIntervalMs: number;
3810
+ execution: {
3811
+ readonly type: "market_ioc";
3812
+ readonly maxSlippage: {
3813
+ kind: "slippage";
3814
+ slippage: string;
3815
+ bps?: undefined;
3816
+ } | {
3817
+ kind: "bps";
3818
+ bps: number;
3819
+ slippage?: undefined;
3820
+ } | {
3821
+ kind: "none";
3822
+ slippage?: undefined;
3823
+ bps?: undefined;
3824
+ };
3825
+ price?: undefined;
3826
+ } | {
3827
+ readonly type: "limit_gtc";
3828
+ readonly price: string;
3829
+ readonly maxSlippage?: undefined;
3830
+ } | {
3831
+ readonly type: "unspecified";
3832
+ readonly maxSlippage?: undefined;
3833
+ price?: undefined;
3834
+ };
3835
+ triggerPrice?: undefined;
3836
+ triggerPriceSource?: undefined;
3837
+ trailingDistance?: undefined;
3838
+ activationPrice?: undefined;
3839
+ readonly maxSlippage?: undefined;
3840
+ limitPrice?: undefined;
3841
+ priceMin?: undefined;
3842
+ priceMax?: undefined;
3843
+ levels?: undefined;
3844
+ postOnly?: undefined;
3845
+ } | {
3846
+ type: "ladder";
3847
+ side: "unspecified" | "buy" | "sell";
3848
+ priceMin: string;
3849
+ priceMax: string;
3850
+ levels: number;
3851
+ postOnly: boolean;
3852
+ triggerPrice?: undefined;
3853
+ triggerPriceSource?: undefined;
3854
+ execution?: undefined;
3855
+ trailingDistance?: undefined;
3856
+ activationPrice?: undefined;
3857
+ readonly maxSlippage?: undefined;
3858
+ limitPrice?: undefined;
3859
+ durationMs?: undefined;
3860
+ sliceIntervalMs?: undefined;
3861
+ } | {
3862
+ type: "unspecified";
3863
+ side?: undefined;
3864
+ triggerPrice?: undefined;
3865
+ triggerPriceSource?: undefined;
3866
+ execution?: undefined;
3867
+ trailingDistance?: undefined;
3868
+ activationPrice?: undefined;
3869
+ readonly maxSlippage?: undefined;
3870
+ limitPrice?: undefined;
3871
+ durationMs?: undefined;
3872
+ sliceIntervalMs?: undefined;
3873
+ priceMin?: undefined;
3874
+ priceMax?: undefined;
3875
+ levels?: undefined;
3876
+ postOnly?: undefined;
3877
+ };
3878
+ clientTriggerId: string;
3879
+ createdTs: number | undefined;
3880
+ updatedTs: number | undefined;
3881
+ armedTs: number | undefined;
3882
+ completedTs: number | undefined;
3883
+ } | {
3884
+ runtimeDetails: TriggerDetailsOutput;
3885
+ version: number;
3886
+ cancelReason: undefined;
3887
+ failureReason: "unspecified" | "internal_error" | "market_halted" | "missing_reason_code" | "unknown_symbol" | "pair_disabled" | "min_notional" | "tick_size" | "insufficient_funds" | "risk_limit" | "duplicate_client_id" | "engine_busy" | "account_unknown" | "order_unknown" | "post_only_cross" | "reduce_only_blocked" | "price_band_violation" | "market_cap_violation" | "empty_book" | "fok_insufficient_liquidity" | "fee_asset_not_allowed" | "market_price_unavailable" | "stale_quote" | "min_quantity" | "step_size" | "invalid_sizing" | "max_quote_debit_too_small" | "fee_ceiling_exceeded" | "trigger_price_invalid" | "trigger_price_source_unsupported" | "trailing_distance_invalid" | "modification_requires_replace" | "order_already_terminal" | "conflict_idempotency_key_reuse" | "rate_limited" | "policy_spot_trade_deny" | "policy_market_deny" | "policy_max_notional" | "policy_max_open_orders" | "policy_trading_halted" | "max_slippage_invalid" | "invalid_time_in_force" | "duplicate_order_id" | "max_quantity" | "max_notional" | "pair_post_only" | "max_open_orders_total" | "stp_mode_not_allowed" | "pair_backlogged" | "mode_not_supported" | "market_quote_stale" | "market_quote_unhealthy" | "qty_invalid" | "limit_price_invalid" | "twap_interval_invalid" | "ladder_range_too_narrow" | "ladder_levels_invalid" | "attached_legs_exceeded" | "price_levels_exhausted" | "settlement_backlogged" | "client_order_ids_exhausted" | "invalid_order_id" | "order_id_conflict" | "invalid_side" | "invalid_order_type" | "invalid_stp_mode" | "invalid_order_flags" | "price_level_quantity_limit" | "child_qty_raise_not_allowed" | "triggers_exhausted" | "order_sequence_exhausted" | "fee_schedule_unavailable" | "policy_unavailable" | "account_routing_invalid" | "client_trigger_id_invalid" | "trigger_direction_invalid" | "fee_asset_invalid" | "fee_ceiling_invalid" | "unsupported_field_set" | "trigger_fire_limit_reached" | "condition_flags_invalid" | "condition_parameter_set" | "slippage_ticks_invalid" | "slippage_bps_invalid" | "slippage_bounds_conflict" | "limit_child_slippage_set" | "new_account_capacity_reached" | "order_type_not_allowed_in_auction" | "post_only_not_allowed_in_auction" | "twap_capacity_reached" | "order_limits_unavailable" | "child_order_inconsistent" | "index_price_unavailable" | "trigger_would_trigger_immediately" | "max_open_orders_per_pair" | "account_repairing" | "self_trade_prevented";
3888
+ triggerId: string;
3889
+ subaccountId: string;
3890
+ symbolId: number;
3891
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
3892
+ parentOrderId: string | undefined;
3893
+ qty: string;
3894
+ feeAsset: "unspecified" | "quote" | "base";
3895
+ selfTradePreventionMode: "unspecified" | "expire_taker" | "expire_maker" | "expire_both";
3896
+ configuration: {
3897
+ type: "stop_loss" | "take_profit";
3898
+ side: "unspecified" | "buy" | "sell";
3899
+ triggerPrice: string;
3900
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
3901
+ execution: {
3902
+ readonly type: "market_ioc";
3903
+ readonly maxSlippage: {
3904
+ kind: "slippage";
3905
+ slippage: string;
3906
+ bps?: undefined;
3907
+ } | {
3908
+ kind: "bps";
3909
+ bps: number;
3910
+ slippage?: undefined;
3911
+ } | {
3912
+ kind: "none";
3913
+ slippage?: undefined;
3914
+ bps?: undefined;
3915
+ };
3916
+ price?: undefined;
3917
+ postOnly?: undefined;
3918
+ } | {
3919
+ readonly type: "limit_gtc";
3920
+ readonly price: string;
3921
+ readonly postOnly: boolean;
3922
+ readonly maxSlippage?: undefined;
3923
+ } | {
3924
+ readonly type: "limit_ioc";
3925
+ readonly price: string;
3926
+ readonly maxSlippage?: undefined;
3927
+ postOnly?: undefined;
3928
+ } | {
3929
+ readonly type: "limit_fok";
3930
+ readonly price: string;
3931
+ readonly maxSlippage?: undefined;
3932
+ postOnly?: undefined;
3933
+ } | {
3934
+ readonly type: "unspecified";
3935
+ readonly maxSlippage?: undefined;
3936
+ price?: undefined;
3937
+ postOnly?: undefined;
3938
+ };
3939
+ trailingDistance?: undefined;
3940
+ activationPrice?: undefined;
3941
+ readonly maxSlippage?: undefined;
3942
+ limitPrice?: undefined;
3943
+ durationMs?: undefined;
3944
+ sliceIntervalMs?: undefined;
3945
+ priceMin?: undefined;
3946
+ priceMax?: undefined;
3947
+ levels?: undefined;
3948
+ postOnly?: undefined;
3949
+ } | {
3950
+ type: "trailing_stop";
3951
+ side: "unspecified" | "buy" | "sell";
3952
+ trailingDistance: {
3953
+ kind: "distance";
3954
+ distance: string;
3955
+ bps?: undefined;
3956
+ } | {
3957
+ kind: "bps";
3958
+ bps: number;
3959
+ distance?: undefined;
3960
+ } | {
3961
+ kind: "unspecified";
3962
+ distance?: undefined;
3963
+ bps?: undefined;
3964
+ };
3965
+ activationPrice: string | undefined;
3966
+ maxSlippage: {
3967
+ kind: "slippage";
3968
+ slippage: string;
3969
+ bps?: undefined;
3970
+ } | {
3971
+ kind: "bps";
3972
+ bps: number;
3973
+ slippage?: undefined;
3974
+ } | {
3975
+ kind: "none";
3976
+ slippage?: undefined;
3977
+ bps?: undefined;
3978
+ };
3979
+ limitPrice: string | undefined;
3980
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
3981
+ triggerPrice?: undefined;
3982
+ execution?: undefined;
3983
+ durationMs?: undefined;
3984
+ sliceIntervalMs?: undefined;
3985
+ priceMin?: undefined;
3986
+ priceMax?: undefined;
3987
+ levels?: undefined;
3988
+ postOnly?: undefined;
3989
+ } | {
3990
+ type: "twap";
3991
+ side: "unspecified" | "buy" | "sell";
3992
+ durationMs: number;
3993
+ sliceIntervalMs: number;
3994
+ execution: {
3995
+ readonly type: "market_ioc";
3996
+ readonly maxSlippage: {
3997
+ kind: "slippage";
3998
+ slippage: string;
3999
+ bps?: undefined;
4000
+ } | {
4001
+ kind: "bps";
4002
+ bps: number;
4003
+ slippage?: undefined;
4004
+ } | {
4005
+ kind: "none";
4006
+ slippage?: undefined;
4007
+ bps?: undefined;
4008
+ };
4009
+ price?: undefined;
4010
+ } | {
4011
+ readonly type: "limit_gtc";
4012
+ readonly price: string;
4013
+ readonly maxSlippage?: undefined;
4014
+ } | {
4015
+ readonly type: "unspecified";
4016
+ readonly maxSlippage?: undefined;
4017
+ price?: undefined;
4018
+ };
4019
+ triggerPrice?: undefined;
4020
+ triggerPriceSource?: undefined;
4021
+ trailingDistance?: undefined;
4022
+ activationPrice?: undefined;
4023
+ readonly maxSlippage?: undefined;
4024
+ limitPrice?: undefined;
4025
+ priceMin?: undefined;
4026
+ priceMax?: undefined;
4027
+ levels?: undefined;
4028
+ postOnly?: undefined;
4029
+ } | {
4030
+ type: "ladder";
4031
+ side: "unspecified" | "buy" | "sell";
4032
+ priceMin: string;
4033
+ priceMax: string;
4034
+ levels: number;
4035
+ postOnly: boolean;
4036
+ triggerPrice?: undefined;
4037
+ triggerPriceSource?: undefined;
4038
+ execution?: undefined;
4039
+ trailingDistance?: undefined;
4040
+ activationPrice?: undefined;
4041
+ readonly maxSlippage?: undefined;
4042
+ limitPrice?: undefined;
4043
+ durationMs?: undefined;
4044
+ sliceIntervalMs?: undefined;
4045
+ } | {
4046
+ type: "unspecified";
4047
+ side?: undefined;
4048
+ triggerPrice?: undefined;
4049
+ triggerPriceSource?: undefined;
4050
+ execution?: undefined;
4051
+ trailingDistance?: undefined;
4052
+ activationPrice?: undefined;
4053
+ readonly maxSlippage?: undefined;
4054
+ limitPrice?: undefined;
4055
+ durationMs?: undefined;
4056
+ sliceIntervalMs?: undefined;
4057
+ priceMin?: undefined;
4058
+ priceMax?: undefined;
4059
+ levels?: undefined;
4060
+ postOnly?: undefined;
4061
+ };
4062
+ clientTriggerId: string;
4063
+ createdTs: number | undefined;
4064
+ updatedTs: number | undefined;
4065
+ armedTs: number | undefined;
4066
+ completedTs: number | undefined;
4067
+ } | {
4068
+ runtimeDetails: TriggerDetailsOutput;
4069
+ version: number;
4070
+ cancelReason: undefined;
4071
+ failureReason: undefined;
4072
+ triggerId: string;
4073
+ subaccountId: string;
4074
+ symbolId: number;
4075
+ status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "created" | "armed" | "running";
4076
+ parentOrderId: string | undefined;
4077
+ qty: string;
4078
+ feeAsset: "unspecified" | "quote" | "base";
4079
+ selfTradePreventionMode: "unspecified" | "expire_taker" | "expire_maker" | "expire_both";
4080
+ configuration: {
4081
+ type: "stop_loss" | "take_profit";
4082
+ side: "unspecified" | "buy" | "sell";
4083
+ triggerPrice: string;
4084
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
4085
+ execution: {
4086
+ readonly type: "market_ioc";
4087
+ readonly maxSlippage: {
4088
+ kind: "slippage";
4089
+ slippage: string;
4090
+ bps?: undefined;
4091
+ } | {
4092
+ kind: "bps";
4093
+ bps: number;
4094
+ slippage?: undefined;
4095
+ } | {
4096
+ kind: "none";
4097
+ slippage?: undefined;
4098
+ bps?: undefined;
4099
+ };
4100
+ price?: undefined;
4101
+ postOnly?: undefined;
4102
+ } | {
4103
+ readonly type: "limit_gtc";
4104
+ readonly price: string;
4105
+ readonly postOnly: boolean;
4106
+ readonly maxSlippage?: undefined;
4107
+ } | {
4108
+ readonly type: "limit_ioc";
4109
+ readonly price: string;
4110
+ readonly maxSlippage?: undefined;
4111
+ postOnly?: undefined;
4112
+ } | {
4113
+ readonly type: "limit_fok";
4114
+ readonly price: string;
4115
+ readonly maxSlippage?: undefined;
4116
+ postOnly?: undefined;
4117
+ } | {
4118
+ readonly type: "unspecified";
4119
+ readonly maxSlippage?: undefined;
4120
+ price?: undefined;
4121
+ postOnly?: undefined;
4122
+ };
4123
+ trailingDistance?: undefined;
4124
+ activationPrice?: undefined;
4125
+ readonly maxSlippage?: undefined;
4126
+ limitPrice?: undefined;
4127
+ durationMs?: undefined;
4128
+ sliceIntervalMs?: undefined;
4129
+ priceMin?: undefined;
4130
+ priceMax?: undefined;
4131
+ levels?: undefined;
4132
+ postOnly?: undefined;
4133
+ } | {
4134
+ type: "trailing_stop";
4135
+ side: "unspecified" | "buy" | "sell";
4136
+ trailingDistance: {
4137
+ kind: "distance";
4138
+ distance: string;
4139
+ bps?: undefined;
4140
+ } | {
4141
+ kind: "bps";
4142
+ bps: number;
4143
+ distance?: undefined;
4144
+ } | {
4145
+ kind: "unspecified";
4146
+ distance?: undefined;
4147
+ bps?: undefined;
4148
+ };
4149
+ activationPrice: string | undefined;
4150
+ maxSlippage: {
4151
+ kind: "slippage";
4152
+ slippage: string;
4153
+ bps?: undefined;
4154
+ } | {
4155
+ kind: "bps";
4156
+ bps: number;
4157
+ slippage?: undefined;
4158
+ } | {
4159
+ kind: "none";
4160
+ slippage?: undefined;
4161
+ bps?: undefined;
4162
+ };
4163
+ limitPrice: string | undefined;
4164
+ triggerPriceSource: "unspecified" | "last" | "index" | "mark";
4165
+ triggerPrice?: undefined;
4166
+ execution?: undefined;
4167
+ durationMs?: undefined;
4168
+ sliceIntervalMs?: undefined;
4169
+ priceMin?: undefined;
4170
+ priceMax?: undefined;
4171
+ levels?: undefined;
4172
+ postOnly?: undefined;
4173
+ } | {
4174
+ type: "twap";
4175
+ side: "unspecified" | "buy" | "sell";
4176
+ durationMs: number;
4177
+ sliceIntervalMs: number;
4178
+ execution: {
4179
+ readonly type: "market_ioc";
4180
+ readonly maxSlippage: {
4181
+ kind: "slippage";
4182
+ slippage: string;
4183
+ bps?: undefined;
4184
+ } | {
4185
+ kind: "bps";
4186
+ bps: number;
4187
+ slippage?: undefined;
4188
+ } | {
4189
+ kind: "none";
4190
+ slippage?: undefined;
4191
+ bps?: undefined;
4192
+ };
4193
+ price?: undefined;
4194
+ } | {
4195
+ readonly type: "limit_gtc";
4196
+ readonly price: string;
4197
+ readonly maxSlippage?: undefined;
4198
+ } | {
4199
+ readonly type: "unspecified";
4200
+ readonly maxSlippage?: undefined;
4201
+ price?: undefined;
4202
+ };
4203
+ triggerPrice?: undefined;
4204
+ triggerPriceSource?: undefined;
4205
+ trailingDistance?: undefined;
4206
+ activationPrice?: undefined;
4207
+ readonly maxSlippage?: undefined;
4208
+ limitPrice?: undefined;
4209
+ priceMin?: undefined;
4210
+ priceMax?: undefined;
4211
+ levels?: undefined;
4212
+ postOnly?: undefined;
4213
+ } | {
4214
+ type: "ladder";
4215
+ side: "unspecified" | "buy" | "sell";
4216
+ priceMin: string;
4217
+ priceMax: string;
4218
+ levels: number;
4219
+ postOnly: boolean;
4220
+ triggerPrice?: undefined;
4221
+ triggerPriceSource?: undefined;
4222
+ execution?: undefined;
4223
+ trailingDistance?: undefined;
4224
+ activationPrice?: undefined;
4225
+ readonly maxSlippage?: undefined;
4226
+ limitPrice?: undefined;
4227
+ durationMs?: undefined;
4228
+ sliceIntervalMs?: undefined;
4229
+ } | {
4230
+ type: "unspecified";
4231
+ side?: undefined;
4232
+ triggerPrice?: undefined;
4233
+ triggerPriceSource?: undefined;
4234
+ execution?: undefined;
4235
+ trailingDistance?: undefined;
4236
+ activationPrice?: undefined;
4237
+ readonly maxSlippage?: undefined;
4238
+ limitPrice?: undefined;
4239
+ durationMs?: undefined;
4240
+ sliceIntervalMs?: undefined;
4241
+ priceMin?: undefined;
4242
+ priceMax?: undefined;
4243
+ levels?: undefined;
4244
+ postOnly?: undefined;
4245
+ };
4246
+ clientTriggerId: string;
4247
+ createdTs: number | undefined;
4248
+ updatedTs: number | undefined;
4249
+ armedTs: number | undefined;
4250
+ completedTs: number | undefined;
4251
+ })[];
4252
+ truncated: boolean;
4253
+ accountId: string;
4254
+ orders?: undefined;
4255
+ balances?: undefined;
4256
+ symbolId?: undefined;
4257
+ timeframe?: undefined;
4258
+ candles?: undefined;
4259
+ columns?: undefined;
4260
+ /** A row may have fewer cells than columns; missing cells are empty. */
4261
+ rows?: undefined;
4262
+ alert?: undefined;
4263
+ depositAddress?: undefined;
4264
+ assetId?: undefined;
4265
+ history?: undefined;
4266
+ transfers?: undefined;
4267
+ } | {
4268
+ type: "balances_table";
4269
+ balances: {
4270
+ assetId: number;
4271
+ funding: string;
4272
+ trading: string;
4273
+ reserved: string;
4274
+ available: string;
4275
+ tradingRevision: string;
4276
+ fundingRevision: string;
4277
+ }[];
4278
+ accountId: string;
4279
+ orders?: undefined;
4280
+ truncated?: undefined;
4281
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4282
+ triggers?: undefined;
4283
+ symbolId?: undefined;
4284
+ timeframe?: undefined;
4285
+ candles?: undefined;
4286
+ columns?: undefined;
4287
+ /** A row may have fewer cells than columns; missing cells are empty. */
4288
+ rows?: undefined;
4289
+ alert?: undefined;
4290
+ depositAddress?: undefined;
4291
+ assetId?: undefined;
4292
+ history?: undefined;
4293
+ transfers?: undefined;
4294
+ } | {
4295
+ type: "price_chart";
4296
+ symbolId: number;
4297
+ timeframe: "unspecified" | "1d" | "1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo";
4298
+ candles: {
4299
+ symbolId: number;
4300
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">;
4301
+ time: number;
4302
+ open: string;
4303
+ high: string;
4304
+ low: string;
4305
+ close: string;
4306
+ volume: string;
4307
+ quoteVolume: string;
4308
+ isClosed: boolean;
4309
+ }[];
4310
+ orders?: undefined;
4311
+ truncated?: undefined;
4312
+ accountId?: undefined;
4313
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4314
+ triggers?: undefined;
4315
+ balances?: undefined;
4316
+ columns?: undefined;
4317
+ /** A row may have fewer cells than columns; missing cells are empty. */
4318
+ rows?: undefined;
4319
+ alert?: undefined;
4320
+ depositAddress?: undefined;
4321
+ assetId?: undefined;
4322
+ history?: undefined;
4323
+ transfers?: undefined;
4324
+ } | {
4325
+ type: "markdown_table";
4326
+ columns: string[];
4327
+ /** A row may have fewer cells than columns; missing cells are empty. */
4328
+ rows: string[][];
4329
+ truncated: boolean;
4330
+ orders?: undefined;
4331
+ accountId?: undefined;
4332
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4333
+ triggers?: undefined;
4334
+ balances?: undefined;
4335
+ symbolId?: undefined;
4336
+ timeframe?: undefined;
4337
+ candles?: undefined;
4338
+ alert?: undefined;
4339
+ depositAddress?: undefined;
4340
+ assetId?: undefined;
4341
+ history?: undefined;
4342
+ transfers?: undefined;
4343
+ } | {
4344
+ type: "price_alert";
4345
+ alert: {
4346
+ alertId: string;
4347
+ symbolId: number;
4348
+ direction: "unspecified" | "above" | "below";
4349
+ priceSource: "unspecified" | "last_price" | "index_price";
4350
+ price: string;
4351
+ referencePrice: string;
4352
+ armed: boolean;
4353
+ status: "unspecified" | "active" | "triggered" | "cancelled";
4354
+ channels: ("unspecified" | "telegram" | "in_app")[];
4355
+ revision: string;
4356
+ createdAt: number | null;
4357
+ updatedAt: number | null;
4358
+ triggeredAt: number | null;
4359
+ triggeredPrice: string | null;
4360
+ };
4361
+ orders?: undefined;
4362
+ truncated?: undefined;
4363
+ accountId?: undefined;
4364
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4365
+ triggers?: undefined;
4366
+ balances?: undefined;
4367
+ symbolId?: undefined;
4368
+ timeframe?: undefined;
4369
+ candles?: undefined;
4370
+ columns?: undefined;
4371
+ /** A row may have fewer cells than columns; missing cells are empty. */
4372
+ rows?: undefined;
4373
+ depositAddress?: undefined;
4374
+ assetId?: undefined;
4375
+ history?: undefined;
4376
+ transfers?: undefined;
4377
+ } | {
4378
+ type: "deposit_address";
4379
+ depositAddress: {
4380
+ chainId: number;
4381
+ depositAddress: string;
4382
+ } | undefined;
4383
+ assetId: number | undefined;
4384
+ accountId: string;
4385
+ orders?: undefined;
4386
+ truncated?: undefined;
4387
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4388
+ triggers?: undefined;
4389
+ balances?: undefined;
4390
+ symbolId?: undefined;
4391
+ timeframe?: undefined;
4392
+ candles?: undefined;
4393
+ columns?: undefined;
4394
+ /** A row may have fewer cells than columns; missing cells are empty. */
4395
+ rows?: undefined;
4396
+ alert?: undefined;
4397
+ history?: undefined;
4398
+ transfers?: undefined;
4399
+ } | {
4400
+ type: "balance_history_chart";
4401
+ history: {
4402
+ range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d";
4403
+ bucket: string;
4404
+ startTsSec: number;
4405
+ endTsSec: number;
4406
+ points: number;
4407
+ series: {
4408
+ assetId: number;
4409
+ accountCode: "unspecified" | "trading" | "funding";
4410
+ balance: string[];
4411
+ }[];
4412
+ } | undefined;
4413
+ accountId: string;
4414
+ orders?: undefined;
4415
+ truncated?: undefined;
4416
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4417
+ triggers?: undefined;
4418
+ balances?: undefined;
4419
+ symbolId?: undefined;
4420
+ timeframe?: undefined;
4421
+ candles?: undefined;
4422
+ columns?: undefined;
4423
+ /** A row may have fewer cells than columns; missing cells are empty. */
4424
+ rows?: undefined;
4425
+ alert?: undefined;
4426
+ depositAddress?: undefined;
4427
+ assetId?: undefined;
4428
+ transfers?: undefined;
4429
+ } | {
4430
+ type: "equity_history_chart";
4431
+ history: {
4432
+ range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d";
4433
+ bucket: string;
4434
+ startTsSec: number;
4435
+ endTsSec: number;
4436
+ quoteAsset: string;
4437
+ points: number;
4438
+ series: {
4439
+ grouping: EquitySeriesGrouping;
4440
+ equity: string[];
4441
+ }[];
4442
+ btcPrices: string[];
4443
+ } | undefined;
4444
+ accountId: string;
4445
+ orders?: undefined;
4446
+ truncated?: undefined;
4447
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4448
+ triggers?: undefined;
4449
+ balances?: undefined;
4450
+ symbolId?: undefined;
4451
+ timeframe?: undefined;
4452
+ candles?: undefined;
4453
+ columns?: undefined;
4454
+ /** A row may have fewer cells than columns; missing cells are empty. */
4455
+ rows?: undefined;
4456
+ alert?: undefined;
4457
+ depositAddress?: undefined;
4458
+ assetId?: undefined;
4459
+ transfers?: undefined;
4460
+ } | {
4461
+ type: "transfers_table";
4462
+ transfers: {
4463
+ destination?: {
4464
+ kind: "unspecified" | "funding_account" | "trading_account" | "external_address" | "private_counterparty" | "fee_account" | "system_account";
4465
+ accountId?: string | undefined;
4466
+ address: string;
4467
+ chainId?: number | undefined;
4468
+ } | undefined;
4469
+ source?: {
4470
+ kind: "unspecified" | "funding_account" | "trading_account" | "external_address" | "private_counterparty" | "fee_account" | "system_account";
4471
+ accountId?: string | undefined;
4472
+ address: string;
4473
+ chainId?: number | undefined;
4474
+ } | undefined;
4475
+ transferId: string;
4476
+ assetId: number;
4477
+ amount: string;
4478
+ balanceAfter: string | undefined;
4479
+ type: "unspecified" | "internal_transfer" | "deposit" | "withdraw" | "maker_fee" | "taker_fee" | "trade_base" | "trade_quote" | "rebate" | "funding_to_trading" | "trading_to_funding" | "trading_withdraw_reserve" | "funding_user_transfer" | "trading_withdraw_request_fee" | "trading_withdraw_fee_leg" | "quickswap_polyester_fee" | "quickswap_broker_fee" | "quickswap_affiliate_fee" | "fee_sweep" | "fee_refill" | "system_adjustment" | "withdraw_failed";
4480
+ accountCode: "unspecified" | "trading" | "funding";
4481
+ timestamp: number;
4482
+ isDebit: boolean;
4483
+ linkId: string | undefined;
4484
+ flowId: string;
4485
+ }[];
4486
+ truncated: boolean;
4487
+ accountId: string;
4488
+ orders?: undefined;
4489
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4490
+ triggers?: undefined;
4491
+ balances?: undefined;
4492
+ symbolId?: undefined;
4493
+ timeframe?: undefined;
4494
+ candles?: undefined;
4495
+ columns?: undefined;
4496
+ /** A row may have fewer cells than columns; missing cells are empty. */
4497
+ rows?: undefined;
4498
+ alert?: undefined;
4499
+ depositAddress?: undefined;
4500
+ assetId?: undefined;
4501
+ history?: undefined;
4502
+ } | {
4503
+ type: "unspecified";
4504
+ orders?: undefined;
4505
+ truncated?: undefined;
4506
+ accountId?: undefined;
4507
+ /** subaccountId, feeAsset, selfTradePreventionMode, updatedTs, armedTs and version are not set. */
4508
+ triggers?: undefined;
4509
+ balances?: undefined;
4510
+ symbolId?: undefined;
4511
+ timeframe?: undefined;
4512
+ candles?: undefined;
4513
+ columns?: undefined;
4514
+ /** A row may have fewer cells than columns; missing cells are empty. */
4515
+ rows?: undefined;
4516
+ alert?: undefined;
4517
+ depositAddress?: undefined;
4518
+ assetId?: undefined;
4519
+ history?: undefined;
4520
+ transfers?: undefined;
4521
+ };
4522
+ text?: undefined;
4523
+ fromSeq?: undefined;
4524
+ toolCallId?: undefined;
4525
+ name?: undefined;
4526
+ input?: undefined;
4527
+ ok?: undefined;
4528
+ errorMessage?: undefined;
4529
+ memories?: undefined;
4530
+ destinationIds?: undefined;
4531
+ subagentId?: undefined;
4532
+ summary?: undefined;
4533
+ approvalId?: undefined;
4534
+ /** Approving after this executes nothing. */
4535
+ expiresAt?: undefined;
4536
+ parameters?: undefined;
4537
+ accountId?: undefined;
4538
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
4539
+ preview?: undefined;
4540
+ status?: undefined;
4541
+ usage?: undefined;
4542
+ category?: undefined;
4543
+ message?: undefined;
4544
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
4545
+ seq: number;
4546
+ createdAt: number | undefined;
4547
+ } | {
4548
+ type: "run_completed";
4549
+ usage: {
4550
+ inputTokens: number;
4551
+ outputTokens: number;
4552
+ /** Subset of `inputTokens` served from the prompt cache. */
4553
+ cachedInputTokens: number;
4554
+ };
4555
+ text?: undefined;
4556
+ fromSeq?: undefined;
4557
+ toolCallId?: undefined;
4558
+ name?: undefined;
4559
+ input?: undefined;
4560
+ ok?: undefined;
4561
+ errorMessage?: undefined;
4562
+ memories?: undefined;
4563
+ destinationIds?: undefined;
4564
+ subagentId?: undefined;
4565
+ summary?: undefined;
4566
+ approvalId?: undefined;
4567
+ /** Approving after this executes nothing. */
4568
+ expiresAt?: undefined;
4569
+ parameters?: undefined;
4570
+ accountId?: undefined;
4571
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
4572
+ preview?: undefined;
4573
+ status?: undefined;
4574
+ view?: undefined;
4575
+ category?: undefined;
4576
+ message?: undefined;
4577
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
4578
+ seq: number;
4579
+ createdAt: number | undefined;
4580
+ } | {
4581
+ type: "run_failed";
4582
+ category: "unspecified" | "cancelled" | "budget_exceeded" | "permission_denied" | "model_unavailable" | "unexpected_error";
4583
+ message: string;
4584
+ usage: {
4585
+ inputTokens: number;
4586
+ outputTokens: number;
4587
+ /** Subset of `inputTokens` served from the prompt cache. */
4588
+ cachedInputTokens: number;
4589
+ };
4590
+ text?: undefined;
4591
+ fromSeq?: undefined;
4592
+ toolCallId?: undefined;
4593
+ name?: undefined;
4594
+ input?: undefined;
4595
+ ok?: undefined;
4596
+ errorMessage?: undefined;
4597
+ memories?: undefined;
4598
+ destinationIds?: undefined;
4599
+ subagentId?: undefined;
4600
+ summary?: undefined;
4601
+ approvalId?: undefined;
4602
+ /** Approving after this executes nothing. */
4603
+ expiresAt?: undefined;
4604
+ parameters?: undefined;
4605
+ accountId?: undefined;
4606
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
4607
+ preview?: undefined;
4608
+ status?: undefined;
4609
+ view?: undefined;
4610
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
4611
+ seq: number;
4612
+ createdAt: number | undefined;
4613
+ } | {
4614
+ type: "unspecified";
4615
+ text?: undefined;
4616
+ fromSeq?: undefined;
4617
+ toolCallId?: undefined;
4618
+ name?: undefined;
4619
+ input?: undefined;
4620
+ ok?: undefined;
4621
+ errorMessage?: undefined;
4622
+ memories?: undefined;
4623
+ destinationIds?: undefined;
4624
+ subagentId?: undefined;
4625
+ summary?: undefined;
4626
+ approvalId?: undefined;
4627
+ /** Approving after this executes nothing. */
4628
+ expiresAt?: undefined;
4629
+ parameters?: undefined;
4630
+ accountId?: undefined;
4631
+ /** The action as typed values; `type: "unspecified"` means show the summary only. */
4632
+ preview?: undefined;
4633
+ status?: undefined;
4634
+ view?: undefined;
4635
+ usage?: undefined;
4636
+ category?: undefined;
4637
+ message?: undefined;
4638
+ /** Position in the run, from 1. Pass the last one received as `afterSeq` to resume. */
4639
+ seq: number;
4640
+ createdAt: number | undefined;
4641
+ };
4642
+ /** One run event. `type: "unspecified"` is an event this SDK build does not know: skip it. */
4643
+ type AssistantRunEvent = ReturnType<typeof formatRunEvent>;
4644
+ //#endregion
4645
+ export { AssistantApprovalPreview, AssistantOrderPreview, AssistantRunEvent, AssistantView, formatRunEvent };
4646
+ //# sourceMappingURL=assistant-events.schemas.d.ts.map