@polyester/sdk 0.35.0-devnet-20261111031027 → 0.35.0-devnet-20261111161451

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