@polyester/sdk 0.31.0 → 0.32.0-devnet-20261101180406

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 (373) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/README.md +7 -0
  3. package/dist/browser-core.d.ts.map +1 -1
  4. package/dist/browser-core.js.map +1 -1
  5. package/dist/catalogs/market-data-catalog.d.ts +2 -0
  6. package/dist/catalogs/market-data-catalog.d.ts.map +1 -1
  7. package/dist/catalogs/market-data-catalog.js +1 -0
  8. package/dist/catalogs/market-data-catalog.js.map +1 -1
  9. package/dist/catalogs/snapshot-validation.js +6 -0
  10. package/dist/catalogs/snapshot-validation.js.map +1 -1
  11. package/dist/client.d.ts +2 -2
  12. package/dist/client.js +2 -2
  13. package/dist/client.js.map +1 -1
  14. package/dist/core-client.d.ts.map +1 -1
  15. package/dist/core-client.js +1 -0
  16. package/dist/core-client.js.map +1 -1
  17. package/dist/gen/auth/v1/api_keys_pb.d.ts +6 -3
  18. package/dist/gen/auth/v1/api_keys_pb.d.ts.map +1 -1
  19. package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
  20. package/dist/gen/auth/v1/auth_pb.d.ts +9 -2
  21. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  22. package/dist/gen/auth/v1/auth_pb.js +9 -2
  23. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  24. package/dist/gen/auth/v1/policies_pb.d.ts +26 -2
  25. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  26. package/dist/gen/auth/v1/policies_pb.js +26 -2
  27. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  28. package/dist/gen/auth/v1/subaccounts_pb.d.ts +20 -14
  29. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  30. package/dist/gen/auth/v1/subaccounts_pb.js +20 -3
  31. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  32. package/dist/gen/chain/analytics/v1/analytics_read_pb.d.ts.map +1 -1
  33. package/dist/gen/chain/analytics/v1/analytics_read_pb.js +2 -1
  34. package/dist/gen/chain/analytics/v1/analytics_read_pb.js.map +1 -1
  35. package/dist/gen/chain/deposit/v1/deposit_pb.d.ts +10 -6
  36. package/dist/gen/chain/deposit/v1/deposit_pb.d.ts.map +1 -1
  37. package/dist/gen/chain/deposit/v1/deposit_pb.js +2 -1
  38. package/dist/gen/chain/deposit/v1/deposit_pb.js.map +1 -1
  39. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +32 -2
  40. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
  41. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js +2 -2
  42. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
  43. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +19 -3
  44. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts.map +1 -1
  45. package/dist/gen/chain/lifecycle/v1/types_pb.js +18 -2
  46. package/dist/gen/chain/lifecycle/v1/types_pb.js.map +1 -1
  47. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +840 -0
  48. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -0
  49. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js +351 -0
  50. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -0
  51. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +22 -2
  52. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  53. package/dist/gen/chain/withdraw/v1/withdraw_pb.js +17 -1
  54. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  55. package/dist/gen/chain/zipper/v1/reason_pb.d.ts +14 -0
  56. package/dist/gen/chain/zipper/v1/reason_pb.d.ts.map +1 -1
  57. package/dist/gen/chain/zipper/v1/reason_pb.js +15 -1
  58. package/dist/gen/chain/zipper/v1/reason_pb.js.map +1 -1
  59. package/dist/gen/checkpoints/v1/checkpoints_pb.d.ts +1121 -0
  60. package/dist/gen/checkpoints/v1/checkpoints_pb.d.ts.map +1 -0
  61. package/dist/gen/checkpoints/v1/checkpoints_pb.js +327 -0
  62. package/dist/gen/checkpoints/v1/checkpoints_pb.js.map +1 -0
  63. package/dist/gen/claims/v1/claims_pb.d.ts +61 -4
  64. package/dist/gen/claims/v1/claims_pb.d.ts.map +1 -1
  65. package/dist/gen/claims/v1/claims_pb.js +26 -1
  66. package/dist/gen/claims/v1/claims_pb.js.map +1 -1
  67. package/dist/gen/fees/v1/fees_pb.d.ts.map +1 -1
  68. package/dist/gen/fees/v1/fees_pb.js +2 -1
  69. package/dist/gen/fees/v1/fees_pb.js.map +1 -1
  70. package/dist/gen/index.d.ts +7 -5
  71. package/dist/gen/index.js +12 -10
  72. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +38 -2
  73. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
  74. package/dist/gen/ledger/read/v1/ledger_read_pb.js +13 -7
  75. package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
  76. package/dist/gen/marketdata/v1/marketdata_pb.d.ts +248 -27
  77. package/dist/gen/marketdata/v1/marketdata_pb.d.ts.map +1 -1
  78. package/dist/gen/marketdata/v1/marketdata_pb.js +73 -20
  79. package/dist/gen/marketdata/v1/marketdata_pb.js.map +1 -1
  80. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts +2 -1
  81. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts.map +1 -1
  82. package/dist/gen/marketoverview/v1/marketoverview_pb.js.map +1 -1
  83. package/dist/gen/orderbook/v1/orderbook_pb.d.ts +16 -4
  84. package/dist/gen/orderbook/v1/orderbook_pb.d.ts.map +1 -1
  85. package/dist/gen/orderbook/v1/orderbook_pb.js +1 -1
  86. package/dist/gen/orderbook/v1/orderbook_pb.js.map +1 -1
  87. package/dist/gen/orders/v1/orders_pb.d.ts +1164 -53
  88. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  89. package/dist/gen/orders/v1/orders_pb.js +959 -42
  90. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  91. package/dist/gen/orders/v1/orders_read_pb.d.ts +205 -17
  92. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  93. package/dist/gen/orders/v1/orders_read_pb.js +156 -17
  94. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  95. package/dist/gen/polyester/api/options_pb.d.ts +8 -1
  96. package/dist/gen/polyester/api/options_pb.d.ts.map +1 -1
  97. package/dist/gen/polyester/api/options_pb.js +8 -1
  98. package/dist/gen/polyester/api/options_pb.js.map +1 -1
  99. package/dist/gen/privatews/v1/private_ws_pb.d.ts +1419 -0
  100. package/dist/gen/privatews/v1/private_ws_pb.d.ts.map +1 -0
  101. package/dist/gen/privatews/v1/private_ws_pb.js +551 -0
  102. package/dist/gen/privatews/v1/private_ws_pb.js.map +1 -0
  103. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +1 -0
  104. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts.map +1 -1
  105. package/dist/gen/ratelimit/v1/ratelimit_pb.js +1 -1
  106. package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -1
  107. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +2108 -0
  108. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -0
  109. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +522 -0
  110. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -0
  111. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +2296 -0
  112. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -0
  113. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +1014 -0
  114. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -0
  115. package/dist/gen/swap/v1/swap_pb.d.ts +945 -0
  116. package/dist/gen/swap/v1/swap_pb.d.ts.map +1 -0
  117. package/dist/gen/swap/v1/swap_pb.js +426 -0
  118. package/dist/gen/swap/v1/swap_pb.js.map +1 -0
  119. package/dist/gen/tradews/v1/trade_ws_pb.d.ts +67 -3
  120. package/dist/gen/tradews/v1/trade_ws_pb.d.ts.map +1 -1
  121. package/dist/gen/tradews/v1/trade_ws_pb.js +1 -1
  122. package/dist/gen/tradews/v1/trade_ws_pb.js.map +1 -1
  123. package/dist/gen/triggers/v1/triggers_pb.d.ts +587 -29
  124. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  125. package/dist/gen/triggers/v1/triggers_pb.js +420 -19
  126. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  127. package/dist/gen/vip/v1/vip_pb.d.ts +95 -7
  128. package/dist/gen/vip/v1/vip_pb.d.ts.map +1 -1
  129. package/dist/gen/vip/v1/vip_pb.js +53 -5
  130. package/dist/gen/vip/v1/vip_pb.js.map +1 -1
  131. package/dist/index.d.ts +9 -7
  132. package/dist/index.js +2 -2
  133. package/dist/realtime/client.d.ts +3 -0
  134. package/dist/realtime/client.d.ts.map +1 -1
  135. package/dist/realtime/client.js +76 -24
  136. package/dist/realtime/client.js.map +1 -1
  137. package/dist/realtime/index.d.ts +2 -1
  138. package/dist/realtime/private-orders.d.ts +38 -0
  139. package/dist/realtime/private-orders.d.ts.map +1 -0
  140. package/dist/realtime/private-orders.js +594 -0
  141. package/dist/realtime/private-orders.js.map +1 -0
  142. package/dist/realtime/ready-gated-subscription.js +10 -4
  143. package/dist/realtime/ready-gated-subscription.js.map +1 -1
  144. package/dist/realtime/types.d.ts +3 -0
  145. package/dist/realtime/types.d.ts.map +1 -1
  146. package/dist/services/auth/account-signer-auth.d.ts +5 -3
  147. package/dist/services/auth/account-signer-auth.d.ts.map +1 -1
  148. package/dist/services/auth/account-signer-auth.js +21 -3
  149. package/dist/services/auth/account-signer-auth.js.map +1 -1
  150. package/dist/services/auth/profile/profile.schemas.js +1 -1
  151. package/dist/services/balances/balances.js +1 -1
  152. package/dist/services/candles/candles.codecs.js +15 -0
  153. package/dist/services/candles/candles.codecs.js.map +1 -1
  154. package/dist/services/candles/candles.schemas.d.ts +13 -13
  155. package/dist/services/checkpoints/checkpoints.codecs.d.ts +8 -0
  156. package/dist/services/checkpoints/checkpoints.codecs.d.ts.map +1 -0
  157. package/dist/services/checkpoints/checkpoints.codecs.js +36 -0
  158. package/dist/services/checkpoints/checkpoints.codecs.js.map +1 -0
  159. package/dist/services/checkpoints/checkpoints.d.ts +22 -0
  160. package/dist/services/checkpoints/checkpoints.d.ts.map +1 -0
  161. package/dist/services/checkpoints/checkpoints.js +31 -0
  162. package/dist/services/checkpoints/checkpoints.js.map +1 -0
  163. package/dist/services/checkpoints/checkpoints.schemas.d.ts +437 -0
  164. package/dist/services/checkpoints/checkpoints.schemas.d.ts.map +1 -0
  165. package/dist/services/checkpoints/checkpoints.schemas.js +176 -0
  166. package/dist/services/checkpoints/checkpoints.schemas.js.map +1 -0
  167. package/dist/services/checkpoints/checkpoints.types.d.ts +3 -0
  168. package/dist/services/checkpoints/service.d.ts +8 -0
  169. package/dist/services/checkpoints/service.d.ts.map +1 -0
  170. package/dist/services/checkpoints/service.js +9 -0
  171. package/dist/services/checkpoints/service.js.map +1 -0
  172. package/dist/services/claims/claims.codecs.d.ts +1 -1
  173. package/dist/services/claims/claims.codecs.d.ts.map +1 -1
  174. package/dist/services/claims/claims.codecs.js +2 -1
  175. package/dist/services/claims/claims.codecs.js.map +1 -1
  176. package/dist/services/claims/claims.d.ts +13 -5
  177. package/dist/services/claims/claims.d.ts.map +1 -1
  178. package/dist/services/claims/claims.js +15 -6
  179. package/dist/services/claims/claims.js.map +1 -1
  180. package/dist/services/claims/claims.schemas.d.ts +13 -3
  181. package/dist/services/claims/claims.schemas.d.ts.map +1 -1
  182. package/dist/services/claims/claims.schemas.js +10 -4
  183. package/dist/services/claims/claims.schemas.js.map +1 -1
  184. package/dist/services/claims/claims.types.d.ts +2 -2
  185. package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
  186. package/dist/services/lifecycle/lifecycle.codecs.d.ts +1 -1
  187. package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
  188. package/dist/services/lifecycle/lifecycle.codecs.js +4 -2
  189. package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
  190. package/dist/services/lifecycle/lifecycle.schemas.d.ts +131 -81
  191. package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
  192. package/dist/services/lifecycle/lifecycle.schemas.js +7 -1
  193. package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
  194. package/dist/services/market-data/market-data.codecs.js +2 -1
  195. package/dist/services/market-data/market-data.codecs.js.map +1 -1
  196. package/dist/services/market-data/market-data.d.ts +10 -1
  197. package/dist/services/market-data/market-data.d.ts.map +1 -1
  198. package/dist/services/market-data/market-data.js +21 -9
  199. package/dist/services/market-data/market-data.js.map +1 -1
  200. package/dist/services/market-data/market-data.schemas.d.ts +29 -2
  201. package/dist/services/market-data/market-data.schemas.d.ts.map +1 -1
  202. package/dist/services/market-data/market-data.schemas.js +53 -4
  203. package/dist/services/market-data/market-data.schemas.js.map +1 -1
  204. package/dist/services/market-data/market-data.types.d.ts +2 -2
  205. package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
  206. package/dist/services/orderbook/orderbook.d.ts +2 -1
  207. package/dist/services/orderbook/orderbook.d.ts.map +1 -1
  208. package/dist/services/orderbook/orderbook.js +17 -2
  209. package/dist/services/orderbook/orderbook.js.map +1 -1
  210. package/dist/services/orderbook/orderbook.schemas.d.ts +5 -1
  211. package/dist/services/orderbook/orderbook.schemas.d.ts.map +1 -1
  212. package/dist/services/orderbook/orderbook.schemas.js +2 -0
  213. package/dist/services/orderbook/orderbook.schemas.js.map +1 -1
  214. package/dist/services/orders/order-enums.codecs.js +7 -1
  215. package/dist/services/orders/order-enums.codecs.js.map +1 -1
  216. package/dist/services/orders/order-errors.schemas.d.ts +4 -2
  217. package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
  218. package/dist/services/orders/order-errors.schemas.js +4 -1
  219. package/dist/services/orders/order-errors.schemas.js.map +1 -1
  220. package/dist/services/orders/orders-batch.schemas.d.ts +375 -54
  221. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  222. package/dist/services/orders/orders-batch.schemas.js +12 -2
  223. package/dist/services/orders/orders-batch.schemas.js.map +1 -1
  224. package/dist/services/orders/orders-input.schemas.d.ts +551 -9
  225. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  226. package/dist/services/orders/orders-input.schemas.js +23 -5
  227. package/dist/services/orders/orders-input.schemas.js.map +1 -1
  228. package/dist/services/orders/orders-modify.schemas.d.ts +106 -1
  229. package/dist/services/orders/orders-modify.schemas.d.ts.map +1 -1
  230. package/dist/services/orders/orders-modify.schemas.js +1 -1
  231. package/dist/services/orders/orders-output.schemas.d.ts +78 -59
  232. package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
  233. package/dist/services/orders/orders-output.schemas.js +15 -22
  234. package/dist/services/orders/orders-output.schemas.js.map +1 -1
  235. package/dist/services/orders/orders-risk.schemas.d.ts +69 -1
  236. package/dist/services/orders/orders-risk.schemas.d.ts.map +1 -1
  237. package/dist/services/orders/orders-risk.schemas.js +21 -11
  238. package/dist/services/orders/orders-risk.schemas.js.map +1 -1
  239. package/dist/services/orders/orders.codecs.js +26 -2
  240. package/dist/services/orders/orders.codecs.js.map +1 -1
  241. package/dist/services/orders/orders.d.ts +31 -5
  242. package/dist/services/orders/orders.d.ts.map +1 -1
  243. package/dist/services/orders/orders.js +53 -15
  244. package/dist/services/orders/orders.js.map +1 -1
  245. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  246. package/dist/services/policies/shared.codecs.js +8 -2
  247. package/dist/services/policies/shared.codecs.js.map +1 -1
  248. package/dist/services/policies/shared.d.ts +1 -1
  249. package/dist/services/policies/shared.d.ts.map +1 -1
  250. package/dist/services/policies/shared.js +4 -1
  251. package/dist/services/policies/shared.js.map +1 -1
  252. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +9 -9
  253. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +1 -1
  254. package/dist/services/subaccounts/subaccounts.codecs.js +4 -1
  255. package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
  256. package/dist/services/subaccounts/subaccounts.d.ts +1 -1
  257. package/dist/services/subaccounts/subaccounts.d.ts.map +1 -1
  258. package/dist/services/subaccounts/subaccounts.js +1 -2
  259. package/dist/services/subaccounts/subaccounts.js.map +1 -1
  260. package/dist/services/subaccounts/subaccounts.schemas.d.ts +9 -9
  261. package/dist/services/trades/trades.d.ts +2 -0
  262. package/dist/services/trades/trades.d.ts.map +1 -1
  263. package/dist/services/trades/trades.js +6 -6
  264. package/dist/services/trades/trades.js.map +1 -1
  265. package/dist/services/trades/trades.schemas.d.ts +2 -2
  266. package/dist/services/trades/trades.schemas.js +1 -1
  267. package/dist/services/trading-withdraws/trading-withdraws.d.ts +9 -5
  268. package/dist/services/trading-withdraws/trading-withdraws.d.ts.map +1 -1
  269. package/dist/services/trading-withdraws/trading-withdraws.js +45 -26
  270. package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
  271. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts +12 -0
  272. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts.map +1 -1
  273. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +26 -6
  274. package/dist/services/trading-withdraws/trading-withdraws.schemas.js.map +1 -1
  275. package/dist/services/trailing-oneof-inputs.js +6 -1
  276. package/dist/services/trailing-oneof-inputs.js.map +1 -1
  277. package/dist/services/transfers/transfers.d.ts +2 -0
  278. package/dist/services/transfers/transfers.d.ts.map +1 -1
  279. package/dist/services/transfers/transfers.js +6 -11
  280. package/dist/services/transfers/transfers.js.map +1 -1
  281. package/dist/services/transfers/transfers.schemas.d.ts +3 -0
  282. package/dist/services/transfers/transfers.schemas.d.ts.map +1 -1
  283. package/dist/services/transfers/transfers.schemas.js +3 -1
  284. package/dist/services/transfers/transfers.schemas.js.map +1 -1
  285. package/dist/services/triggers/trigger-child-order.schemas.js +23 -18
  286. package/dist/services/triggers/trigger-child-order.schemas.js.map +1 -1
  287. package/dist/services/triggers/trigger-input.schemas.d.ts +288 -25
  288. package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
  289. package/dist/services/triggers/trigger-input.schemas.js +38 -22
  290. package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
  291. package/dist/services/triggers/triggers-output.schemas.d.ts +180 -56
  292. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  293. package/dist/services/triggers/triggers-output.schemas.js +28 -20
  294. package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
  295. package/dist/services/triggers/triggers.codecs.js +60 -0
  296. package/dist/services/triggers/triggers.codecs.js.map +1 -1
  297. package/dist/services/triggers/triggers.d.ts +6 -2
  298. package/dist/services/triggers/triggers.d.ts.map +1 -1
  299. package/dist/services/triggers/triggers.js +10 -8
  300. package/dist/services/triggers/triggers.js.map +1 -1
  301. package/dist/services/vip/vip.js +1 -1
  302. package/dist/services/vip/vip.schemas.d.ts +23 -1
  303. package/dist/services/vip/vip.schemas.d.ts.map +1 -1
  304. package/dist/services/vip/vip.schemas.js +20 -2
  305. package/dist/services/vip/vip.schemas.js.map +1 -1
  306. package/dist/services/vip/vip.types.d.ts +2 -2
  307. package/dist/shared/catalog-config.d.ts +14 -2
  308. package/dist/shared/catalog-config.d.ts.map +1 -1
  309. package/dist/shared/catalog-config.js +2 -1
  310. package/dist/shared/catalog-config.js.map +1 -1
  311. package/dist/shared/connect-error-mapping.d.ts +3 -0
  312. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  313. package/dist/shared/connect-error-mapping.js +45 -6
  314. package/dist/shared/connect-error-mapping.js.map +1 -1
  315. package/dist/shared/errors.d.ts +79 -6
  316. package/dist/shared/errors.d.ts.map +1 -1
  317. package/dist/shared/errors.js +92 -4
  318. package/dist/shared/errors.js.map +1 -1
  319. package/dist/shared/rate-limit.schemas.d.ts +1 -1
  320. package/dist/shared/request-options.d.ts +7 -0
  321. package/dist/shared/request-options.d.ts.map +1 -1
  322. package/dist/shared/request-options.js +6 -1
  323. package/dist/shared/request-options.js.map +1 -1
  324. package/dist/shared/schemas.js +1 -1
  325. package/dist/shared/subscription-errors.js +12 -1
  326. package/dist/shared/subscription-errors.js.map +1 -1
  327. package/dist/shared/transports.d.ts.map +1 -1
  328. package/dist/shared/transports.js +9 -2
  329. package/dist/shared/transports.js.map +1 -1
  330. package/dist/shared/wire-bounds.js +3 -1
  331. package/dist/shared/wire-bounds.js.map +1 -1
  332. package/dist/smart-account/index.d.ts +2 -1
  333. package/dist/smart-account/index.js +2 -1
  334. package/dist/smart-account/smart-account.d.ts +5 -4
  335. package/dist/smart-account/smart-account.d.ts.map +1 -1
  336. package/dist/smart-account/smart-account.js +37 -8
  337. package/dist/smart-account/smart-account.js.map +1 -1
  338. package/dist/utils/numbers.js +4 -1
  339. package/dist/utils/numbers.js.map +1 -1
  340. package/dist/wired-services.js +5 -5
  341. package/dist/wired-services.js.map +1 -1
  342. package/package.json +9 -4
  343. package/dist/gen/collab/v1/whiteboard_pb.d.ts +0 -829
  344. package/dist/gen/collab/v1/whiteboard_pb.d.ts.map +0 -1
  345. package/dist/gen/collab/v1/whiteboard_pb.js +0 -250
  346. package/dist/gen/collab/v1/whiteboard_pb.js.map +0 -1
  347. package/dist/gen/layout/v1/layout_pb.d.ts +0 -1289
  348. package/dist/gen/layout/v1/layout_pb.d.ts.map +0 -1
  349. package/dist/gen/layout/v1/layout_pb.js +0 -313
  350. package/dist/gen/layout/v1/layout_pb.js.map +0 -1
  351. package/dist/gen/polychart/events/v1/polychart_events_pb.d.ts +0 -192
  352. package/dist/gen/polychart/events/v1/polychart_events_pb.d.ts.map +0 -1
  353. package/dist/gen/polychart/events/v1/polychart_events_pb.js +0 -57
  354. package/dist/gen/polychart/events/v1/polychart_events_pb.js.map +0 -1
  355. package/dist/gen/polychart/v1/polychart_pb.d.ts +0 -1208
  356. package/dist/gen/polychart/v1/polychart_pb.d.ts.map +0 -1
  357. package/dist/gen/polychart/v1/polychart_pb.js +0 -244
  358. package/dist/gen/polychart/v1/polychart_pb.js.map +0 -1
  359. package/dist/services/whiteboard/service.d.ts +0 -8
  360. package/dist/services/whiteboard/service.d.ts.map +0 -1
  361. package/dist/services/whiteboard/service.js +0 -9
  362. package/dist/services/whiteboard/service.js.map +0 -1
  363. package/dist/services/whiteboard/whiteboard.codecs.js +0 -55
  364. package/dist/services/whiteboard/whiteboard.codecs.js.map +0 -1
  365. package/dist/services/whiteboard/whiteboard.d.ts +0 -42
  366. package/dist/services/whiteboard/whiteboard.d.ts.map +0 -1
  367. package/dist/services/whiteboard/whiteboard.js +0 -76
  368. package/dist/services/whiteboard/whiteboard.js.map +0 -1
  369. package/dist/services/whiteboard/whiteboard.schemas.d.ts +0 -771
  370. package/dist/services/whiteboard/whiteboard.schemas.d.ts.map +0 -1
  371. package/dist/services/whiteboard/whiteboard.schemas.js +0 -132
  372. package/dist/services/whiteboard/whiteboard.schemas.js.map +0 -1
  373. package/dist/services/whiteboard/whiteboard.types.d.ts +0 -2
@@ -0,0 +1,945 @@
1
+ import { U128 } from "../../polyester/type/v1/u128_pb.js";
2
+ import { Message } from "@bufbuild/protobuf";
3
+ import { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
4
+ import { Timestamp } from "@bufbuild/protobuf/wkt";
5
+ declare namespace swap_pb_d_exports {
6
+ export { CreateSwapRequest, CreateSwapRequestSchema, CreateSwapResponse, CreateSwapResponseSchema, ErrorCode, ErrorCodeSchema, ErrorDetail, ErrorDetailSchema, GetSwapRequest, GetSwapRequestSchema, GetSwapResponse, GetSwapResponseSchema, QuoteSwapRequest, QuoteSwapRequestSchema, QuoteSwapResponse, QuoteSwapResponseSchema, Side, SideSchema, Swap, SwapOrder, SwapOrderSchema, SwapOrderStatus, SwapOrderStatusSchema, SwapQuote, SwapQuoteLeg, SwapQuoteLegSchema, SwapQuoteSchema, SwapReason, SwapReasonSchema, SwapSchema, SwapService, SwapStatus, SwapStatusSchema, SwapTerms, SwapTermsSchema, file_swap_v1_swap };
7
+ }
8
+ /**
9
+ * Describes the file swap/v1/swap.proto.
10
+ */
11
+ declare const file_swap_v1_swap: GenFile;
12
+ /**
13
+ * SwapTerms are the economic terms of one Swap: spend amount_e18 of the
14
+ * source asset from the account's Trading balance and receive the destination
15
+ * asset there. The same terms are quoted and created. A Swap executes as spot
16
+ * orders at the account's own spot taker fee; no other fee is charged.
17
+ *
18
+ * @generated from message swap.v1.SwapTerms
19
+ */
20
+ type SwapTerms = Message<"swap.v1.SwapTerms"> & {
21
+ /**
22
+ * Optional sub-account public ID whose Trading balance funds the Swap. When
23
+ * omitted, the caller's root account funds it, or the sub-account an API key
24
+ * is bound to.
25
+ *
26
+ * @generated from field: fixed64 subaccount_id = 1;
27
+ */
28
+ subaccountId: bigint;
29
+ /**
30
+ * Asset spent: a unified asset ID, as used for balances and internal
31
+ * transfers.
32
+ *
33
+ * @generated from field: uint32 source_asset_id = 2;
34
+ */
35
+ sourceAssetId: number;
36
+ /**
37
+ * Asset received: a unified asset ID.
38
+ *
39
+ * @generated from field: uint32 destination_asset_id = 3;
40
+ */
41
+ destinationAssetId: number;
42
+ /**
43
+ * How much to Swap. Exactly one; further ways to size a Swap may be added
44
+ * to this choice.
45
+ *
46
+ * @generated from oneof swap.v1.SwapTerms.amount
47
+ */
48
+ amount: {
49
+ /**
50
+ * Positive source amount to spend, in 18-decimal units (0.5 is
51
+ * 500000000000000000). Only whole order steps of the market are traded;
52
+ * the rest stays on the account.
53
+ *
54
+ * @generated from field: polyester.type.v1.U128 amount_e18 = 4;
55
+ */
56
+ value: U128;
57
+ case: "amountE18";
58
+ } | {
59
+ case: undefined;
60
+ value?: undefined;
61
+ };
62
+ };
63
+ /**
64
+ * Describes the message swap.v1.SwapTerms.
65
+ * Use `create(SwapTermsSchema)` to create a new message.
66
+ */
67
+ declare const SwapTermsSchema: GenMessage<SwapTerms>;
68
+ /**
69
+ * SwapQuoteLeg is one spot market a quote trades on.
70
+ *
71
+ * @generated from message swap.v1.SwapQuoteLeg
72
+ */
73
+ type SwapQuoteLeg = Message<"swap.v1.SwapQuoteLeg"> & {
74
+ /**
75
+ * Stable numeric pair ID from GetSpotConfig.
76
+ *
77
+ * @generated from field: uint32 symbol_id = 1;
78
+ */
79
+ symbolId: number;
80
+ /**
81
+ * Side of the order on the market.
82
+ *
83
+ * @generated from field: swap.v1.Side side = 2;
84
+ */
85
+ side: Side;
86
+ /**
87
+ * Estimated average fill price, quote asset per base asset, as a decimal
88
+ * string; for display.
89
+ *
90
+ * @generated from field: string average_price = 3;
91
+ */
92
+ averagePrice: string;
93
+ /**
94
+ * Distance of average_price from the best price of the book, in basis points,
95
+ * rounded up: the cost of the order's size against current depth.
96
+ *
97
+ * @generated from field: uint32 price_impact_bps = 4;
98
+ */
99
+ priceImpactBps: number;
100
+ /**
101
+ * The account's spot taker fee rate on the market, in percent (for example
102
+ * "0.1" for 0.1%), as a decimal string.
103
+ *
104
+ * @generated from field: string taker_fee_rate_percent = 5;
105
+ */
106
+ takerFeeRatePercent: string;
107
+ /**
108
+ * Estimated fee, in 18-decimal units of the asset the leg receives
109
+ * (fee_asset_id).
110
+ *
111
+ * @generated from field: polyester.type.v1.U128 fee_e18 = 6;
112
+ */
113
+ feeE18?: U128 | undefined;
114
+ /**
115
+ * Asset the fee is charged in: the asset the leg receives.
116
+ *
117
+ * @generated from field: uint32 fee_asset_id = 7;
118
+ */
119
+ feeAssetId: number;
120
+ };
121
+ /**
122
+ * Describes the message swap.v1.SwapQuoteLeg.
123
+ * Use `create(SwapQuoteLegSchema)` to create a new message.
124
+ */
125
+ declare const SwapQuoteLegSchema: GenMessage<SwapQuoteLeg>;
126
+ /**
127
+ * SwapQuote is an estimate from current order-book depth. Nothing is
128
+ * reserved: the prices are indicative, and only min_amount_out binds once the
129
+ * Swap is created.
130
+ *
131
+ * @generated from message swap.v1.SwapQuote
132
+ */
133
+ type SwapQuote = Message<"swap.v1.SwapQuote"> & {
134
+ /**
135
+ * The quoted terms.
136
+ *
137
+ * @generated from field: swap.v1.SwapTerms terms = 1;
138
+ */
139
+ terms?: SwapTerms | undefined;
140
+ /**
141
+ * Markets the Swap would trade on, in order. A direct Swap has one.
142
+ *
143
+ * @generated from field: repeated swap.v1.SwapQuoteLeg legs = 2;
144
+ */
145
+ legs: SwapQuoteLeg[];
146
+ /**
147
+ * Estimated destination amount after fees, in 18-decimal units.
148
+ *
149
+ * @generated from field: polyester.type.v1.U128 expected_amount_out_e18 = 3;
150
+ */
151
+ expectedAmountOutE18?: U128 | undefined;
152
+ /**
153
+ * Minimum destination amount after fees at the requested slippage, in
154
+ * 18-decimal units. Create the Swap with this value (or another accepted
155
+ * minimum) as min_amount_out_e18: whatever is executed then nets at least the
156
+ * same rate, and what cannot be stays on the account.
157
+ *
158
+ * @generated from field: polyester.type.v1.U128 min_amount_out_e18 = 4;
159
+ */
160
+ minAmountOutE18?: U128 | undefined;
161
+ /**
162
+ * When the quote was priced.
163
+ *
164
+ * @generated from field: google.protobuf.Timestamp quoted_at = 5;
165
+ */
166
+ quotedAt?: Timestamp | undefined;
167
+ /**
168
+ * Last moment the quote may be accepted, 30 seconds after quoted_at. Pass it
169
+ * as quote_expires_at when creating the Swap.
170
+ *
171
+ * @generated from field: google.protobuf.Timestamp expires_at = 6;
172
+ */
173
+ expiresAt?: Timestamp | undefined;
174
+ };
175
+ /**
176
+ * Describes the message swap.v1.SwapQuote.
177
+ * Use `create(SwapQuoteSchema)` to create a new message.
178
+ */
179
+ declare const SwapQuoteSchema: GenMessage<SwapQuote>;
180
+ /**
181
+ * SwapOrder is one spot order of a Swap: an immediate-or-cancel limit order
182
+ * at the Swap's protection price.
183
+ *
184
+ * @generated from message swap.v1.SwapOrder
185
+ */
186
+ type SwapOrder = Message<"swap.v1.SwapOrder"> & {
187
+ /**
188
+ * Spot order ID, once the market accepted the order; 0 before.
189
+ *
190
+ * @generated from field: fixed64 order_id = 1;
191
+ */
192
+ orderId: bigint;
193
+ /**
194
+ * Stable numeric pair ID from GetSpotConfig.
195
+ *
196
+ * @generated from field: uint32 symbol_id = 2;
197
+ */
198
+ symbolId: number;
199
+ /**
200
+ * Side of the order.
201
+ *
202
+ * @generated from field: swap.v1.Side side = 3;
203
+ */
204
+ side: Side;
205
+ /**
206
+ * Zero-based position of the order's market in the Swap's route.
207
+ *
208
+ * @generated from field: uint32 leg = 4;
209
+ */
210
+ leg: number;
211
+ /**
212
+ * State of the order.
213
+ *
214
+ * @generated from field: swap.v1.SwapOrderStatus status = 5;
215
+ */
216
+ status: SwapOrderStatus;
217
+ /**
218
+ * Limit price in quote-asset price ticks (1e-9 quote units per base unit):
219
+ * the worst price at which the order nets the Swap's minimum rate after fees.
220
+ *
221
+ * @generated from field: int64 limit_price_ticks = 6;
222
+ */
223
+ limitPriceTicks: bigint;
224
+ /**
225
+ * Amount the order spent in settled fills, fees in the spent asset included,
226
+ * in 18-decimal units.
227
+ *
228
+ * @generated from field: polyester.type.v1.U128 spent_e18 = 7;
229
+ */
230
+ spentE18?: U128 | undefined;
231
+ /**
232
+ * Amount the order received in settled fills after fees, in 18-decimal
233
+ * units.
234
+ *
235
+ * @generated from field: polyester.type.v1.U128 received_e18 = 8;
236
+ */
237
+ receivedE18?: U128 | undefined;
238
+ /**
239
+ * Fee charged on settled fills, in 18-decimal units of the asset the order
240
+ * receives.
241
+ *
242
+ * @generated from field: polyester.type.v1.U128 fee_e18 = 9;
243
+ */
244
+ feeE18?: U128 | undefined;
245
+ };
246
+ /**
247
+ * Describes the message swap.v1.SwapOrder.
248
+ * Use `create(SwapOrderSchema)` to create a new message.
249
+ */
250
+ declare const SwapOrderSchema: GenMessage<SwapOrder>;
251
+ /**
252
+ * Swap is one signed-in Swap and its outcome. Amounts count settled fills
253
+ * only.
254
+ *
255
+ * @generated from message swap.v1.Swap
256
+ */
257
+ type Swap = Message<"swap.v1.Swap"> & {
258
+ /**
259
+ * Swap ID.
260
+ *
261
+ * @generated from field: fixed64 swap_id = 1;
262
+ */
263
+ swapId: bigint;
264
+ /**
265
+ * Idempotency key the Swap was created with.
266
+ *
267
+ * @generated from field: string idempotency_key = 2;
268
+ */
269
+ idempotencyKey: string;
270
+ /**
271
+ * Sub-account public ID funding the Swap; 0 for the root account.
272
+ *
273
+ * @generated from field: fixed64 subaccount_id = 3;
274
+ */
275
+ subaccountId: bigint;
276
+ /**
277
+ * Asset spent.
278
+ *
279
+ * @generated from field: uint32 source_asset_id = 4;
280
+ */
281
+ sourceAssetId: number;
282
+ /**
283
+ * Asset received.
284
+ *
285
+ * @generated from field: uint32 destination_asset_id = 5;
286
+ */
287
+ destinationAssetId: number;
288
+ /**
289
+ * Source amount requested, in 18-decimal units.
290
+ *
291
+ * @generated from field: polyester.type.v1.U128 amount_e18 = 6;
292
+ */
293
+ amountE18?: U128 | undefined;
294
+ /**
295
+ * Minimum destination amount after fees for the whole amount, in 18-decimal
296
+ * units. Each traded part nets at least this rate.
297
+ *
298
+ * @generated from field: polyester.type.v1.U128 min_amount_out_e18 = 7;
299
+ */
300
+ minAmountOutE18?: U128 | undefined;
301
+ /**
302
+ * Current status.
303
+ *
304
+ * @generated from field: swap.v1.SwapStatus status = 8;
305
+ */
306
+ status: SwapStatus;
307
+ /**
308
+ * Why the Swap did not trade its whole amount; set with PARTIALLY_COMPLETED
309
+ * and FAILED.
310
+ *
311
+ * @generated from field: swap.v1.SwapReason reason = 9;
312
+ */
313
+ reason: SwapReason;
314
+ /**
315
+ * True once the status is final: COMPLETED, PARTIALLY_COMPLETED or FAILED.
316
+ *
317
+ * @generated from field: bool is_terminal = 10;
318
+ */
319
+ isTerminal: boolean;
320
+ /**
321
+ * Source amount spent in settled fills, in 18-decimal units.
322
+ *
323
+ * @generated from field: polyester.type.v1.U128 executed_amount_e18 = 11;
324
+ */
325
+ executedAmountE18?: U128 | undefined;
326
+ /**
327
+ * Source amount not spent, in 18-decimal units; it never left the
328
+ * account. Final once is_terminal is true.
329
+ *
330
+ * @generated from field: polyester.type.v1.U128 unspent_amount_e18 = 12;
331
+ */
332
+ unspentAmountE18?: U128 | undefined;
333
+ /**
334
+ * Destination amount received after fees, in 18-decimal units.
335
+ *
336
+ * @generated from field: polyester.type.v1.U128 received_amount_e18 = 13;
337
+ */
338
+ receivedAmountE18?: U128 | undefined;
339
+ /**
340
+ * Total fee charged, in 18-decimal units of the destination asset.
341
+ *
342
+ * @generated from field: polyester.type.v1.U128 fee_e18 = 14;
343
+ */
344
+ feeE18?: U128 | undefined;
345
+ /**
346
+ * The Swap's spot orders, in placement order.
347
+ *
348
+ * @generated from field: repeated swap.v1.SwapOrder orders = 15;
349
+ */
350
+ orders: SwapOrder[];
351
+ /**
352
+ * When the Swap was created.
353
+ *
354
+ * @generated from field: google.protobuf.Timestamp created_at = 16;
355
+ */
356
+ createdAt?: Timestamp | undefined;
357
+ };
358
+ /**
359
+ * Describes the message swap.v1.Swap.
360
+ * Use `create(SwapSchema)` to create a new message.
361
+ */
362
+ declare const SwapSchema: GenMessage<Swap>;
363
+ /**
364
+ * QuoteSwapRequest asks for a quote of terms.
365
+ *
366
+ * @generated from message swap.v1.QuoteSwapRequest
367
+ */
368
+ type QuoteSwapRequest = Message<"swap.v1.QuoteSwapRequest"> & {
369
+ /**
370
+ * Terms to quote.
371
+ *
372
+ * @generated from field: swap.v1.SwapTerms terms = 1;
373
+ */
374
+ terms?: SwapTerms | undefined;
375
+ /**
376
+ * Accepted shortfall from the expected output, in basis points (1 bp =
377
+ * 0.01%), from 1 to 1000; sets the quote's min_amount_out.
378
+ *
379
+ * @generated from field: uint32 max_slippage_bps = 2;
380
+ */
381
+ maxSlippageBps: number;
382
+ };
383
+ /**
384
+ * Describes the message swap.v1.QuoteSwapRequest.
385
+ * Use `create(QuoteSwapRequestSchema)` to create a new message.
386
+ */
387
+ declare const QuoteSwapRequestSchema: GenMessage<QuoteSwapRequest>;
388
+ /**
389
+ * QuoteSwapResponse is the quote.
390
+ *
391
+ * @generated from message swap.v1.QuoteSwapResponse
392
+ */
393
+ type QuoteSwapResponse = Message<"swap.v1.QuoteSwapResponse"> & {
394
+ /**
395
+ * The quote.
396
+ *
397
+ * @generated from field: swap.v1.SwapQuote quote = 1;
398
+ */
399
+ quote?: SwapQuote | undefined;
400
+ };
401
+ /**
402
+ * Describes the message swap.v1.QuoteSwapResponse.
403
+ * Use `create(QuoteSwapResponseSchema)` to create a new message.
404
+ */
405
+ declare const QuoteSwapResponseSchema: GenMessage<QuoteSwapResponse>;
406
+ /**
407
+ * CreateSwapRequest creates and executes a Swap.
408
+ *
409
+ * @generated from message swap.v1.CreateSwapRequest
410
+ */
411
+ type CreateSwapRequest = Message<"swap.v1.CreateSwapRequest"> & {
412
+ /**
413
+ * Client-chosen key, unique per caller, that makes creation idempotent: the
414
+ * same key and request return the same Swap; another request with the same
415
+ * key is IDEMPOTENCY_CONFLICT.
416
+ *
417
+ * @generated from field: string idempotency_key = 1;
418
+ */
419
+ idempotencyKey: string;
420
+ /**
421
+ * Terms to execute.
422
+ *
423
+ * @generated from field: swap.v1.SwapTerms terms = 2;
424
+ */
425
+ terms?: SwapTerms | undefined;
426
+ /**
427
+ * Positive minimum destination amount after fees for the whole amount, in
428
+ * 18-decimal units, usually the quote's min_amount_out_e18. Execution never
429
+ * nets a lower rate; what cannot be traded at it stays on the account.
430
+ *
431
+ * @generated from field: polyester.type.v1.U128 min_amount_out_e18 = 3;
432
+ */
433
+ minAmountOutE18?: U128 | undefined;
434
+ /**
435
+ * The accepted quote's expires_at. The Swap is refused with QUOTE_EXPIRED
436
+ * once it has passed.
437
+ *
438
+ * @generated from field: google.protobuf.Timestamp quote_expires_at = 4;
439
+ */
440
+ quoteExpiresAt?: Timestamp | undefined;
441
+ };
442
+ /**
443
+ * Describes the message swap.v1.CreateSwapRequest.
444
+ * Use `create(CreateSwapRequestSchema)` to create a new message.
445
+ */
446
+ declare const CreateSwapRequestSchema: GenMessage<CreateSwapRequest>;
447
+ /**
448
+ * CreateSwapResponse is the created (or existing) Swap.
449
+ *
450
+ * @generated from message swap.v1.CreateSwapResponse
451
+ */
452
+ type CreateSwapResponse = Message<"swap.v1.CreateSwapResponse"> & {
453
+ /**
454
+ * The Swap.
455
+ *
456
+ * @generated from field: swap.v1.Swap swap = 1;
457
+ */
458
+ swap?: Swap | undefined;
459
+ };
460
+ /**
461
+ * Describes the message swap.v1.CreateSwapResponse.
462
+ * Use `create(CreateSwapResponseSchema)` to create a new message.
463
+ */
464
+ declare const CreateSwapResponseSchema: GenMessage<CreateSwapResponse>;
465
+ /**
466
+ * GetSwapRequest selects one Swap of the caller.
467
+ *
468
+ * @generated from message swap.v1.GetSwapRequest
469
+ */
470
+ type GetSwapRequest = Message<"swap.v1.GetSwapRequest"> & {
471
+ /**
472
+ * Exactly one selector.
473
+ *
474
+ * @generated from oneof swap.v1.GetSwapRequest.selector
475
+ */
476
+ selector: {
477
+ /**
478
+ * Swap ID.
479
+ *
480
+ * @generated from field: fixed64 swap_id = 1;
481
+ */
482
+ value: bigint;
483
+ case: "swapId";
484
+ } | {
485
+ /**
486
+ * Idempotency key the Swap was created with.
487
+ *
488
+ * @generated from field: string idempotency_key = 2;
489
+ */
490
+ value: string;
491
+ case: "idempotencyKey";
492
+ } | {
493
+ case: undefined;
494
+ value?: undefined;
495
+ };
496
+ };
497
+ /**
498
+ * Describes the message swap.v1.GetSwapRequest.
499
+ * Use `create(GetSwapRequestSchema)` to create a new message.
500
+ */
501
+ declare const GetSwapRequestSchema: GenMessage<GetSwapRequest>;
502
+ /**
503
+ * GetSwapResponse is the selected Swap.
504
+ *
505
+ * @generated from message swap.v1.GetSwapResponse
506
+ */
507
+ type GetSwapResponse = Message<"swap.v1.GetSwapResponse"> & {
508
+ /**
509
+ * The Swap.
510
+ *
511
+ * @generated from field: swap.v1.Swap swap = 1;
512
+ */
513
+ swap?: Swap | undefined;
514
+ };
515
+ /**
516
+ * Describes the message swap.v1.GetSwapResponse.
517
+ * Use `create(GetSwapResponseSchema)` to create a new message.
518
+ */
519
+ declare const GetSwapResponseSchema: GenMessage<GetSwapResponse>;
520
+ /**
521
+ * ErrorDetail is attached to Swap errors as an error detail of type
522
+ * swap.v1.ErrorDetail.
523
+ *
524
+ * @generated from message swap.v1.ErrorDetail
525
+ */
526
+ type ErrorDetail = Message<"swap.v1.ErrorDetail"> & {
527
+ /**
528
+ * Stable error code.
529
+ *
530
+ * @generated from field: swap.v1.ErrorCode code = 1;
531
+ */
532
+ code: ErrorCode;
533
+ /**
534
+ * IDEMPOTENCY_CONFLICT only: the Swap bound to the idempotency key.
535
+ *
536
+ * @generated from field: fixed64 swap_id = 2;
537
+ */
538
+ swapId: bigint;
539
+ /**
540
+ * AMOUNT_OUT_OF_RANGE only: the smallest amount that currently quotes, in
541
+ * 18-decimal units of the source asset. Guidance, not a guarantee.
542
+ *
543
+ * @generated from field: polyester.type.v1.U128 min_amount_e18 = 3;
544
+ */
545
+ minAmountE18?: U128 | undefined;
546
+ /**
547
+ * AMOUNT_OUT_OF_RANGE only: the largest amount current depth absorbs, in
548
+ * 18-decimal units of the source asset.
549
+ *
550
+ * @generated from field: polyester.type.v1.U128 max_amount_e18 = 4;
551
+ */
552
+ maxAmountE18?: U128 | undefined;
553
+ };
554
+ /**
555
+ * Describes the message swap.v1.ErrorDetail.
556
+ * Use `create(ErrorDetailSchema)` to create a new message.
557
+ */
558
+ declare const ErrorDetailSchema: GenMessage<ErrorDetail>;
559
+ /**
560
+ * Side is a spot order side.
561
+ *
562
+ * @generated from enum swap.v1.Side
563
+ */
564
+ declare enum Side {
565
+ /**
566
+ * No side.
567
+ *
568
+ * @generated from enum value: SIDE_UNSPECIFIED = 0;
569
+ */
570
+ SIDE_UNSPECIFIED = 0,
571
+ /**
572
+ * Buy the market's base asset with its quote asset.
573
+ *
574
+ * @generated from enum value: BUY = 1;
575
+ */
576
+ BUY = 1,
577
+ /**
578
+ * Sell the market's base asset for its quote asset.
579
+ *
580
+ * @generated from enum value: SELL = 2;
581
+ */
582
+ SELL = 2
583
+ }
584
+ /**
585
+ * Describes the enum swap.v1.Side.
586
+ */
587
+ declare const SideSchema: GenEnum<Side>;
588
+ /**
589
+ * SwapStatus is the state of a Swap.
590
+ *
591
+ * @generated from enum swap.v1.SwapStatus
592
+ */
593
+ declare enum SwapStatus {
594
+ /**
595
+ * No status.
596
+ *
597
+ * @generated from enum value: STATUS_UNSPECIFIED = 0;
598
+ */
599
+ STATUS_UNSPECIFIED = 0,
600
+ /**
601
+ * The Swap is accepted and its orders are being placed, filled or settled.
602
+ *
603
+ * @generated from enum value: EXECUTING = 1;
604
+ */
605
+ EXECUTING = 1,
606
+ /**
607
+ * The whole amount was traded and settled (a remainder smaller than one
608
+ * order step stays on the account, unspent).
609
+ *
610
+ * @generated from enum value: COMPLETED = 2;
611
+ */
612
+ COMPLETED = 2,
613
+ /**
614
+ * Part of the amount was traded and settled; the rest stays on the account,
615
+ * unspent. reason says why.
616
+ *
617
+ * @generated from enum value: PARTIALLY_COMPLETED = 3;
618
+ */
619
+ PARTIALLY_COMPLETED = 3,
620
+ /**
621
+ * Nothing was traded and the whole amount stays on the account, or, with
622
+ * reason MINIMUM_NOT_MET, a fill netted less than the accepted minimum rate;
623
+ * reason says why, and the amounts show what was traded.
624
+ *
625
+ * @generated from enum value: FAILED = 4;
626
+ */
627
+ FAILED = 4,
628
+ /**
629
+ * An order's outcome is being established. Balances already reflect any
630
+ * settled fill; the Swap stays here until the outcome is confirmed.
631
+ *
632
+ * @generated from enum value: RECONCILING = 5;
633
+ */
634
+ RECONCILING = 5
635
+ }
636
+ /**
637
+ * Describes the enum swap.v1.SwapStatus.
638
+ */
639
+ declare const SwapStatusSchema: GenEnum<SwapStatus>;
640
+ /**
641
+ * SwapReason says why a Swap did not trade its whole amount.
642
+ *
643
+ * @generated from enum swap.v1.SwapReason
644
+ */
645
+ declare enum SwapReason {
646
+ /**
647
+ * No reason.
648
+ *
649
+ * @generated from enum value: REASON_UNSPECIFIED = 0;
650
+ */
651
+ REASON_UNSPECIFIED = 0,
652
+ /**
653
+ * The Trading balance did not cover the amount when the order was placed.
654
+ *
655
+ * @generated from enum value: INSUFFICIENT_BALANCE = 1;
656
+ */
657
+ INSUFFICIENT_BALANCE = 1,
658
+ /**
659
+ * The order books could not fill the rest at a price that meets
660
+ * min_amount_out.
661
+ *
662
+ * @generated from enum value: PRICE_PROTECTION = 2;
663
+ */
664
+ PRICE_PROTECTION = 2,
665
+ /**
666
+ * The market was closed, halted, restricted or without liquidity.
667
+ *
668
+ * @generated from enum value: MARKET_UNAVAILABLE = 3;
669
+ */
670
+ MARKET_UNAVAILABLE = 3,
671
+ /**
672
+ * The order was outside the market's size limits.
673
+ *
674
+ * @generated from enum value: ORDER_SIZE_OUT_OF_RANGE = 4;
675
+ */
676
+ ORDER_SIZE_OUT_OF_RANGE = 4,
677
+ /**
678
+ * The account's order rate limit was reached.
679
+ *
680
+ * @generated from enum value: RATE_LIMITED = 5;
681
+ */
682
+ RATE_LIMITED = 5,
683
+ /**
684
+ * The order was refused, for example by the sub-account's trading policy.
685
+ *
686
+ * @generated from enum value: ORDER_REJECTED = 6;
687
+ */
688
+ ORDER_REJECTED = 6,
689
+ /**
690
+ * The execution window ended before the order could be placed.
691
+ *
692
+ * @generated from enum value: EXPIRED = 7;
693
+ */
694
+ EXPIRED = 7,
695
+ /**
696
+ * A fill netted less than the accepted minimum rate. The Swap failed closed:
697
+ * the amounts show exactly what was traded and received.
698
+ *
699
+ * @generated from enum value: MINIMUM_NOT_MET = 8;
700
+ */
701
+ MINIMUM_NOT_MET = 8
702
+ }
703
+ /**
704
+ * Describes the enum swap.v1.SwapReason.
705
+ */
706
+ declare const SwapReasonSchema: GenEnum<SwapReason>;
707
+ /**
708
+ * SwapOrderStatus is the state of a Swap's spot order.
709
+ *
710
+ * @generated from enum swap.v1.SwapOrderStatus
711
+ */
712
+ declare enum SwapOrderStatus {
713
+ /**
714
+ * No order status.
715
+ *
716
+ * @generated from enum value: ORDER_STATUS_UNSPECIFIED = 0;
717
+ */
718
+ ORDER_STATUS_UNSPECIFIED = 0,
719
+ /**
720
+ * The order is being placed.
721
+ *
722
+ * @generated from enum value: PLACING = 1;
723
+ */
724
+ PLACING = 1,
725
+ /**
726
+ * The order was accepted by the market.
727
+ *
728
+ * @generated from enum value: PLACED = 2;
729
+ */
730
+ PLACED = 2,
731
+ /**
732
+ * The order was refused before it reached the market.
733
+ *
734
+ * @generated from enum value: REFUSED = 3;
735
+ */
736
+ REFUSED = 3,
737
+ /**
738
+ * The order was not placed before the execution window ended.
739
+ *
740
+ * @generated from enum value: NOT_PLACED = 4;
741
+ */
742
+ NOT_PLACED = 4,
743
+ /**
744
+ * The order's outcome is being established.
745
+ *
746
+ * @generated from enum value: UNCONFIRMED = 5;
747
+ */
748
+ UNCONFIRMED = 5
749
+ }
750
+ /**
751
+ * Describes the enum swap.v1.SwapOrderStatus.
752
+ */
753
+ declare const SwapOrderStatusSchema: GenEnum<SwapOrderStatus>;
754
+ /**
755
+ * ErrorCode identifies a Swap API error.
756
+ *
757
+ * @generated from enum swap.v1.ErrorCode
758
+ */
759
+ declare enum ErrorCode {
760
+ /**
761
+ * No code.
762
+ *
763
+ * @generated from enum value: ERROR_UNSPECIFIED = 0;
764
+ */
765
+ ERROR_UNSPECIFIED = 0,
766
+ /**
767
+ * No spot market trades the source asset directly against the destination
768
+ * asset.
769
+ *
770
+ * @generated from enum value: ROUTE_UNSUPPORTED = 1;
771
+ */
772
+ ROUTE_UNSUPPORTED = 1,
773
+ /**
774
+ * The amount is outside the market's current limits. The error carries the
775
+ * limits (min_amount_e18, max_amount_e18) when known.
776
+ *
777
+ * @generated from enum value: AMOUNT_OUT_OF_RANGE = 2;
778
+ */
779
+ AMOUNT_OUT_OF_RANGE = 2,
780
+ /**
781
+ * No price is currently available for the route; retry later.
782
+ *
783
+ * @generated from enum value: QUOTE_UNAVAILABLE = 3;
784
+ */
785
+ QUOTE_UNAVAILABLE = 3,
786
+ /**
787
+ * Current order-book depth cannot deliver min_amount_out_e18 (or the
788
+ * requested slippage): request a new quote.
789
+ *
790
+ * @generated from enum value: PROTECTION_UNACHIEVABLE = 4;
791
+ */
792
+ PROTECTION_UNACHIEVABLE = 4,
793
+ /**
794
+ * quote_expires_at has passed: request a new quote.
795
+ *
796
+ * @generated from enum value: QUOTE_EXPIRED = 5;
797
+ */
798
+ QUOTE_EXPIRED = 5,
799
+ /**
800
+ * The idempotency key was already used with a different request. The error
801
+ * carries the original swap_id.
802
+ *
803
+ * @generated from enum value: IDEMPOTENCY_CONFLICT = 6;
804
+ */
805
+ IDEMPOTENCY_CONFLICT = 6,
806
+ /**
807
+ * No Swap of the caller matches the selector.
808
+ *
809
+ * @generated from enum value: SWAP_NOT_FOUND = 7;
810
+ */
811
+ SWAP_NOT_FOUND = 7,
812
+ /**
813
+ * subaccount_id is not a valid sub-account ID.
814
+ *
815
+ * @generated from enum value: INVALID_SUBACCOUNT_ID = 8;
816
+ */
817
+ INVALID_SUBACCOUNT_ID = 8,
818
+ /**
819
+ * The sub-account does not exist.
820
+ *
821
+ * @generated from enum value: SUBACCOUNT_NOT_FOUND = 9;
822
+ */
823
+ SUBACCOUNT_NOT_FOUND = 9,
824
+ /**
825
+ * The sub-account is not active.
826
+ *
827
+ * @generated from enum value: SUBACCOUNT_INACTIVE = 10;
828
+ */
829
+ SUBACCOUNT_INACTIVE = 10,
830
+ /**
831
+ * The caller may not Swap on the account: the role, the API key's policy or
832
+ * the sub-account's policy does not grant SWAP, or a root-scoped API key
833
+ * selected a sub-account.
834
+ *
835
+ * @generated from enum value: SWAP_NOT_PERMITTED = 11;
836
+ */
837
+ SWAP_NOT_PERMITTED = 11,
838
+ /**
839
+ * A required service is temporarily unavailable; retry the same request.
840
+ *
841
+ * @generated from enum value: SERVICE_UNAVAILABLE = 12;
842
+ */
843
+ SERVICE_UNAVAILABLE = 12,
844
+ /**
845
+ * The market trades the two assets but cannot execute a Swap in this
846
+ * direction: a buy there would pay its fee in the asset it spends.
847
+ *
848
+ * @generated from enum value: DIRECTION_UNSUPPORTED = 13;
849
+ */
850
+ DIRECTION_UNSUPPORTED = 13
851
+ }
852
+ /**
853
+ * Describes the enum swap.v1.ErrorCode.
854
+ */
855
+ declare const ErrorCodeSchema: GenEnum<ErrorCode>;
856
+ /**
857
+ * SwapService converts one asset of an account's Trading balance into another
858
+ * through Polyester's spot order books. A Swap executes as immediate-or-cancel
859
+ * spot orders on the account, at the account's spot taker fee and with no
860
+ * other fee, protected by the end-to-end min_amount_out the caller accepts:
861
+ * any part that trades nets at least that rate, and anything that cannot stays
862
+ * on the account. Quotes are estimates and reserve nothing.
863
+ *
864
+ * Requests are authenticated with a session token or a signed API key. The
865
+ * caller needs the SWAP permission on the account: the trading roles grant it
866
+ * on sub-accounts, and API keys and sub-account policies must include the SWAP
867
+ * action. A Swap's orders also remain subject to the sub-account's spot
868
+ * trading policy.
869
+ *
870
+ * Follow a Swap with GetSwap until is_terminal is true; a direct Swap usually
871
+ * completes within seconds.
872
+ *
873
+ * @generated from service swap.v1.SwapService
874
+ */
875
+ declare const SwapService: GenService<{
876
+ /**
877
+ * QuoteSwap prices terms against current order-book depth and the account's
878
+ * taker fee. Nothing is reserved.
879
+ *
880
+ * Errors:
881
+ * - INVALID_ARGUMENT: malformed request, AMOUNT_OUT_OF_RANGE or
882
+ * INVALID_SUBACCOUNT_ID.
883
+ * - FAILED_PRECONDITION: ROUTE_UNSUPPORTED, DIRECTION_UNSUPPORTED,
884
+ * PROTECTION_UNACHIEVABLE or SUBACCOUNT_INACTIVE.
885
+ * - NOT_FOUND: SUBACCOUNT_NOT_FOUND.
886
+ * - PERMISSION_DENIED: SWAP_NOT_PERMITTED.
887
+ * - UNAVAILABLE: QUOTE_UNAVAILABLE or SERVICE_UNAVAILABLE; retry later.
888
+ * - UNAUTHENTICATED: missing or invalid credentials.
889
+ *
890
+ * @generated from rpc swap.v1.SwapService.QuoteSwap
891
+ */
892
+ quoteSwap: {
893
+ methodKind: "unary";
894
+ input: typeof QuoteSwapRequestSchema;
895
+ output: typeof QuoteSwapResponseSchema;
896
+ };
897
+ /**
898
+ * CreateSwap creates the Swap for idempotency_key and executes it at once.
899
+ * It re-prices the terms against current depth first: the Swap is created
900
+ * only while the quote is unexpired and min_amount_out_e18 is achievable.
901
+ * It is idempotent per caller and key: a repeated or concurrent request with
902
+ * the same body returns the same Swap, so every unknown outcome is resolved
903
+ * by repeating the request unchanged.
904
+ *
905
+ * Errors:
906
+ * - INVALID_ARGUMENT: malformed request, AMOUNT_OUT_OF_RANGE or
907
+ * INVALID_SUBACCOUNT_ID.
908
+ * - FAILED_PRECONDITION: ROUTE_UNSUPPORTED, DIRECTION_UNSUPPORTED,
909
+ * PROTECTION_UNACHIEVABLE, QUOTE_EXPIRED or SUBACCOUNT_INACTIVE; nothing is
910
+ * created.
911
+ * - ALREADY_EXISTS: IDEMPOTENCY_CONFLICT; the original Swap stands.
912
+ * - NOT_FOUND: SUBACCOUNT_NOT_FOUND.
913
+ * - PERMISSION_DENIED: SWAP_NOT_PERMITTED.
914
+ * - UNAVAILABLE, DEADLINE_EXCEEDED: QUOTE_UNAVAILABLE, SERVICE_UNAVAILABLE
915
+ * or an unknown outcome; retry the same request.
916
+ * - UNAUTHENTICATED: missing or invalid credentials.
917
+ *
918
+ * @generated from rpc swap.v1.SwapService.CreateSwap
919
+ */
920
+ createSwap: {
921
+ methodKind: "unary";
922
+ input: typeof CreateSwapRequestSchema;
923
+ output: typeof CreateSwapResponseSchema;
924
+ };
925
+ /**
926
+ * GetSwap returns one of the caller's Swaps by swap_id or idempotency key.
927
+ *
928
+ * Errors:
929
+ * - INVALID_ARGUMENT: malformed selector.
930
+ * - NOT_FOUND: SWAP_NOT_FOUND.
931
+ * - PERMISSION_DENIED: SWAP_NOT_PERMITTED.
932
+ * - UNAVAILABLE: SERVICE_UNAVAILABLE; retry later.
933
+ * - UNAUTHENTICATED: missing or invalid credentials.
934
+ *
935
+ * @generated from rpc swap.v1.SwapService.GetSwap
936
+ */
937
+ getSwap: {
938
+ methodKind: "unary";
939
+ input: typeof GetSwapRequestSchema;
940
+ output: typeof GetSwapResponseSchema;
941
+ };
942
+ }>;
943
+ //#endregion
944
+ export { CreateSwapRequest, CreateSwapRequestSchema, CreateSwapResponse, CreateSwapResponseSchema, ErrorCode, ErrorCodeSchema, ErrorDetail, ErrorDetailSchema, GetSwapRequest, GetSwapRequestSchema, GetSwapResponse, GetSwapResponseSchema, QuoteSwapRequest, QuoteSwapRequestSchema, QuoteSwapResponse, QuoteSwapResponseSchema, Side, SideSchema, Swap, SwapOrder, SwapOrderSchema, SwapOrderStatus, SwapOrderStatusSchema, SwapQuote, SwapQuoteLeg, SwapQuoteLegSchema, SwapQuoteSchema, SwapReason, SwapReasonSchema, SwapSchema, SwapService, SwapStatus, SwapStatusSchema, SwapTerms, SwapTermsSchema, file_swap_v1_swap, swap_pb_d_exports };
945
+ //# sourceMappingURL=swap_pb.d.ts.map