@polyester/sdk 0.31.0 → 0.32.0-devnet-20261102134326

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