@polyester/sdk 0.36.0-devnet-20261118123359 → 0.36.0-devnet-20261118184607

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 (339) hide show
  1. package/CHANGELOG.md +60 -8
  2. package/dist/catalogs/index.d.ts +2 -2
  3. package/dist/catalogs/snapshot-validation.js +10 -1
  4. package/dist/catalogs/snapshot-validation.js.map +1 -1
  5. package/dist/catalogs/zipper-catalog.d.ts +2 -0
  6. package/dist/catalogs/zipper-catalog.d.ts.map +1 -1
  7. package/dist/catalogs/zipper-catalog.js.map +1 -1
  8. package/dist/catalogs/zipper-supply.d.ts +2 -0
  9. package/dist/catalogs/zipper-supply.d.ts.map +1 -1
  10. package/dist/catalogs/zipper-supply.js +7 -5
  11. package/dist/catalogs/zipper-supply.js.map +1 -1
  12. package/dist/client.d.ts +2 -0
  13. package/dist/client.d.ts.map +1 -1
  14. package/dist/client.js +2 -0
  15. package/dist/client.js.map +1 -1
  16. package/dist/gen/ai/v1/assistant_pb.d.ts +679 -13
  17. package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
  18. package/dist/gen/ai/v1/assistant_pb.js +355 -97
  19. package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
  20. package/dist/gen/alerts/v1/price_alerts_pb.d.ts +33 -4
  21. package/dist/gen/alerts/v1/price_alerts_pb.d.ts.map +1 -1
  22. package/dist/gen/alerts/v1/price_alerts_pb.js +23 -2
  23. package/dist/gen/alerts/v1/price_alerts_pb.js.map +1 -1
  24. package/dist/gen/auth/v1/activity_pb.d.ts +148 -0
  25. package/dist/gen/auth/v1/activity_pb.d.ts.map +1 -0
  26. package/dist/gen/auth/v1/activity_pb.js +40 -0
  27. package/dist/gen/auth/v1/activity_pb.js.map +1 -0
  28. package/dist/gen/auth/v1/api_keys_pb.d.ts +10 -4
  29. package/dist/gen/auth/v1/api_keys_pb.d.ts.map +1 -1
  30. package/dist/gen/auth/v1/api_keys_pb.js +3 -1
  31. package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
  32. package/dist/gen/auth/v1/auth_pb.d.ts +61 -5
  33. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  34. package/dist/gen/auth/v1/auth_pb.js +23 -6
  35. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  36. package/dist/gen/auth/v1/mfa_pb.d.ts +140 -2
  37. package/dist/gen/auth/v1/mfa_pb.d.ts.map +1 -1
  38. package/dist/gen/auth/v1/mfa_pb.js +80 -8
  39. package/dist/gen/auth/v1/mfa_pb.js.map +1 -1
  40. package/dist/gen/auth/v1/policies_pb.d.ts +18 -3
  41. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  42. package/dist/gen/auth/v1/policies_pb.js +18 -3
  43. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  44. package/dist/gen/auth/v1/social_verification_pb.d.ts +36 -15
  45. package/dist/gen/auth/v1/social_verification_pb.d.ts.map +1 -1
  46. package/dist/gen/auth/v1/social_verification_pb.js +1 -1
  47. package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
  48. package/dist/gen/auth/v1/subaccounts_pb.d.ts +15 -1
  49. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  50. package/dist/gen/auth/v1/subaccounts_pb.js +1 -1
  51. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  52. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +6 -2
  53. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
  54. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
  55. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +104 -6
  56. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  57. package/dist/gen/chain/withdraw/v1/withdraw_pb.js +49 -3
  58. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  59. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts +76 -3
  60. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts.map +1 -1
  61. package/dist/gen/chain/zipper/v1/zipper_pb.js +46 -2
  62. package/dist/gen/chain/zipper/v1/zipper_pb.js.map +1 -1
  63. package/dist/gen/index.d.ts +3 -1
  64. package/dist/gen/index.js +4 -2
  65. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +21 -139
  66. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
  67. package/dist/gen/ledger/read/v1/ledger_read_pb.js +16 -17
  68. package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
  69. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts +236 -20
  70. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts.map +1 -1
  71. package/dist/gen/ledger/read/v1/statement_export_pb.js +44 -10
  72. package/dist/gen/ledger/read/v1/statement_export_pb.js.map +1 -1
  73. package/dist/gen/ledger/v1/catalog_pb.d.ts +9 -1
  74. package/dist/gen/ledger/v1/catalog_pb.d.ts.map +1 -1
  75. package/dist/gen/ledger/v1/catalog_pb.js +9 -1
  76. package/dist/gen/ledger/v1/catalog_pb.js.map +1 -1
  77. package/dist/gen/marketdata/v1/asset_info_pb.d.ts +158 -7
  78. package/dist/gen/marketdata/v1/asset_info_pb.d.ts.map +1 -1
  79. package/dist/gen/marketdata/v1/asset_info_pb.js +56 -6
  80. package/dist/gen/marketdata/v1/asset_info_pb.js.map +1 -1
  81. package/dist/gen/notifications/v1/notifications_pb.d.ts +45 -6
  82. package/dist/gen/notifications/v1/notifications_pb.d.ts.map +1 -1
  83. package/dist/gen/notifications/v1/notifications_pb.js +23 -5
  84. package/dist/gen/notifications/v1/notifications_pb.js.map +1 -1
  85. package/dist/gen/orders/v1/orders_pb.d.ts +105 -29
  86. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  87. package/dist/gen/orders/v1/orders_pb.js +14 -2
  88. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  89. package/dist/gen/orders/v1/orders_read_pb.d.ts +50 -20
  90. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  91. package/dist/gen/orders/v1/orders_read_pb.js +1 -1
  92. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  93. package/dist/gen/polyester/api/options_pb.d.ts +11 -2
  94. package/dist/gen/polyester/api/options_pb.d.ts.map +1 -1
  95. package/dist/gen/polyester/api/options_pb.js +13 -3
  96. package/dist/gen/polyester/api/options_pb.js.map +1 -1
  97. package/dist/gen/privatews/v1/private_ws_pb.d.ts +13 -3
  98. package/dist/gen/privatews/v1/private_ws_pb.d.ts.map +1 -1
  99. package/dist/gen/privatews/v1/private_ws_pb.js.map +1 -1
  100. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +126 -10
  101. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
  102. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +14 -6
  103. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
  104. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.d.ts +665 -0
  105. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.d.ts.map +1 -0
  106. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.js +216 -0
  107. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.js.map +1 -0
  108. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +166 -52
  109. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  110. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +50 -12
  111. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  112. package/dist/gen/system/v1/system_pb.d.ts +49 -2
  113. package/dist/gen/system/v1/system_pb.d.ts.map +1 -1
  114. package/dist/gen/system/v1/system_pb.js +18 -6
  115. package/dist/gen/system/v1/system_pb.js.map +1 -1
  116. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +150 -71
  117. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
  118. package/dist/gen/transfer/v1/internal_transfer_pb.js +56 -34
  119. package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
  120. package/dist/gen/triggers/v1/triggers_pb.d.ts +117 -16
  121. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  122. package/dist/gen/triggers/v1/triggers_pb.js +45 -2
  123. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  124. package/dist/index.d.ts +13 -9
  125. package/dist/realtime/ready-gated-subscription.js +1 -1
  126. package/dist/realtime/snapshot-then-stream.js +2 -0
  127. package/dist/realtime/snapshot-then-stream.js.map +1 -1
  128. package/dist/services/account-activity/account-activity.d.ts +22 -0
  129. package/dist/services/account-activity/account-activity.d.ts.map +1 -0
  130. package/dist/services/account-activity/account-activity.js +32 -0
  131. package/dist/services/account-activity/account-activity.js.map +1 -0
  132. package/dist/services/account-activity/account-activity.schemas.d.ts +78 -0
  133. package/dist/services/account-activity/account-activity.schemas.d.ts.map +1 -0
  134. package/dist/services/account-activity/account-activity.schemas.js +44 -0
  135. package/dist/services/account-activity/account-activity.schemas.js.map +1 -0
  136. package/dist/services/account-activity/account-activity.types.d.ts +2 -0
  137. package/dist/services/account-activity/service.d.ts +8 -0
  138. package/dist/services/account-activity/service.d.ts.map +1 -0
  139. package/dist/services/account-activity/service.js +9 -0
  140. package/dist/services/account-activity/service.js.map +1 -0
  141. package/dist/services/address-book/address-book.schemas.d.ts +2 -2
  142. package/dist/services/address-book/address-book.schemas.js +2 -2
  143. package/dist/services/api-keys/api-keys.schemas.js +2 -2
  144. package/dist/services/assistant/assistant-events.schemas.d.ts +25 -25
  145. package/dist/services/assistant/assistant.codecs.d.ts +7 -2
  146. package/dist/services/assistant/assistant.codecs.d.ts.map +1 -1
  147. package/dist/services/assistant/assistant.codecs.js +18 -2
  148. package/dist/services/assistant/assistant.codecs.js.map +1 -1
  149. package/dist/services/assistant/assistant.d.ts +29 -2
  150. package/dist/services/assistant/assistant.d.ts.map +1 -1
  151. package/dist/services/assistant/assistant.js +44 -2
  152. package/dist/services/assistant/assistant.js.map +1 -1
  153. package/dist/services/assistant/assistant.schemas.d.ts +111 -6
  154. package/dist/services/assistant/assistant.schemas.d.ts.map +1 -1
  155. package/dist/services/assistant/assistant.schemas.js +74 -6
  156. package/dist/services/assistant/assistant.schemas.js.map +1 -1
  157. package/dist/services/assistant/assistant.types.d.ts +3 -3
  158. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +3 -1
  159. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -1
  160. package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -1
  161. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +21 -19
  162. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts.map +1 -1
  163. package/dist/services/auto-withdraw/auto-withdraw.schemas.js +1 -0
  164. package/dist/services/auto-withdraw/auto-withdraw.schemas.js.map +1 -1
  165. package/dist/services/balances/balances.d.ts +1 -13
  166. package/dist/services/balances/balances.d.ts.map +1 -1
  167. package/dist/services/balances/balances.js +1 -45
  168. package/dist/services/balances/balances.js.map +1 -1
  169. package/dist/services/balances/balances.schemas.d.ts +1 -67
  170. package/dist/services/balances/balances.schemas.d.ts.map +1 -1
  171. package/dist/services/balances/balances.schemas.js +1 -22
  172. package/dist/services/balances/balances.schemas.js.map +1 -1
  173. package/dist/services/balances/balances.types.d.ts +2 -2
  174. package/dist/services/candles/candles.schemas.d.ts +10 -10
  175. package/dist/services/changelog/changelog.schemas.d.ts +38 -38
  176. package/dist/services/claims/claims.schemas.d.ts +2 -2
  177. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts +2 -2
  178. package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
  179. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts +11 -6
  180. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts.map +1 -1
  181. package/dist/services/internal-transfers/internal-transfers.codecs.js +6 -6
  182. package/dist/services/internal-transfers/internal-transfers.codecs.js.map +1 -1
  183. package/dist/services/internal-transfers/internal-transfers.d.ts +17 -10
  184. package/dist/services/internal-transfers/internal-transfers.d.ts.map +1 -1
  185. package/dist/services/internal-transfers/internal-transfers.js +21 -10
  186. package/dist/services/internal-transfers/internal-transfers.js.map +1 -1
  187. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +43 -31
  188. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts.map +1 -1
  189. package/dist/services/internal-transfers/internal-transfers.schemas.js +23 -12
  190. package/dist/services/internal-transfers/internal-transfers.schemas.js.map +1 -1
  191. package/dist/services/internal-transfers/internal-transfers.types.d.ts +2 -2
  192. package/dist/services/lifecycle/lifecycle.js +1 -1
  193. package/dist/services/lifecycle/lifecycle.js.map +1 -1
  194. package/dist/services/lifecycle/lifecycle.schemas.d.ts +55 -55
  195. package/dist/services/market-data/market-data.codecs.d.ts +8 -0
  196. package/dist/services/market-data/market-data.codecs.d.ts.map +1 -0
  197. package/dist/services/market-data/market-data.codecs.js +7 -1
  198. package/dist/services/market-data/market-data.codecs.js.map +1 -1
  199. package/dist/services/market-data/market-data.d.ts +3 -2
  200. package/dist/services/market-data/market-data.d.ts.map +1 -1
  201. package/dist/services/market-data/market-data.js +3 -2
  202. package/dist/services/market-data/market-data.js.map +1 -1
  203. package/dist/services/market-data/market-data.schemas.d.ts +332 -4
  204. package/dist/services/market-data/market-data.schemas.d.ts.map +1 -1
  205. package/dist/services/market-data/market-data.schemas.js +56 -8
  206. package/dist/services/market-data/market-data.schemas.js.map +1 -1
  207. package/dist/services/market-data/market-data.types.d.ts +3 -2
  208. package/dist/services/notifications/notifications.codecs.d.ts +1 -1
  209. package/dist/services/notifications/notifications.codecs.d.ts.map +1 -1
  210. package/dist/services/notifications/notifications.codecs.js +2 -1
  211. package/dist/services/notifications/notifications.codecs.js.map +1 -1
  212. package/dist/services/notifications/notifications.d.ts +4 -2
  213. package/dist/services/notifications/notifications.d.ts.map +1 -1
  214. package/dist/services/notifications/notifications.js +4 -2
  215. package/dist/services/notifications/notifications.js.map +1 -1
  216. package/dist/services/notifications/notifications.schemas.d.ts +50 -6
  217. package/dist/services/notifications/notifications.schemas.d.ts.map +1 -1
  218. package/dist/services/notifications/notifications.schemas.js +5 -0
  219. package/dist/services/notifications/notifications.schemas.js.map +1 -1
  220. package/dist/services/orderbook/orderbook.js +1 -1
  221. package/dist/services/orders/order-enums.codecs.d.ts +2 -0
  222. package/dist/services/orders/order-errors.schemas.d.ts +49 -4
  223. package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
  224. package/dist/services/orders/order-errors.schemas.js +13 -3
  225. package/dist/services/orders/order-errors.schemas.js.map +1 -1
  226. package/dist/services/orders/orders-batch.schemas.d.ts +290 -50
  227. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  228. package/dist/services/orders/orders-input.schemas.d.ts +55 -8
  229. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  230. package/dist/services/orders/orders-input.schemas.js +1 -1
  231. package/dist/services/orders/orders-output.schemas.d.ts +10 -10
  232. package/dist/services/orders/orders.d.ts.map +1 -1
  233. package/dist/services/orders/orders.js +47 -43
  234. package/dist/services/orders/orders.js.map +1 -1
  235. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  236. package/dist/services/policies/api-key-policies/api-key-policies.schemas.js +1 -1
  237. package/dist/services/policies/shared.codecs.js +12 -6
  238. package/dist/services/policies/shared.codecs.js.map +1 -1
  239. package/dist/services/policies/shared.d.ts +1 -1
  240. package/dist/services/policies/shared.js +1 -1
  241. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +9 -9
  242. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +3 -3
  243. package/dist/services/price-alerts/price-alerts.d.ts +5 -2
  244. package/dist/services/price-alerts/price-alerts.d.ts.map +1 -1
  245. package/dist/services/price-alerts/price-alerts.js +5 -2
  246. package/dist/services/price-alerts/price-alerts.js.map +1 -1
  247. package/dist/services/price-alerts/price-alerts.schemas.js +1 -1
  248. package/dist/services/social-verification/social-verification.schemas.d.ts +9 -0
  249. package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
  250. package/dist/services/social-verification/social-verification.schemas.js +9 -2
  251. package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
  252. package/dist/services/statement-exports/statement-exports.codecs.d.ts +3 -2
  253. package/dist/services/statement-exports/statement-exports.codecs.d.ts.map +1 -1
  254. package/dist/services/statement-exports/statement-exports.codecs.js +2 -1
  255. package/dist/services/statement-exports/statement-exports.codecs.js.map +1 -1
  256. package/dist/services/statement-exports/statement-exports.d.ts +25 -10
  257. package/dist/services/statement-exports/statement-exports.d.ts.map +1 -1
  258. package/dist/services/statement-exports/statement-exports.js +33 -10
  259. package/dist/services/statement-exports/statement-exports.js.map +1 -1
  260. package/dist/services/statement-exports/statement-exports.schemas.d.ts +37 -9
  261. package/dist/services/statement-exports/statement-exports.schemas.d.ts.map +1 -1
  262. package/dist/services/statement-exports/statement-exports.schemas.js +24 -5
  263. package/dist/services/statement-exports/statement-exports.schemas.js.map +1 -1
  264. package/dist/services/statement-exports/statement-exports.types.d.ts +2 -2
  265. package/dist/services/subaccounts/subaccounts.codecs.js +112 -38
  266. package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
  267. package/dist/services/subaccounts/subaccounts.js +1 -1
  268. package/dist/services/subaccounts/subaccounts.schemas.d.ts +22 -15
  269. package/dist/services/subaccounts/subaccounts.schemas.d.ts.map +1 -1
  270. package/dist/services/subaccounts/subaccounts.schemas.js +10 -3
  271. package/dist/services/subaccounts/subaccounts.schemas.js.map +1 -1
  272. package/dist/services/system/system.d.ts +12 -1
  273. package/dist/services/system/system.d.ts.map +1 -1
  274. package/dist/services/system/system.js +5 -0
  275. package/dist/services/system/system.js.map +1 -1
  276. package/dist/services/system/system.schemas.d.ts +13 -13
  277. package/dist/services/system/system.types.d.ts +2 -2
  278. package/dist/services/trades/trades.d.ts.map +1 -1
  279. package/dist/services/trades/trades.js +12 -4
  280. package/dist/services/trades/trades.js.map +1 -1
  281. package/dist/services/trades/trades.schemas.d.ts +1 -1
  282. package/dist/services/trading-withdraws/trading-withdraws.codecs.d.ts +8 -0
  283. package/dist/services/trading-withdraws/trading-withdraws.codecs.d.ts.map +1 -0
  284. package/dist/services/trading-withdraws/trading-withdraws.codecs.js +7 -1
  285. package/dist/services/trading-withdraws/trading-withdraws.codecs.js.map +1 -1
  286. package/dist/services/trading-withdraws/trading-withdraws.d.ts +2 -1
  287. package/dist/services/trading-withdraws/trading-withdraws.d.ts.map +1 -1
  288. package/dist/services/trading-withdraws/trading-withdraws.js +2 -1
  289. package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
  290. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts +15 -0
  291. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts.map +1 -1
  292. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +16 -2
  293. package/dist/services/trading-withdraws/trading-withdraws.schemas.js.map +1 -1
  294. package/dist/services/trading-withdraws/trading-withdraws.types.d.ts +2 -1
  295. package/dist/services/transfers/transfers.schemas.d.ts +4 -4
  296. package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
  297. package/dist/services/triggers/triggers-output.schemas.d.ts +153 -35
  298. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  299. package/dist/services/triggers/triggers-output.schemas.js +13 -3
  300. package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
  301. package/dist/services/triggers/triggers.codecs.d.ts +10 -0
  302. package/dist/services/triggers/triggers.codecs.d.ts.map +1 -0
  303. package/dist/services/triggers/triggers.codecs.js +7 -1
  304. package/dist/services/triggers/triggers.codecs.js.map +1 -1
  305. package/dist/services/triggers/triggers.d.ts +2 -2
  306. package/dist/services/triggers/triggers.d.ts.map +1 -1
  307. package/dist/services/triggers/triggers.js +16 -12
  308. package/dist/services/triggers/triggers.js.map +1 -1
  309. package/dist/services/zipper/zipper.d.ts.map +1 -1
  310. package/dist/services/zipper/zipper.js +13 -7
  311. package/dist/services/zipper/zipper.js.map +1 -1
  312. package/dist/services/zipper/zipper.schemas.d.ts +7 -2
  313. package/dist/services/zipper/zipper.schemas.d.ts.map +1 -1
  314. package/dist/services/zipper/zipper.schemas.js +29 -9
  315. package/dist/services/zipper/zipper.schemas.js.map +1 -1
  316. package/dist/services/zipper/zipper.types.d.ts +2 -2
  317. package/dist/shared/catalog-config.d.ts +16 -2
  318. package/dist/shared/catalog-config.d.ts.map +1 -1
  319. package/dist/shared/catalog-config.js.map +1 -1
  320. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  321. package/dist/shared/connect-error-mapping.js +7 -2
  322. package/dist/shared/connect-error-mapping.js.map +1 -1
  323. package/dist/shared/decimal-surface.d.ts +6 -0
  324. package/dist/shared/decimal-surface.d.ts.map +1 -1
  325. package/dist/shared/decimal-surface.js +65 -1
  326. package/dist/shared/decimal-surface.js.map +1 -1
  327. package/dist/shared/error-detail.d.ts +10 -0
  328. package/dist/shared/error-detail.d.ts.map +1 -1
  329. package/dist/shared/error-detail.js.map +1 -1
  330. package/dist/shared/error-details/auth.js +6 -0
  331. package/dist/shared/error-details/auth.js.map +1 -1
  332. package/dist/shared/ledger-codes.d.ts +3 -1
  333. package/dist/shared/ledger-codes.d.ts.map +1 -1
  334. package/dist/shared/ledger-codes.js +6 -3
  335. package/dist/shared/ledger-codes.js.map +1 -1
  336. package/dist/wired-services.d.ts.map +1 -1
  337. package/dist/wired-services.js +3 -1
  338. package/dist/wired-services.js.map +1 -1
  339. package/package.json +1 -1
@@ -70,6 +70,7 @@ type AutoWithdrawScheduleInput = v.InferInput<typeof AutoWithdrawScheduleInputSc
70
70
  */
71
71
  declare const AutoWithdrawDestinationInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
72
72
  readonly assetId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
73
+ /** Polyester chain ID of the network: a Zipper chain's `chainId`, not its `nativeChainId`. */
73
74
  readonly destinationChainId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
74
75
  readonly destinationAddress: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
75
76
  readonly minAmount: v.StringSchema<undefined>;
@@ -139,6 +140,7 @@ declare const SetAutoWithdrawRuleInputSchema: v.SchemaWithPipe<readonly [v.Stric
139
140
  }>]>;
140
141
  readonly destinations: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
141
142
  readonly assetId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
143
+ /** Polyester chain ID of the network: a Zipper chain's `chainId`, not its `nativeChainId`. */
142
144
  readonly destinationChainId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
143
145
  readonly destinationAddress: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
144
146
  readonly minAmount: v.StringSchema<undefined>;
@@ -500,7 +502,7 @@ declare const AutoWithdrawStepSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
500
502
  readonly hi: v.BigintSchema<undefined>;
501
503
  readonly lo: v.BigintSchema<undefined>;
502
504
  }, undefined>, undefined>;
503
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted">]>;
505
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted">]>;
504
506
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawStepReason | null>]>;
505
507
  readonly intentId: v.OptionalSchema<v.StringSchema<undefined>, "">;
506
508
  readonly txHash: v.OptionalSchema<v.StringSchema<undefined>, "">;
@@ -524,7 +526,7 @@ declare const AutoWithdrawStepSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
524
526
  hi: bigint;
525
527
  lo: bigint;
526
528
  } | undefined;
527
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
529
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
528
530
  reason: AutoWithdrawStepReason | null;
529
531
  intentId: string;
530
532
  txHash: string;
@@ -538,7 +540,7 @@ declare const AutoWithdrawStepSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
538
540
  txHash: string | null;
539
541
  assetId: number;
540
542
  destinationAddress: string;
541
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
543
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
542
544
  reason: AutoWithdrawStepReason | null;
543
545
  }>]>;
544
546
  /**
@@ -559,7 +561,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
559
561
  seconds: bigint;
560
562
  nanos: number;
561
563
  }, number>]>;
562
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "failed" | "planned" | "paying" | "partially_failed" | "skipped">]>;
564
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "completed" | "planned" | "paying" | "partially_failed" | "skipped">]>;
563
565
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawRunReason | null>]>;
564
566
  readonly steps: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
565
567
  readonly assetId: v.NumberSchema<undefined>;
@@ -581,7 +583,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
581
583
  readonly hi: v.BigintSchema<undefined>;
582
584
  readonly lo: v.BigintSchema<undefined>;
583
585
  }, undefined>, undefined>;
584
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted">]>;
586
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted">]>;
585
587
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawStepReason | null>]>;
586
588
  readonly intentId: v.OptionalSchema<v.StringSchema<undefined>, "">;
587
589
  readonly txHash: v.OptionalSchema<v.StringSchema<undefined>, "">;
@@ -605,7 +607,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
605
607
  hi: bigint;
606
608
  lo: bigint;
607
609
  } | undefined;
608
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
610
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
609
611
  reason: AutoWithdrawStepReason | null;
610
612
  intentId: string;
611
613
  txHash: string;
@@ -619,7 +621,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
619
621
  txHash: string | null;
620
622
  assetId: number;
621
623
  destinationAddress: string;
622
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
624
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
623
625
  reason: AutoWithdrawStepReason | null;
624
626
  }>]>, undefined>;
625
627
  readonly createdAt: v.SchemaWithPipe<readonly [v.ObjectSchema<{
@@ -640,7 +642,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
640
642
  runSeq: string;
641
643
  ruleVersion: number;
642
644
  scheduledFor: number;
643
- state: "unspecified" | "completed" | "failed" | "planned" | "paying" | "partially_failed" | "skipped";
645
+ state: "unspecified" | "failed" | "completed" | "planned" | "paying" | "partially_failed" | "skipped";
644
646
  reason: AutoWithdrawRunReason | null;
645
647
  steps: {
646
648
  destinationChainId: number;
@@ -652,7 +654,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
652
654
  txHash: string | null;
653
655
  assetId: number;
654
656
  destinationAddress: string;
655
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
657
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
656
658
  reason: AutoWithdrawStepReason | null;
657
659
  }[];
658
660
  createdAt: number;
@@ -662,7 +664,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
662
664
  runSeq: string;
663
665
  ruleVersion: number;
664
666
  scheduledFor: number;
665
- state: "unspecified" | "completed" | "failed" | "planned" | "paying" | "partially_failed" | "skipped";
667
+ state: "unspecified" | "failed" | "completed" | "planned" | "paying" | "partially_failed" | "skipped";
666
668
  reason: AutoWithdrawRunReason | null;
667
669
  steps: {
668
670
  destinationChainId: number;
@@ -674,7 +676,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
674
676
  txHash: string | null;
675
677
  assetId: number;
676
678
  destinationAddress: string;
677
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
679
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
678
680
  reason: AutoWithdrawStepReason | null;
679
681
  }[];
680
682
  createdAt: number;
@@ -692,7 +694,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
692
694
  seconds: bigint;
693
695
  nanos: number;
694
696
  }, number>]>;
695
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "failed" | "planned" | "paying" | "partially_failed" | "skipped">]>;
697
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "completed" | "planned" | "paying" | "partially_failed" | "skipped">]>;
696
698
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawRunReason | null>]>;
697
699
  readonly steps: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
698
700
  readonly assetId: v.NumberSchema<undefined>;
@@ -714,7 +716,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
714
716
  readonly hi: v.BigintSchema<undefined>;
715
717
  readonly lo: v.BigintSchema<undefined>;
716
718
  }, undefined>, undefined>;
717
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted">]>;
719
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted">]>;
718
720
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawStepReason | null>]>;
719
721
  readonly intentId: v.OptionalSchema<v.StringSchema<undefined>, "">;
720
722
  readonly txHash: v.OptionalSchema<v.StringSchema<undefined>, "">;
@@ -738,7 +740,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
738
740
  hi: bigint;
739
741
  lo: bigint;
740
742
  } | undefined;
741
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
743
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
742
744
  reason: AutoWithdrawStepReason | null;
743
745
  intentId: string;
744
746
  txHash: string;
@@ -752,7 +754,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
752
754
  txHash: string | null;
753
755
  assetId: number;
754
756
  destinationAddress: string;
755
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
757
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
756
758
  reason: AutoWithdrawStepReason | null;
757
759
  }>]>, undefined>;
758
760
  readonly createdAt: v.SchemaWithPipe<readonly [v.ObjectSchema<{
@@ -773,7 +775,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
773
775
  runSeq: string;
774
776
  ruleVersion: number;
775
777
  scheduledFor: number;
776
- state: "unspecified" | "completed" | "failed" | "planned" | "paying" | "partially_failed" | "skipped";
778
+ state: "unspecified" | "failed" | "completed" | "planned" | "paying" | "partially_failed" | "skipped";
777
779
  reason: AutoWithdrawRunReason | null;
778
780
  steps: {
779
781
  destinationChainId: number;
@@ -785,7 +787,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
785
787
  txHash: string | null;
786
788
  assetId: number;
787
789
  destinationAddress: string;
788
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
790
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
789
791
  reason: AutoWithdrawStepReason | null;
790
792
  }[];
791
793
  createdAt: number;
@@ -795,7 +797,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
795
797
  runSeq: string;
796
798
  ruleVersion: number;
797
799
  scheduledFor: number;
798
- state: "unspecified" | "completed" | "failed" | "planned" | "paying" | "partially_failed" | "skipped";
800
+ state: "unspecified" | "failed" | "completed" | "planned" | "paying" | "partially_failed" | "skipped";
799
801
  reason: AutoWithdrawRunReason | null;
800
802
  steps: {
801
803
  destinationChainId: number;
@@ -807,7 +809,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
807
809
  txHash: string | null;
808
810
  assetId: number;
809
811
  destinationAddress: string;
810
- state: "unspecified" | "completed" | "pending" | "failed" | "skipped" | "submitting" | "submitted";
812
+ state: "unspecified" | "failed" | "pending" | "completed" | "skipped" | "submitting" | "submitted";
811
813
  reason: AutoWithdrawStepReason | null;
812
814
  }[];
813
815
  createdAt: number;
@@ -1 +1 @@
1
- {"version":3,"file":"auto-withdraw.schemas.d.ts","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.schemas.ts"],"mappings":";;;;;;cA0DM,0BAAwB,EAAA;;;;;KAElB,0BAA0B,EAAE,kBAAkB;;;;;;;cAiC7C,iCAA+B,EAAA,yBAAA,EAAA,0BAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkChC,4BAA4B,EAAE,kBAAkB;;;;;;cAOtD,oCAAkC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;gBAAA;;;;;KA8B5B,+BAA+B,EAAE,kBAAkB;cAElD,gCAA8B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2B/B,2BAA2B,EAAE,kBAAkB;cAE9C,uCAAqC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;KAetC,kCAAkC,EAAE,kBACrC;;cAIE,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;KAYhC,4BAA4B,EAAE,kBAAkB;KAEvD,cAAc;EACX;EAAmB;;EACnB;EAAkB;;EAClB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AE,mBAAmB;cAE/C,2BAAyB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwB1B,sBAAsB,EAAE,mBAAmB"}
@@ -81,6 +81,7 @@ const AutoWithdrawScheduleInputSchema = v.pipe(v.variant("cadence", [
81
81
  */
82
82
  const AutoWithdrawDestinationInputSchema = v.pipe(v.strictObject({
83
83
  assetId: PositiveUint32InputSchema,
84
+ /** Polyester chain ID of the network: a Zipper chain's `chainId`, not its `nativeChainId`. */
84
85
  destinationChainId: v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(Number.MAX_SAFE_INTEGER)),
85
86
  destinationAddress: v.pipe(v.string(), v.trim(), v.minLength(1)),
86
87
  minAmount: v.string(),
@@ -1 +1 @@
1
- {"version":3,"file":"auto-withdraw.schemas.js","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport * as Proto from \"../../gen/chain/withdraw/v1/auto_withdraw_pb.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport {\n decimalInputToScaled,\n E18_SCALE,\n scaledToDecimalOutput,\n} from \"../../shared/decimal-surface.js\";\nimport { ValidationError } from \"../../shared/errors.js\";\nimport { enumLabel, enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n BigIntStringSchema,\n OptionalTimestampMsSchema,\n PublicIdOrEmptySchema,\n TimestampMsSchema,\n U128Schema,\n} from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport { fromU128, toU128 } from \"../../utils/u128.js\";\nimport { PositiveUint32InputSchema } from \"../shared.js\";\nimport {\n AUTO_WITHDRAW_WEEKDAY_VALUES,\n AutoWithdrawCadenceCodec,\n AutoWithdrawPreviewStatusCodec,\n AutoWithdrawRunStateCodec,\n AutoWithdrawStepStateCodec,\n AutoWithdrawWeekdayCodec,\n type AutoWithdrawHoldReason,\n type AutoWithdrawPauseReason,\n type AutoWithdrawRunReason,\n type AutoWithdrawStepReason,\n type AutoWithdrawWeekday,\n} from \"./auto-withdraw.codecs.js\";\n\nconst U128_MAX = (1n << 128n) - 1n;\n\n/** Decimal string → 18-decimal U128 integer, exact; throws `ValidationError`. */\nfunction decimalToE18(field: string, value: string): bigint {\n const scaled = decimalInputToScaled(field, value, E18_SCALE);\n if (scaled > U128_MAX) {\n throw new ValidationError(`${field} exceeds the maximum supported value: ${value}`);\n }\n return scaled;\n}\n\nfunction e18ToDecimal(value: v.InferOutput<typeof U128Schema> | undefined): string {\n return scaledToDecimalOutput(fromU128(value), E18_SCALE);\n}\n\n/** Unset means unknown, never zero. */\nfunction optionalE18ToDecimal(value: v.InferOutput<typeof U128Schema> | undefined): string | null {\n return value ? e18ToDecimal(value) : null;\n}\n\nconst AccountScopedInputSchema = v.strictObject({ ...AccountScopeInputEntries });\n\nexport type AutoWithdrawScopedInput = v.InferInput<typeof AccountScopedInputSchema>;\n\nexport const AutoWithdrawScopedInputSchema = v.pipe(\n AccountScopedInputSchema,\n v.transform(({ account }) => ({ subaccountId: accountScopeToSubaccountId(account) })),\n);\n\nconst Uint32InputSchema = v.pipe(\n v.number(),\n v.integer(),\n v.minValue(0),\n v.maxValue(PROTOBUF_UINT32_MAX),\n);\nconst MinuteOfDaySchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(1439));\nconst MinuteOfHourSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(59));\nconst DayOfMonthSchema = v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(31));\nconst WeekdaySchema = v.picklist(AUTO_WITHDRAW_WEEKDAY_VALUES);\nconst AnchorDateSchema = v.pipe(\n v.string(),\n v.trim(),\n v.isoDate(\"anchorDate must be a UTC date, YYYY-MM-DD\"),\n v.check((date) => {\n const parsed = new Date(`${date}T00:00:00Z`);\n return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(date);\n }, \"anchorDate must be a real calendar date\"),\n);\n\n/**\n * A rule's UTC run slot. Each cadence takes only its own fields; any other field is rejected.\n * `minuteOfDay` is minutes after 00:00 UTC (0–1439), `minuteOfHour` 0–59, `dayOfMonth` 1–31\n * (a shorter month runs on its last day), and `anchorDate` is a UTC date in a week a biweekly\n * rule runs.\n */\nexport const AutoWithdrawScheduleInputSchema = v.pipe(\n v.variant(\"cadence\", [\n v.strictObject({ cadence: v.literal(\"hourly\"), minuteOfHour: MinuteOfHourSchema }),\n v.strictObject({ cadence: v.literal(\"daily\"), minuteOfDay: MinuteOfDaySchema }),\n v.strictObject({\n cadence: v.literal(\"weekly\"),\n weekday: WeekdaySchema,\n minuteOfDay: MinuteOfDaySchema,\n }),\n v.strictObject({\n cadence: v.literal(\"biweekly\"),\n weekday: WeekdaySchema,\n minuteOfDay: MinuteOfDaySchema,\n anchorDate: AnchorDateSchema,\n }),\n v.strictObject({\n cadence: v.literal(\"monthly\"),\n dayOfMonth: DayOfMonthSchema,\n minuteOfDay: MinuteOfDaySchema,\n }),\n ]),\n v.transform((schedule) => ({\n cadence: AutoWithdrawCadenceCodec.inputToProto[schedule.cadence],\n weekday:\n \"weekday\" in schedule\n ? AutoWithdrawWeekdayCodec.inputToProto[schedule.weekday]\n : undefined,\n minuteOfDay: \"minuteOfDay\" in schedule ? schedule.minuteOfDay : undefined,\n minuteOfHour: \"minuteOfHour\" in schedule ? schedule.minuteOfHour : undefined,\n dayOfMonth: \"dayOfMonth\" in schedule ? schedule.dayOfMonth : undefined,\n anchorDate: \"anchorDate\" in schedule ? schedule.anchorDate : undefined,\n })),\n);\n\nexport type AutoWithdrawScheduleInput = v.InferInput<typeof AutoWithdrawScheduleInputSchema>;\n\n/**\n * One asset paid in kind to one whitelisted external-chain address. `minAmount` and\n * `maxAmount` are decimal asset amounts (up to 18 decimals); a run pays the balance up to\n * `maxAmount` once it reaches `minAmount`.\n */\nconst AutoWithdrawDestinationInputSchema = v.pipe(\n v.strictObject({\n assetId: PositiveUint32InputSchema,\n destinationChainId: v.pipe(\n v.number(),\n v.integer(),\n v.gtValue(0),\n v.maxValue(Number.MAX_SAFE_INTEGER),\n ),\n destinationAddress: v.pipe(v.string(), v.trim(), v.minLength(1)),\n minAmount: v.string(),\n maxAmount: v.string(),\n }),\n v.transform(({ minAmount, maxAmount, destinationChainId, ...destination }) => {\n const min = decimalToE18(\"minAmount\", minAmount);\n const max = decimalToE18(\"maxAmount\", maxAmount);\n if (max === 0n || max < min) {\n throw new ValidationError(\n `maxAmount must be greater than 0 and at least minAmount: ${maxAmount}`,\n );\n }\n return {\n ...destination,\n destinationChainId: BigInt(destinationChainId),\n minAmountE18: toU128(min),\n maxAmountE18: toU128(max),\n };\n }),\n);\n\nexport type AutoWithdrawDestinationInput = v.InferInput<typeof AutoWithdrawDestinationInputSchema>;\n\nexport const SetAutoWithdrawRuleInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** The version this change replaces: 0 when the account has no rule yet. */\n expectedVersion: Uint32InputSchema,\n schedule: AutoWithdrawScheduleInputSchema,\n destinations: v.pipe(\n v.array(AutoWithdrawDestinationInputSchema),\n v.minLength(1, \"At least one destination is required.\"),\n v.maxLength(32, \"At most 32 destinations are allowed.\"),\n v.check(\n (destinations) =>\n new Set(destinations.map((d) => d.assetId)).size === destinations.length,\n \"At most one destination per asset is allowed.\",\n ),\n ),\n /** Least USD value one payout pays, as a decimal; omit or null for no USD minimum. */\n minUsdValue: v.optional(v.nullable(v.string())),\n }),\n v.transform(({ account, minUsdValue, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n minUsdValueE18:\n minUsdValue == null ? undefined : toU128(decimalToE18(\"minUsdValue\", minUsdValue)),\n })),\n);\n\nexport type SetAutoWithdrawRuleInput = v.InferInput<typeof SetAutoWithdrawRuleInputSchema>;\n\nexport const SetAutoWithdrawRuleEnabledInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** The account's latest rule version. */\n expectedVersion: Uint32InputSchema,\n /** `false` pauses the rule; `true` resumes it. */\n enabled: v.boolean(),\n }),\n v.transform(({ account, expectedVersion, enabled }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n expectedVersion,\n enabled,\n })),\n);\n\nexport type SetAutoWithdrawRuleEnabledInput = v.InferInput<\n typeof SetAutoWithdrawRuleEnabledInputSchema\n>;\n\n/** `limit` is 0 through 100; 0 or omitted uses the server default of 20. */\nexport const ListAutoWithdrawRunsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100)), 0),\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ListAutoWithdrawRunsInput = v.InferInput<typeof ListAutoWithdrawRunsInputSchema>;\n\ntype ScheduleShape<Weekday> =\n | { cadence: \"hourly\"; minuteOfHour: number }\n | { cadence: \"daily\"; minuteOfDay: number }\n | { cadence: \"weekly\"; weekday: Weekday; minuteOfDay: number }\n | { cadence: \"biweekly\"; weekday: Weekday; minuteOfDay: number; anchorDate: string }\n | { cadence: \"monthly\"; dayOfMonth: number; minuteOfDay: number };\n\n/** A decoded schedule. A cadence this SDK build does not know decodes as `\"unspecified\"`. */\nexport type AutoWithdrawSchedule =\n | ScheduleShape<DecodedEnum<AutoWithdrawWeekday>>\n | { cadence: \"unspecified\" };\n\nconst AutoWithdrawScheduleSchema = v.pipe(\n v.object({\n cadence: v.optional(v.number(), 0),\n weekday: v.optional(v.number(), 0),\n minuteOfDay: v.optional(v.number(), 0),\n minuteOfHour: v.optional(v.number(), 0),\n dayOfMonth: v.optional(v.number(), 0),\n anchorDate: v.optional(v.string(), \"\"),\n }),\n v.transform((s): AutoWithdrawSchedule => {\n const weekday = enumLabel(AutoWithdrawWeekdayCodec.protoToOutput, s.weekday);\n const { minuteOfDay } = s;\n switch (s.cadence) {\n case Proto.AutoWithdrawCadence.HOURLY:\n return { cadence: \"hourly\", minuteOfHour: s.minuteOfHour };\n case Proto.AutoWithdrawCadence.DAILY:\n return { cadence: \"daily\", minuteOfDay };\n case Proto.AutoWithdrawCadence.WEEKLY:\n return { cadence: \"weekly\", weekday, minuteOfDay };\n case Proto.AutoWithdrawCadence.BIWEEKLY:\n return { cadence: \"biweekly\", weekday, minuteOfDay, anchorDate: s.anchorDate };\n case Proto.AutoWithdrawCadence.MONTHLY:\n return { cadence: \"monthly\", dayOfMonth: s.dayOfMonth, minuteOfDay };\n default:\n return { cadence: \"unspecified\" };\n }\n }),\n);\n\nfunction reasonSchema<TReason extends string>() {\n return v.pipe(\n v.optional(v.string(), \"\"),\n v.transform((reason) => (reason ? (reason as TReason) : null)),\n );\n}\n\nconst AutoWithdrawDestinationSchema = v.pipe(\n v.object({\n assetId: v.number(),\n destinationChainId: v.bigint(),\n destinationAddress: v.string(),\n minAmountE18: v.optional(U128Schema),\n maxAmountE18: v.optional(U128Schema),\n minFloorE18: v.optional(U128Schema),\n }),\n v.transform(\n ({ minAmountE18, maxAmountE18, minFloorE18, destinationChainId, ...destination }) => ({\n ...destination,\n destinationChainId: Number(destinationChainId),\n minAmount: e18ToDecimal(minAmountE18),\n maxAmount: e18ToDecimal(maxAmountE18),\n minFloor: optionalE18ToDecimal(minFloorE18),\n }),\n ),\n);\n\n/**\n * `minFloor` is the least one payout to the destination can pay now (the route's withdrawal\n * minimum, above its current network fee); a new rule's `minAmount` must be at least this\n * floor. It follows the network fee, and is null when the route or fee is unknown: show no\n * floor then, not zero.\n */\nexport type AutoWithdrawDestination = v.InferOutput<typeof AutoWithdrawDestinationSchema>;\n\nconst AutoWithdrawPauseSchema = v.object({\n assetId: v.number(),\n reason: v.pipe(\n v.string(),\n v.transform((reason) => reason as AutoWithdrawPauseReason),\n ),\n pausedAt: TimestampMsSchema,\n});\n\nexport type AutoWithdrawPause = v.InferOutput<typeof AutoWithdrawPauseSchema>;\n\nexport const AutoWithdrawRuleSchema = v.pipe(\n v.object({\n subaccountId: v.optional(PublicIdOrEmptySchema, 0n),\n version: v.number(),\n enabled: v.boolean(),\n schedule: v.optional(AutoWithdrawScheduleSchema),\n destinations: v.array(AutoWithdrawDestinationSchema),\n createdAt: TimestampMsSchema,\n pause: v.optional(AutoWithdrawPauseSchema),\n minUsdValueE18: v.optional(U128Schema),\n createdByAccountId: v.optional(PublicIdOrEmptySchema, 0n),\n }),\n v.transform(({ schedule, pause, minUsdValueE18, ...rule }) => ({\n ...rule,\n schedule: schedule ?? ({ cadence: \"unspecified\" } as AutoWithdrawSchedule),\n pause: pause ?? null,\n minUsdValue: fromU128(minUsdValueE18) === 0n ? null : e18ToDecimal(minUsdValueE18),\n })),\n);\n\n/**\n * One version of an account's rule. `subaccountId` is the public subaccount ID, `\"\"` for the\n * root account; `createdByAccountId` is the public account ID of whoever created the version.\n * Times are epoch milliseconds. `minUsdValue` is null when the rule has no USD minimum. A paused\n * version (`enabled: false`) keeps its schedule and destinations. `pause` is set when the rule\n * paused itself; resuming it or setting a new rule clears it. The rule runs only while\n * `enabled` is true and `pause` is null.\n */\nexport type AutoWithdrawRule = v.InferOutput<typeof AutoWithdrawRuleSchema>;\n\nconst AutoWithdrawStepSchema = v.pipe(\n v.object({\n assetId: v.number(),\n destinationChainId: v.bigint(),\n destinationAddress: v.string(),\n availableE18: v.optional(U128Schema),\n amountE18: v.optional(U128Schema),\n valueUsdE18: v.optional(U128Schema),\n networkFeeE18: v.optional(U128Schema),\n state: enumLabelSchema(AutoWithdrawStepStateCodec.protoToOutput),\n reason: reasonSchema<AutoWithdrawStepReason>(),\n intentId: v.optional(v.string(), \"\"),\n txHash: v.optional(v.string(), \"\"),\n }),\n v.transform(\n ({\n availableE18,\n amountE18,\n valueUsdE18,\n networkFeeE18,\n destinationChainId,\n intentId,\n txHash,\n ...step\n }) => ({\n ...step,\n destinationChainId: Number(destinationChainId),\n available: e18ToDecimal(availableE18),\n amount: e18ToDecimal(amountE18),\n valueUsd: valueUsdE18 ? e18ToDecimal(valueUsdE18) : null,\n networkFee: optionalE18ToDecimal(networkFeeE18),\n intentId: intentId || null,\n txHash: txHash || null,\n }),\n ),\n);\n\n/**\n * One asset's payout in a run. `available`, `amount` and `valueUsd` are decimal strings;\n * `valueUsd` is null when the rule has no USD minimum or no price was available. `networkFee`\n * is the fee charged on the withdrawal: once completed it was taken out of `amount`; once\n * rejected or failed it is the fee kept, not refunded. It is null until the step is final, when\n * the step never reached the withdrawal, or when the fee was not reported.\n */\nexport type AutoWithdrawStep = v.InferOutput<typeof AutoWithdrawStepSchema>;\n\nconst AutoWithdrawRunSchema = v.pipe(\n v.object({\n runSeq: BigIntStringSchema,\n ruleVersion: v.number(),\n scheduledFor: TimestampMsSchema,\n state: enumLabelSchema(AutoWithdrawRunStateCodec.protoToOutput),\n reason: reasonSchema<AutoWithdrawRunReason>(),\n steps: v.array(AutoWithdrawStepSchema),\n createdAt: TimestampMsSchema,\n finishedAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ finishedAt, ...run }) => ({ ...run, finishedAt: finishedAt ?? null })),\n);\n\n/** One scheduled run. Times are epoch milliseconds; `finishedAt` is null while in progress. */\nexport type AutoWithdrawRun = v.InferOutput<typeof AutoWithdrawRunSchema>;\n\nexport const ListAutoWithdrawRunsResultSchema = v.object({\n runs: v.array(AutoWithdrawRunSchema),\n nextPageToken: v.optional(v.string(), \"\"),\n});\n\n/** One page of runs, newest first. An empty `nextPageToken` means no more runs. */\nexport type ListAutoWithdrawRunsResult = v.InferOutput<typeof ListAutoWithdrawRunsResultSchema>;\n\nconst AutoWithdrawPreviewAssetSchema = v.pipe(\n v.object({\n assetId: v.number(),\n destinationChainId: v.optional(v.bigint(), 0n),\n destinationAddress: v.optional(v.string(), \"\"),\n availableE18: v.optional(U128Schema),\n payableE18: v.optional(U128Schema),\n heldBackE18: v.optional(U128Schema),\n holdReason: reasonSchema<AutoWithdrawHoldReason>(),\n minimumE18: v.optional(U128Schema),\n valueUsdE18: v.optional(U128Schema),\n pricedAt: OptionalTimestampMsSchema,\n networkFeeE18: v.optional(U128Schema),\n networkFeeSampledAt: OptionalTimestampMsSchema,\n payableFrom: OptionalTimestampMsSchema,\n }),\n v.transform((asset) => ({\n assetId: asset.assetId,\n destinationChainId:\n asset.destinationChainId === 0n ? null : Number(asset.destinationChainId),\n destinationAddress: asset.destinationAddress || null,\n available: e18ToDecimal(asset.availableE18),\n payable: e18ToDecimal(asset.payableE18),\n heldBack: e18ToDecimal(asset.heldBackE18),\n holdReason: asset.holdReason,\n minimum: optionalE18ToDecimal(asset.minimumE18),\n valueUsd: optionalE18ToDecimal(asset.valueUsdE18),\n pricedAt: asset.pricedAt ?? null,\n networkFee: optionalE18ToDecimal(asset.networkFeeE18),\n networkFeeSampledAt: asset.networkFeeSampledAt ?? null,\n payableFrom: asset.payableFrom ?? null,\n })),\n);\n\n/**\n * What the next run would do with one asset, sized from the balance now. Amounts are decimal\n * strings; `heldBack` is `available` minus `payable`, and `holdReason` says why it stays (null\n * when the whole balance pays). `destinationChainId` and `destinationAddress` are null for an\n * asset the rule pays nowhere. `minimum`, `valueUsd`, `networkFee` and their times are null\n * when unknown, never zero. `payableFrom` is set only while a broker vault's destination cools\n * down. Times are epoch milliseconds.\n */\nexport type AutoWithdrawPreviewAsset = v.InferOutput<typeof AutoWithdrawPreviewAssetSchema>;\n\nexport const AutoWithdrawPreviewSchema = v.pipe(\n v.object({\n status: enumLabelSchema(AutoWithdrawPreviewStatusCodec.protoToOutput),\n nextRunAt: OptionalTimestampMsSchema,\n ruleVersion: v.optional(v.number(), 0),\n pause: v.optional(AutoWithdrawPauseSchema),\n minUsdValueE18: v.optional(U128Schema),\n assets: v.array(AutoWithdrawPreviewAssetSchema),\n computedAt: TimestampMsSchema,\n }),\n v.transform(({ nextRunAt, pause, minUsdValueE18, ...preview }) => ({\n ...preview,\n nextRunAt: nextRunAt ?? null,\n pause: pause ?? null,\n minUsdValue: fromU128(minUsdValueE18) === 0n ? null : e18ToDecimal(minUsdValueE18),\n })),\n);\n\n/**\n * The account's next run as it would go now; balances, prices and fees can change before\n * `nextRunAt`. `nextRunAt` is null without a rule or while it is paused; `ruleVersion` is 0\n * without a rule. `pause` is set only when the rule paused itself. `minUsdValue` is null when\n * there is no USD minimum. Times are epoch milliseconds.\n */\nexport type AutoWithdrawPreview = v.InferOutput<typeof AutoWithdrawPreviewSchema>;\n"],"mappings":";;;;;;;;;;;;AAsCA,MAAM,YAAY,MAAM,QAAQ;;AAGhC,SAAS,aAAa,OAAe,OAAuB;CACxD,MAAM,SAAS,qBAAqB,OAAO,OAAA,EAAgB;CAC3D,IAAI,SAAS,UACT,MAAM,IAAI,gBAAgB,GAAG,MAAM,wCAAwC,OAAO;CAEtF,OAAO;AACX;AAEA,SAAS,aAAa,OAA6D;CAC/E,OAAO,sBAAsB,SAAS,KAAK,GAAA,EAAY;AAC3D;;AAGA,SAAS,qBAAqB,OAAoE;CAC9F,OAAO,QAAQ,aAAa,KAAK,IAAI;AACzC;AAEA,MAAM,2BAA2B,EAAE,aAAa,EAAE,GAAG,yBAAyB,CAAC;AAI/E,MAAa,gCAAgC,EAAE,KAC3C,0BACA,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,2BAA2B,OAAO,EAAE,EAAE,CACxF;AAEA,MAAM,oBAAoB,EAAE,KACxB,EAAE,OAAO,GACT,EAAE,QAAQ,GACV,EAAE,SAAS,CAAC,GACZ,EAAE,SAAS,mBAAmB,CAClC;AACA,MAAM,oBAAoB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,S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AAE,SAAS,UAAU;CACrC,QAAQ,EAAE,MAAM,8BAA8B;CAC9C,YAAY;AAChB,CAAC,GACD,EAAE,WAAW,EAAE,WAAW,OAAO,gBAAgB,GAAG,eAAe;CAC/D,GAAG;CACH,WAAW,aAAa;CACxB,OAAO,SAAS;CAChB,aAAa,SAAS,cAAc,MAAM,KAAK,OAAO,aAAa,cAAc;AACrF,EAAE,CACN"}
1
+ {"version":3,"file":"auto-withdraw.schemas.js","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport * as Proto from \"../../gen/chain/withdraw/v1/auto_withdraw_pb.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport {\n decimalInputToScaled,\n E18_SCALE,\n scaledToDecimalOutput,\n} from \"../../shared/decimal-surface.js\";\nimport { ValidationError } from \"../../shared/errors.js\";\nimport { enumLabel, enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n BigIntStringSchema,\n OptionalTimestampMsSchema,\n PublicIdOrEmptySchema,\n TimestampMsSchema,\n U128Schema,\n} from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport { fromU128, toU128 } from \"../../utils/u128.js\";\nimport { PositiveUint32InputSchema } from \"../shared.js\";\nimport {\n AUTO_WITHDRAW_WEEKDAY_VALUES,\n AutoWithdrawCadenceCodec,\n AutoWithdrawPreviewStatusCodec,\n AutoWithdrawRunStateCodec,\n AutoWithdrawStepStateCodec,\n AutoWithdrawWeekdayCodec,\n type AutoWithdrawHoldReason,\n type AutoWithdrawPauseReason,\n type AutoWithdrawRunReason,\n type AutoWithdrawStepReason,\n type AutoWithdrawWeekday,\n} from \"./auto-withdraw.codecs.js\";\n\nconst U128_MAX = (1n << 128n) - 1n;\n\n/** Decimal string → 18-decimal U128 integer, exact; throws `ValidationError`. */\nfunction decimalToE18(field: string, value: string): bigint {\n const scaled = decimalInputToScaled(field, value, E18_SCALE);\n if (scaled > U128_MAX) {\n throw new ValidationError(`${field} exceeds the maximum supported value: ${value}`);\n }\n return scaled;\n}\n\nfunction e18ToDecimal(value: v.InferOutput<typeof U128Schema> | undefined): string {\n return scaledToDecimalOutput(fromU128(value), E18_SCALE);\n}\n\n/** Unset means unknown, never zero. */\nfunction optionalE18ToDecimal(value: v.InferOutput<typeof U128Schema> | undefined): string | null {\n return value ? e18ToDecimal(value) : null;\n}\n\nconst AccountScopedInputSchema = v.strictObject({ ...AccountScopeInputEntries });\n\nexport type AutoWithdrawScopedInput = v.InferInput<typeof AccountScopedInputSchema>;\n\nexport const AutoWithdrawScopedInputSchema = v.pipe(\n AccountScopedInputSchema,\n v.transform(({ account }) => ({ subaccountId: accountScopeToSubaccountId(account) })),\n);\n\nconst Uint32InputSchema = v.pipe(\n v.number(),\n v.integer(),\n v.minValue(0),\n v.maxValue(PROTOBUF_UINT32_MAX),\n);\nconst MinuteOfDaySchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(1439));\nconst MinuteOfHourSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(59));\nconst DayOfMonthSchema = v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(31));\nconst WeekdaySchema = v.picklist(AUTO_WITHDRAW_WEEKDAY_VALUES);\nconst AnchorDateSchema = v.pipe(\n v.string(),\n v.trim(),\n v.isoDate(\"anchorDate must be a UTC date, YYYY-MM-DD\"),\n v.check((date) => {\n const parsed = new Date(`${date}T00:00:00Z`);\n return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(date);\n }, \"anchorDate must be a real calendar date\"),\n);\n\n/**\n * A rule's UTC run slot. Each cadence takes only its own fields; any other field is rejected.\n * `minuteOfDay` is minutes after 00:00 UTC (0–1439), `minuteOfHour` 0–59, `dayOfMonth` 1–31\n * (a shorter month runs on its last day), and `anchorDate` is a UTC date in a week a biweekly\n * rule runs.\n */\nexport const AutoWithdrawScheduleInputSchema = v.pipe(\n v.variant(\"cadence\", [\n v.strictObject({ cadence: v.literal(\"hourly\"), minuteOfHour: MinuteOfHourSchema }),\n v.strictObject({ cadence: v.literal(\"daily\"), minuteOfDay: MinuteOfDaySchema }),\n v.strictObject({\n cadence: v.literal(\"weekly\"),\n weekday: WeekdaySchema,\n minuteOfDay: MinuteOfDaySchema,\n }),\n v.strictObject({\n cadence: v.literal(\"biweekly\"),\n weekday: WeekdaySchema,\n minuteOfDay: MinuteOfDaySchema,\n anchorDate: AnchorDateSchema,\n }),\n v.strictObject({\n cadence: v.literal(\"monthly\"),\n dayOfMonth: DayOfMonthSchema,\n minuteOfDay: MinuteOfDaySchema,\n }),\n ]),\n v.transform((schedule) => ({\n cadence: AutoWithdrawCadenceCodec.inputToProto[schedule.cadence],\n weekday:\n \"weekday\" in schedule\n ? AutoWithdrawWeekdayCodec.inputToProto[schedule.weekday]\n : undefined,\n minuteOfDay: \"minuteOfDay\" in schedule ? schedule.minuteOfDay : undefined,\n minuteOfHour: \"minuteOfHour\" in schedule ? schedule.minuteOfHour : undefined,\n dayOfMonth: \"dayOfMonth\" in schedule ? schedule.dayOfMonth : undefined,\n anchorDate: \"anchorDate\" in schedule ? schedule.anchorDate : undefined,\n })),\n);\n\nexport type AutoWithdrawScheduleInput = v.InferInput<typeof AutoWithdrawScheduleInputSchema>;\n\n/**\n * One asset paid in kind to one whitelisted external-chain address. `minAmount` and\n * `maxAmount` are decimal asset amounts (up to 18 decimals); a run pays the balance up to\n * `maxAmount` once it reaches `minAmount`.\n */\nconst AutoWithdrawDestinationInputSchema = v.pipe(\n v.strictObject({\n assetId: PositiveUint32InputSchema,\n /** Polyester chain ID of the network: a Zipper chain's `chainId`, not its `nativeChainId`. */\n destinationChainId: v.pipe(\n v.number(),\n v.integer(),\n v.gtValue(0),\n v.maxValue(Number.MAX_SAFE_INTEGER),\n ),\n destinationAddress: v.pipe(v.string(), v.trim(), v.minLength(1)),\n minAmount: v.string(),\n maxAmount: v.string(),\n }),\n v.transform(({ minAmount, maxAmount, destinationChainId, ...destination }) => {\n const min = decimalToE18(\"minAmount\", minAmount);\n const max = decimalToE18(\"maxAmount\", maxAmount);\n if (max === 0n || max < min) {\n throw new ValidationError(\n `maxAmount must be greater than 0 and at least minAmount: ${maxAmount}`,\n );\n }\n return {\n ...destination,\n destinationChainId: BigInt(destinationChainId),\n minAmountE18: toU128(min),\n maxAmountE18: toU128(max),\n };\n }),\n);\n\nexport type AutoWithdrawDestinationInput = v.InferInput<typeof AutoWithdrawDestinationInputSchema>;\n\nexport const SetAutoWithdrawRuleInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** The version this change replaces: 0 when the account has no rule yet. */\n expectedVersion: Uint32InputSchema,\n schedule: AutoWithdrawScheduleInputSchema,\n destinations: v.pipe(\n v.array(AutoWithdrawDestinationInputSchema),\n v.minLength(1, \"At least one destination is required.\"),\n v.maxLength(32, \"At most 32 destinations are allowed.\"),\n v.check(\n (destinations) =>\n new Set(destinations.map((d) => d.assetId)).size === destinations.length,\n \"At most one destination per asset is allowed.\",\n ),\n ),\n /** Least USD value one payout pays, as a decimal; omit or null for no USD minimum. */\n minUsdValue: v.optional(v.nullable(v.string())),\n }),\n v.transform(({ account, minUsdValue, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n minUsdValueE18:\n minUsdValue == null ? undefined : toU128(decimalToE18(\"minUsdValue\", minUsdValue)),\n })),\n);\n\nexport type SetAutoWithdrawRuleInput = v.InferInput<typeof SetAutoWithdrawRuleInputSchema>;\n\nexport const SetAutoWithdrawRuleEnabledInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** The account's latest rule version. */\n expectedVersion: Uint32InputSchema,\n /** `false` pauses the rule; `true` resumes it. */\n enabled: v.boolean(),\n }),\n v.transform(({ account, expectedVersion, enabled }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n expectedVersion,\n enabled,\n })),\n);\n\nexport type SetAutoWithdrawRuleEnabledInput = v.InferInput<\n typeof SetAutoWithdrawRuleEnabledInputSchema\n>;\n\n/** `limit` is 0 through 100; 0 or omitted uses the server default of 20. */\nexport const ListAutoWithdrawRunsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100)), 0),\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ListAutoWithdrawRunsInput = v.InferInput<typeof ListAutoWithdrawRunsInputSchema>;\n\ntype ScheduleShape<Weekday> =\n | { cadence: \"hourly\"; minuteOfHour: number }\n | { cadence: \"daily\"; minuteOfDay: number }\n | { cadence: \"weekly\"; weekday: Weekday; minuteOfDay: number }\n | { cadence: \"biweekly\"; weekday: Weekday; minuteOfDay: number; anchorDate: string }\n | { cadence: \"monthly\"; dayOfMonth: number; minuteOfDay: number };\n\n/** A decoded schedule. A cadence this SDK build does not know decodes as `\"unspecified\"`. */\nexport type AutoWithdrawSchedule =\n | ScheduleShape<DecodedEnum<AutoWithdrawWeekday>>\n | { cadence: \"unspecified\" };\n\nconst AutoWithdrawScheduleSchema = v.pipe(\n v.object({\n cadence: v.optional(v.number(), 0),\n weekday: v.optional(v.number(), 0),\n minuteOfDay: v.optional(v.number(), 0),\n minuteOfHour: v.optional(v.number(), 0),\n dayOfMonth: v.optional(v.number(), 0),\n anchorDate: v.optional(v.string(), \"\"),\n }),\n v.transform((s): AutoWithdrawSchedule => {\n const weekday = enumLabel(AutoWithdrawWeekdayCodec.protoToOutput, s.weekday);\n const { minuteOfDay } = s;\n switch (s.cadence) {\n case Proto.AutoWithdrawCadence.HOURLY:\n return { cadence: \"hourly\", minuteOfHour: s.minuteOfHour };\n case Proto.AutoWithdrawCadence.DAILY:\n return { cadence: \"daily\", minuteOfDay };\n case Proto.AutoWithdrawCadence.WEEKLY:\n return { cadence: \"weekly\", weekday, minuteOfDay };\n case Proto.AutoWithdrawCadence.BIWEEKLY:\n return { cadence: \"biweekly\", weekday, minuteOfDay, anchorDate: s.anchorDate };\n case Proto.AutoWithdrawCadence.MONTHLY:\n return { cadence: \"monthly\", dayOfMonth: s.dayOfMonth, minuteOfDay };\n default:\n return { cadence: \"unspecified\" };\n }\n }),\n);\n\nfunction reasonSchema<TReason extends string>() {\n return v.pipe(\n v.optional(v.string(), \"\"),\n v.transform((reason) => (reason ? (reason as TReason) : null)),\n );\n}\n\nconst AutoWithdrawDestinationSchema = v.pipe(\n v.object({\n assetId: v.number(),\n destinationChainId: v.bigint(),\n destinationAddress: v.string(),\n minAmountE18: v.optional(U128Schema),\n maxAmountE18: v.optional(U128Schema),\n minFloorE18: v.optional(U128Schema),\n }),\n v.transform(\n ({ minAmountE18, maxAmountE18, minFloorE18, destinationChainId, ...destination }) => ({\n ...destination,\n destinationChainId: Number(destinationChainId),\n minAmount: e18ToDecimal(minAmountE18),\n maxAmount: e18ToDecimal(maxAmountE18),\n minFloor: optionalE18ToDecimal(minFloorE18),\n }),\n ),\n);\n\n/**\n * `minFloor` is the least one payout to the destination can pay now (the route's withdrawal\n * minimum, above its current network fee); a new rule's `minAmount` must be at least this\n * floor. It follows the network fee, and is null when the route or fee is unknown: show no\n * floor then, not zero.\n */\nexport type AutoWithdrawDestination = v.InferOutput<typeof AutoWithdrawDestinationSchema>;\n\nconst AutoWithdrawPauseSchema = v.object({\n assetId: v.number(),\n reason: v.pipe(\n v.string(),\n v.transform((reason) => reason as AutoWithdrawPauseReason),\n ),\n pausedAt: TimestampMsSchema,\n});\n\nexport type AutoWithdrawPause = v.InferOutput<typeof AutoWithdrawPauseSchema>;\n\nexport const AutoWithdrawRuleSchema = v.pipe(\n v.object({\n subaccountId: v.optional(PublicIdOrEmptySchema, 0n),\n version: v.number(),\n enabled: v.boolean(),\n schedule: v.optional(AutoWithdrawScheduleSchema),\n destinations: v.array(AutoWithdrawDestinationSchema),\n createdAt: TimestampMsSchema,\n pause: v.optional(AutoWithdrawPauseSchema),\n minUsdValueE18: v.optional(U128Schema),\n createdByAccountId: v.optional(PublicIdOrEmptySchema, 0n),\n }),\n v.transform(({ schedule, pause, minUsdValueE18, ...rule }) => ({\n ...rule,\n schedule: schedule ?? ({ cadence: \"unspecified\" } as AutoWithdrawSchedule),\n pause: pause ?? null,\n minUsdValue: fromU128(minUsdValueE18) === 0n ? null : e18ToDecimal(minUsdValueE18),\n })),\n);\n\n/**\n * One version of an account's rule. `subaccountId` is the public subaccount ID, `\"\"` for the\n * root account; `createdByAccountId` is the public account ID of whoever created the version.\n * Times are epoch milliseconds. `minUsdValue` is null when the rule has no USD minimum. A paused\n * version (`enabled: false`) keeps its schedule and destinations. `pause` is set when the rule\n * paused itself; resuming it or setting a new rule clears it. The rule runs only while\n * `enabled` is true and `pause` is null.\n */\nexport type AutoWithdrawRule = v.InferOutput<typeof AutoWithdrawRuleSchema>;\n\nconst AutoWithdrawStepSchema = v.pipe(\n v.object({\n assetId: v.number(),\n destinationChainId: v.bigint(),\n destinationAddress: v.string(),\n availableE18: v.optional(U128Schema),\n amountE18: v.optional(U128Schema),\n valueUsdE18: v.optional(U128Schema),\n networkFeeE18: v.optional(U128Schema),\n state: enumLabelSchema(AutoWithdrawStepStateCodec.protoToOutput),\n reason: reasonSchema<AutoWithdrawStepReason>(),\n intentId: v.optional(v.string(), \"\"),\n txHash: v.optional(v.string(), \"\"),\n }),\n v.transform(\n ({\n availableE18,\n amountE18,\n valueUsdE18,\n networkFeeE18,\n destinationChainId,\n intentId,\n txHash,\n ...step\n }) => ({\n ...step,\n destinationChainId: Number(destinationChainId),\n available: e18ToDecimal(availableE18),\n amount: e18ToDecimal(amountE18),\n valueUsd: valueUsdE18 ? e18ToDecimal(valueUsdE18) : null,\n networkFee: optionalE18ToDecimal(networkFeeE18),\n intentId: intentId || null,\n txHash: txHash || null,\n }),\n ),\n);\n\n/**\n * One asset's payout in a run. `available`, `amount` and `valueUsd` are decimal strings;\n * `valueUsd` is null when the rule has no USD minimum or no price was available. `networkFee`\n * is the fee charged on the withdrawal: once completed it was taken out of `amount`; once\n * rejected or failed it is the fee kept, not refunded. It is null until the step is final, when\n * the step never reached the withdrawal, or when the fee was not reported.\n */\nexport type AutoWithdrawStep = v.InferOutput<typeof AutoWithdrawStepSchema>;\n\nconst AutoWithdrawRunSchema = v.pipe(\n v.object({\n runSeq: BigIntStringSchema,\n ruleVersion: v.number(),\n scheduledFor: TimestampMsSchema,\n state: enumLabelSchema(AutoWithdrawRunStateCodec.protoToOutput),\n reason: reasonSchema<AutoWithdrawRunReason>(),\n steps: v.array(AutoWithdrawStepSchema),\n createdAt: TimestampMsSchema,\n finishedAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ finishedAt, ...run }) => ({ ...run, finishedAt: finishedAt ?? null })),\n);\n\n/** One scheduled run. Times are epoch milliseconds; `finishedAt` is null while in progress. */\nexport type AutoWithdrawRun = v.InferOutput<typeof AutoWithdrawRunSchema>;\n\nexport const ListAutoWithdrawRunsResultSchema = v.object({\n runs: v.array(AutoWithdrawRunSchema),\n nextPageToken: v.optional(v.string(), \"\"),\n});\n\n/** One page of runs, newest first. An empty `nextPageToken` means no more runs. */\nexport type ListAutoWithdrawRunsResult = v.InferOutput<typeof ListAutoWithdrawRunsResultSchema>;\n\nconst AutoWithdrawPreviewAssetSchema = v.pipe(\n v.object({\n assetId: v.number(),\n destinationChainId: v.optional(v.bigint(), 0n),\n destinationAddress: v.optional(v.string(), \"\"),\n availableE18: v.optional(U128Schema),\n payableE18: v.optional(U128Schema),\n heldBackE18: v.optional(U128Schema),\n holdReason: reasonSchema<AutoWithdrawHoldReason>(),\n minimumE18: v.optional(U128Schema),\n valueUsdE18: v.optional(U128Schema),\n pricedAt: OptionalTimestampMsSchema,\n networkFeeE18: v.optional(U128Schema),\n networkFeeSampledAt: OptionalTimestampMsSchema,\n payableFrom: OptionalTimestampMsSchema,\n }),\n v.transform((asset) => ({\n assetId: asset.assetId,\n destinationChainId:\n asset.destinationChainId === 0n ? null : Number(asset.destinationChainId),\n destinationAddress: asset.destinationAddress || null,\n available: e18ToDecimal(asset.availableE18),\n payable: e18ToDecimal(asset.payableE18),\n heldBack: e18ToDecimal(asset.heldBackE18),\n holdReason: asset.holdReason,\n minimum: optionalE18ToDecimal(asset.minimumE18),\n valueUsd: optionalE18ToDecimal(asset.valueUsdE18),\n pricedAt: asset.pricedAt ?? null,\n networkFee: optionalE18ToDecimal(asset.networkFeeE18),\n networkFeeSampledAt: asset.networkFeeSampledAt ?? null,\n payableFrom: asset.payableFrom ?? null,\n })),\n);\n\n/**\n * What the next run would do with one asset, sized from the balance now. Amounts are decimal\n * strings; `heldBack` is `available` minus `payable`, and `holdReason` says why it stays (null\n * when the whole balance pays). `destinationChainId` and `destinationAddress` are null for an\n * asset the rule pays nowhere. `minimum`, `valueUsd`, `networkFee` and their times are null\n * when unknown, never zero. `payableFrom` is set only while a broker vault's destination cools\n * down. Times are epoch milliseconds.\n */\nexport type AutoWithdrawPreviewAsset = v.InferOutput<typeof AutoWithdrawPreviewAssetSchema>;\n\nexport const AutoWithdrawPreviewSchema = v.pipe(\n v.object({\n status: enumLabelSchema(AutoWithdrawPreviewStatusCodec.protoToOutput),\n nextRunAt: OptionalTimestampMsSchema,\n ruleVersion: v.optional(v.number(), 0),\n pause: v.optional(AutoWithdrawPauseSchema),\n minUsdValueE18: v.optional(U128Schema),\n assets: v.array(AutoWithdrawPreviewAssetSchema),\n computedAt: TimestampMsSchema,\n }),\n v.transform(({ nextRunAt, pause, minUsdValueE18, ...preview }) => ({\n ...preview,\n nextRunAt: nextRunAt ?? null,\n pause: pause ?? null,\n minUsdValue: fromU128(minUsdValueE18) === 0n ? null : e18ToDecimal(minUsdValueE18),\n })),\n);\n\n/**\n * The account's next run as it would go now; balances, prices and fees can change before\n * `nextRunAt`. `nextRunAt` is null without a rule or while it is paused; `ruleVersion` is 0\n * without a rule. `pause` is set only when the rule paused itself. `minUsdValue` is null when\n * there is no USD minimum. Times are epoch milliseconds.\n */\nexport type AutoWithdrawPreview = v.InferOutput<typeof AutoWithdrawPreviewSchema>;\n"],"mappings":";;;;;;;;;;;;AAsCA,MAAM,YAAY,MAAM,QAAQ;;AAGhC,SAAS,aAAa,OAAe,OAAuB;CACxD,MAAM,SAAS,qBAAqB,OAAO,OAAA,EAAgB;CAC3D,IAAI,SAAS,UACT,MAAM,IAAI,gBAAgB,GAAG,MAAM,wCAAwC,OAAO;CAEtF,OAAO;AACX;AAEA,SAAS,aAAa,OAA6D;CAC/E,OAAO,sBAAsB,SAAS,KAAK,GAAA,EAAY;AAC3D;;AAGA,SAAS,qBAAqB,OAAoE;CAC9F,OAAO,QAAQ,aAAa,KAAK,IAAI;AACzC;AAEA,MAAM,2BAA2B,EAAE,aAAa,EAAE,GAAG,yBAAyB,CAAC;AAI/E,MAAa,gCAAgC,EAAE,KAC3C,0BACA,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,2BAA2B,OAAO,EAAE,EAAE,CACxF;AAEA,MAAM,oBAAoB,EAAE,KACxB,EAAE,OAAO,GACT,EAAE,QAAQ,GACV,EAAE,SAAS,CAAC,GACZ,EAAE,SAAS,mBAAmB,CAClC;AACA,MAAM,oBAAoB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC;AACzF,MAAM,qBAAqB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC;AACxF,MAAM,mBAAmB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC;AACtF,MAAM,gBAAgB,EAAE,SAAS,4BAA4B;AAC7D,MAAM,mBAAmB,EAAE,KACvB,EAAE,OAAO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E;CAC7C,cAAc,EAAE,SAAS,UAAU;CACnC,YAAY,EAAE,SAAS,UAAU;CACjC,aAAa,EAAE,SAAS,UAAU;CAClC,YAAY,aAAqC;CACjD,YAAY,EAAE,SAAS,UAAU;CACjC,aAAa,EAAE,SAAS,UAAU;CAClC,UAAU;CACV,eAAe,EAAE,SAAS,UAAU;CACpC,qBAAqB;CACrB,aAAa;AACjB,CAAC,GACD,EAAE,WAAW,WAAW;CACpB,SAAS,MAAM;CACf,oBACI,MAAM,uBAAuB,KAAK,OAAO,OAAO,MAAM,kBAAkB;CAC5E,oBAAoB,MAAM,sBAAsB;CAChD,WAAW,aAAa,MAAM,YAAY;CAC1C,SAAS,aAAa,MAAM,UAAU;CACtC,UAAU,aAAa,MAAM,WAAW;CACxC,YAAY,MAAM;CAClB,SAAS,qBAAqB,MAAM,UAAU;CAC9C,UAAU,qBAAqB,MAAM,WAAW;CAChD,UAAU,MAAM,YAAY;CAC5B,YAAY,qBAAqB,MAAM,aAAa;CACpD,qBAAqB,MAAM,uBAAuB;CAClD,aAAa,MAAM,eAAe;AACtC,EAAE,CACN;AAYA,MAAa,4BAA4B,EAAE,KACvC,EAAE,OAAO;CACL,QAAQ,gBAAgB,+BAA+B,aAAa;CACpE,WAAW;CACX,aAAa,EAAE,SAAS,EAAE,OAAO,GAAG,CAAC;CACrC,OAAO,EAAE,SAAS,uBAAuB;CACzC,gBAAgB,EAAE,SAAS,UAAU;CACrC,QAAQ,EAAE,MAAM,8BAA8B;CAC9C,YAAY;AAChB,CAAC,GACD,EAAE,WAAW,EAAE,WAAW,OAAO,gBAAgB,GAAG,eAAe;CAC/D,GAAG;CACH,WAAW,aAAa;CACxB,OAAO,SAAS;CAChB,aAAa,SAAS,cAAc,MAAM,KAAK,OAAO,aAAa,cAAc;AACrF,EAAE,CACN"}
@@ -6,7 +6,7 @@ import { PolyesterRealtime } from "../../realtime/types.js";
6
6
  import "../../realtime/index.js";
7
7
  import { BaseSubscribeInput } from "../../shared/types.js";
8
8
  import { SdkScales } from "../../shared/decimal-surface.js";
9
- import { BalanceHistoryInput, BalanceHistoryResponse, EquityHistoryInput, EquityHistoryResponse, ExportStatementInput, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryResponse, PortfolioEquitySnapshotResponse, Statement, StatementPage } from "./balances.schemas.js";
9
+ import { BalanceHistoryInput, BalanceHistoryResponse, EquityHistoryInput, EquityHistoryResponse, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryResponse, PortfolioEquitySnapshotResponse } from "./balances.schemas.js";
10
10
  //#region src/services/balances/balances.d.ts
11
11
  interface SubscribeBalancesInput extends BaseSubscribeInput<LedgerBalance> {
12
12
  accountId: string;
@@ -37,18 +37,6 @@ declare class BalancesService {
37
37
  * Returns current root portfolio equity grouped by logical account and asset.
38
38
  */
39
39
  getPortfolioEquitySnapshot(options?: PolyesterRequestOptions): Promise<PortfolioEquitySnapshotResponse>;
40
- /**
41
- * Returns one page of the resolved account's statement as CSV: every balance movement in the
42
- * period, oldest first, with its fee and the balance after it. A page holds at most 2000
43
- * movements. API keys need `read-statements`. Use `exportStatementCsv` for the whole period.
44
- */
45
- exportStatement(input: ExportStatementInput, options?: PolyesterRequestOptions): Promise<StatementPage>;
46
- /**
47
- * Follows `nextPageToken` from the first page and returns the whole statement CSV, header
48
- * row first, with `completeThrough`; when it is before `endTime` the statement is partial.
49
- * The account is resolved once, so every page reads the same account.
50
- */
51
- exportStatementCsv(input: Omit<ExportStatementInput, "pageToken">, options?: PolyesterRequestOptions): Promise<Statement>;
52
40
  /**
53
41
  * Subscribes to private balance updates on private:ledger:balances:{accountId}:proto and emits every balance record as a decimal-string row. Records for assets unknown to the catalog route a CatalogLookupError to onError.
54
42
  */
@@ -1 +1 @@
1
- {"version":3,"file":"balances.d.ts","names":[],"sources":["../../../src/services/balances/balances.ts"],"mappings":";;;;;;;;;;UAuCU,+BAA+B,mBAAmB;EACxD;;;;;cAMS;;EAeL,YAAA,YAAY,mBACZ,UAAU,mBACV,UAAU,gCACV,QAAQ;;;;EAiBN,KACF,QAAO,oBACP,UAAU,0BACX,QAAQ;;;;EAgBL,kBACF,OAAO,qBACP,UAAU,0BACX,QAAQ;;;;EAWL,iBACF,OAAO,oBACP,UAAU,0BACX,QAAQ;;;;EAcL,0BACF,OAAO,6BACP,UAAU,0BACX,QAAQ;;;;EAaL,2BACF,UAAU,0BACX,QAAQ;;;;;;EAcL,gBACF,OAAO,sBACP,UAAU,0BACX,QAAQ;;;;;;EAeL,mBACF,OAAO,KAAK,oCACZ,UAAU,0BACX,QAAQ;;;;EAkBX,UAAU,OAAO"}
1
+ {"version":3,"file":"balances.d.ts","names":[],"sources":["../../../src/services/balances/balances.ts"],"mappings":";;;;;;;;;;UAkCU,+BAA+B,mBAAmB;EACxD;;;;;cAMS;;EAeL,YAAA,YAAY,mBACZ,UAAU,mBACV,UAAU,gCACV,QAAQ;;;;EAiBN,KACF,QAAO,oBACP,UAAU,0BACX,QAAQ;;;;EAgBL,kBACF,OAAO,qBACP,UAAU,0BACX,QAAQ;;;;EAWL,iBACF,OAAO,oBACP,UAAU,0BACX,QAAQ;;;;EAcL,0BACF,OAAO,6BACP,UAAU,0BACX,QAAQ;;;;EAaL,2BACF,UAAU,0BACX,QAAQ;;;;EAYX,UAAU,OAAO"}
@@ -1,10 +1,9 @@
1
1
  import { parse } from "../../shared/validation.js";
2
2
  import { toConnectCallOptions } from "../../shared/request-options.js";
3
- import { tsObjToMs } from "../../utils/time.js";
4
3
  import { AssetBalanceSchema, LedgerReadService } from "../../gen/ledger/read/v1/ledger_read_pb.js";
5
4
  import { resolveAccountScopedInput } from "../subaccount-resolver.js";
6
5
  import { accountScopeToSubaccountId } from "../../shared/account-scope.js";
7
- import { BalanceHistoryInputSchema, BalancesListInputSchema, EquityHistoryInputSchema, ExportStatementInputSchema, PortfolioEquityHistoryInputSchema, createBalanceHistoryResponseSchema, createEquityHistoryResponseSchema, createPortfolioEquityHistoryResponseSchema, createPortfolioEquitySnapshotResponseSchema, formatLedgerBalance } from "./balances.schemas.js";
6
+ import { BalanceHistoryInputSchema, BalancesListInputSchema, EquityHistoryInputSchema, PortfolioEquityHistoryInputSchema, createBalanceHistoryResponseSchema, createEquityHistoryResponseSchema, createPortfolioEquityHistoryResponseSchema, createPortfolioEquitySnapshotResponseSchema, formatLedgerBalance } from "./balances.schemas.js";
8
7
  import { connectReadyGatedProtoChannel } from "../../realtime/ready-gated-subscription.js";
9
8
  import { createClient } from "@connectrpc/connect";
10
9
  //#region src/services/balances/balances.ts
@@ -77,49 +76,6 @@ var BalancesService = class {
77
76
  return parse(this.#portfolioEquitySnapshotResponseSchema, res);
78
77
  }
79
78
  /**
80
- * Returns one page of the resolved account's statement as CSV: every balance movement in the
81
- * period, oldest first, with its fee and the balance after it. A page holds at most 2000
82
- * movements. API keys need `read-statements`. Use `exportStatementCsv` for the whole period.
83
- */
84
- async exportStatement(input, options) {
85
- const resolved = resolveAccountScopedInput(input, this.#resolver);
86
- const request = parse(ExportStatementInputSchema, resolved);
87
- const { csv, nextPageToken, completeThrough } = await this.#client.exportStatement(request, toConnectCallOptions(options));
88
- return {
89
- csv,
90
- nextPageToken,
91
- completeThrough: tsObjToMs(completeThrough)
92
- };
93
- }
94
- /**
95
- * Follows `nextPageToken` from the first page and returns the whole statement CSV, header
96
- * row first, with `completeThrough`; when it is before `endTime` the statement is partial.
97
- * The account is resolved once, so every page reads the same account.
98
- */
99
- async exportStatementCsv(input, options) {
100
- const resolved = resolveAccountScopedInput(input, this.#resolver);
101
- const pinned = {
102
- ...resolved,
103
- account: resolved.account ?? "main"
104
- };
105
- let csv = "";
106
- let pageToken = "";
107
- let completeThrough;
108
- do {
109
- const page = await this.exportStatement({
110
- ...pinned,
111
- pageToken
112
- }, options);
113
- csv += page.csv;
114
- completeThrough = page.completeThrough;
115
- pageToken = page.nextPageToken;
116
- } while (pageToken);
117
- return {
118
- csv,
119
- completeThrough
120
- };
121
- }
122
- /**
123
79
  * Subscribes to private balance updates on private:ledger:balances:{accountId}:proto and emits every balance record as a decimal-string row. Records for assets unknown to the catalog route a CatalogLookupError to onError.
124
80
  */
125
81
  subscribe(input) {
@@ -1 +1 @@
1
- {"version":3,"file":"balances.js","names":["#client","Proto.LedgerReadService","#realtime","#resolver","#scales","#balanceHistoryResponseSchema","#equityHistoryResponseSchema","#portfolioEquityHistoryResponseSchema","#portfolioEquitySnapshotResponseSchema","Proto.AssetBalanceSchema"],"sources":["../../../src/services/balances/balances.ts"],"sourcesContent":["import * as Proto from \"../../gen/ledger/read/v1/ledger_read_pb.js\";\nimport { createClient, type Client } from \"@connectrpc/connect\";\nimport { parse } from \"../../shared/validation.js\";\nimport type { PolyesterRealtime } from \"../../realtime/index.js\";\nimport { connectReadyGatedProtoChannel } from \"../../realtime/ready-gated-subscription.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { accountScopeToSubaccountId, type AccountScopedInput } from \"../../shared/account-scope.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport type { SdkScales } from \"../../shared/decimal-surface.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { tsObjToMs } from \"../../utils/time.js\";\nimport {\n BalanceHistoryInputSchema,\n BalancesListInputSchema,\n EquityHistoryInputSchema,\n ExportStatementInputSchema,\n PortfolioEquityHistoryInputSchema,\n createBalanceHistoryResponseSchema,\n createEquityHistoryResponseSchema,\n formatLedgerBalance,\n createPortfolioEquityHistoryResponseSchema,\n createPortfolioEquitySnapshotResponseSchema,\n type LedgerBalance,\n type BalanceHistoryInput,\n type BalanceHistoryResponse,\n type EquityHistoryInput,\n type EquityHistoryResponse,\n type ExportStatementInput,\n type Statement,\n type StatementPage,\n type PortfolioEquityHistoryInput,\n type PortfolioEquityHistoryResponse,\n type PortfolioEquitySnapshotResponse,\n} from \"./balances.schemas.js\";\n\ninterface SubscribeBalancesInput extends BaseSubscribeInput<LedgerBalance> {\n accountId: string;\n}\n\n/**\n * Reads and streams ledger balances plus balance and equity history for the authenticated account scope.\n */\nexport class BalancesService {\n #client: Client<typeof Proto.LedgerReadService>;\n #realtime: PolyesterRealtime;\n #resolver?: SubaccountResolver;\n #scales: SdkScales;\n #balanceHistoryResponseSchema: ReturnType<typeof createBalanceHistoryResponseSchema>;\n #equityHistoryResponseSchema: ReturnType<typeof createEquityHistoryResponseSchema>;\n #portfolioEquityHistoryResponseSchema: ReturnType<\n typeof createPortfolioEquityHistoryResponseSchema\n >;\n #portfolioEquitySnapshotResponseSchema: ReturnType<\n typeof createPortfolioEquitySnapshotResponseSchema\n >;\n\n constructor(\n transports: AuthApiTransports,\n realtime: PolyesterRealtime,\n resolver: SubaccountResolver | undefined,\n scales: SdkScales,\n ) {\n this.#client = createClient(Proto.LedgerReadService, transports.authApi);\n this.#realtime = realtime;\n this.#resolver = resolver;\n this.#scales = scales;\n this.#balanceHistoryResponseSchema = createBalanceHistoryResponseSchema();\n this.#equityHistoryResponseSchema = createEquityHistoryResponseSchema(scales);\n this.#portfolioEquityHistoryResponseSchema =\n createPortfolioEquityHistoryResponseSchema(scales);\n this.#portfolioEquitySnapshotResponseSchema =\n createPortfolioEquitySnapshotResponseSchema(scales);\n }\n\n /**\n * Returns current asset balances for the resolved root account or subaccount, including trading, funding, reserved, and available amounts as decimal strings.\n */\n async list(\n input: AccountScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<LedgerBalance[]> {\n await this.#scales.ready();\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const validated = parse(BalancesListInputSchema, resolved);\n const res = await this.#client.getBalances(\n {\n subaccountId: accountScopeToSubaccountId(validated.account),\n },\n toConnectCallOptions(options),\n );\n return res.balances.map(formatLedgerBalance);\n }\n\n /**\n * Returns columnar balance history for the resolved account scope over a selected range, optionally filtered by a non-negative integer ledger asset ID and account buckets. Ledger 0 or omission includes all assets.\n */\n async getBalanceHistory(\n input: BalanceHistoryInput,\n options?: PolyesterRequestOptions,\n ): Promise<BalanceHistoryResponse> {\n await this.#scales.ready();\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const validated = parse(BalanceHistoryInputSchema, resolved);\n const res = await this.#client.getBalanceHistory(validated, toConnectCallOptions(options));\n return parse(this.#balanceHistoryResponseSchema, res);\n }\n\n /**\n * Returns equity history series for the resolved account scope over a selected range, optionally grouped by account or asset and filtered by account buckets.\n */\n async getEquityHistory(\n input: EquityHistoryInput,\n options?: PolyesterRequestOptions,\n ): Promise<EquityHistoryResponse> {\n await this.#scales.ready();\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const validated = parse(EquityHistoryInputSchema, resolved);\n const res = await this.#client.getEquityHistorySeries(\n validated,\n toConnectCallOptions(options),\n );\n return parse(this.#equityHistoryResponseSchema, res);\n }\n\n /**\n * Returns root portfolio equity history grouped by the master account, leading owned subaccounts, and an optional remaining-subaccounts series.\n */\n async getPortfolioEquityHistory(\n input: PortfolioEquityHistoryInput,\n options?: PolyesterRequestOptions,\n ): Promise<PortfolioEquityHistoryResponse> {\n await this.#scales.ready();\n const validated = parse(PortfolioEquityHistoryInputSchema, input);\n const res = await this.#client.getPortfolioEquityHistorySeries(\n validated,\n toConnectCallOptions(options),\n );\n return parse(this.#portfolioEquityHistoryResponseSchema, res);\n }\n\n /**\n * Returns current root portfolio equity grouped by logical account and asset.\n */\n async getPortfolioEquitySnapshot(\n options?: PolyesterRequestOptions,\n ): Promise<PortfolioEquitySnapshotResponse> {\n await this.#scales.ready();\n const res = await this.#client.getPortfolioEquitySnapshot(\n {},\n toConnectCallOptions(options),\n );\n return parse(this.#portfolioEquitySnapshotResponseSchema, res);\n }\n\n /**\n * Returns one page of the resolved account's statement as CSV: every balance movement in the\n * period, oldest first, with its fee and the balance after it. A page holds at most 2000\n * movements. API keys need `read-statements`. Use `exportStatementCsv` for the whole period.\n */\n async exportStatement(\n input: ExportStatementInput,\n options?: PolyesterRequestOptions,\n ): Promise<StatementPage> {\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const request = parse(ExportStatementInputSchema, resolved);\n const { csv, nextPageToken, completeThrough } = await this.#client.exportStatement(\n request,\n toConnectCallOptions(options),\n );\n return { csv, nextPageToken, completeThrough: tsObjToMs(completeThrough) };\n }\n\n /**\n * Follows `nextPageToken` from the first page and returns the whole statement CSV, header\n * row first, with `completeThrough`; when it is before `endTime` the statement is partial.\n * The account is resolved once, so every page reads the same account.\n */\n async exportStatementCsv(\n input: Omit<ExportStatementInput, \"pageToken\">,\n options?: PolyesterRequestOptions,\n ): Promise<Statement> {\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const pinned = { ...resolved, account: resolved.account ?? (\"main\" as const) };\n let csv = \"\";\n let pageToken = \"\";\n let completeThrough: number | undefined;\n do {\n const page = await this.exportStatement({ ...pinned, pageToken }, options);\n csv += page.csv;\n completeThrough = page.completeThrough;\n pageToken = page.nextPageToken;\n } while (pageToken);\n return { csv, completeThrough };\n }\n\n /**\n * Subscribes to private balance updates on private:ledger:balances:{accountId}:proto and emits every balance record as a decimal-string row. Records for assets unknown to the catalog route a CatalogLookupError to onError.\n */\n subscribe(input: SubscribeBalancesInput): () => void {\n const channel = `private:ledger:balances:${input.accountId}:proto`;\n return connectReadyGatedProtoChannel(this.#realtime, {\n channel,\n schema: Proto.AssetBalanceSchema,\n ready: () => this.#scales.ready(),\n onPublication: (data) => {\n input.onEvent(formatLedgerBalance(data));\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA8CA,IAAa,kBAAb,MAA6B;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CAIA,YACI,YACA,UACA,UACA,QACF;EACE,KAAKA,UAAU,aAAaC,mBAAyB,WAAW,OAAO;EACvE,KAAKC,YAAY;EACjB,KAAKC,YAAY;EACjB,KAAKC,UAAU;EACf,KAAKC,gCAAgC,mCAAmC;EACxE,KAAKC,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EACzB,MAAM,MAAM,MAAM,KAAKJ,QAAQ,2BAC3B,CAAC,GACD,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,KAAKQ,wCAAwC,GAAG;CACjE;;;;;;CAOA,MAAM,gBACF,OACA,SACsB;EACtB,MAAM,WAAW,0BAA0B,OAAO,KAAKL,SAAS;EAChE,MAAM,UAAU,MAAM,4BAA4B,QAAQ;EAC1D,MAAM,EAAE,KAAK,eAAe,oBAAoB,MAAM,KAAKH,QAAQ,gBAC/D,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO;GAAE;GAAK;GAAe,iBAAiB,UAAU,eAAe;EAAE;CAC7E;;;;;;CAOA,MAAM,mBACF,OACA,SACkB;EAClB,MAAM,WAAW,0BAA0B,OAAO,KAAKG,SAAS;EAChE,MAAM,SAAS;GAAE,GAAG;GAAU,SAAS,SAAS,WAAY;EAAiB;EAC7E,IAAI,MAAM;EACV,IAAI,YAAY;EAChB,IAAI;EACJ,GAAG;GACC,MAAM,OAAO,MAAM,KAAK,gBAAgB;IAAE,GAAG;IAAQ;GAAU,GAAG,OAAO;GACzE,OAAO,KAAK;GACZ,kBAAkB,KAAK;GACvB,YAAY,KAAK;EACrB,SAAS;EACT,OAAO;GAAE;GAAK;EAAgB;CAClC;;;;CAKA,UAAU,OAA2C;EACjD,MAAM,UAAU,2BAA2B,MAAM,UAAU;EAC3D,OAAO,8BAA8B,KAAKD,WAAW;GACjD;GACA,QAAQO;GACR,aAAa,KAAKL,QAAQ,MAAM;GAChC,gBAAgB,SAAS;IACrB,MAAM,QAAQ,oBAAoB,IAAI,CAAC;GAC3C;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}
1
+ {"version":3,"file":"balances.js","names":["#client","Proto.LedgerReadService","#realtime","#resolver","#scales","#balanceHistoryResponseSchema","#equityHistoryResponseSchema","#portfolioEquityHistoryResponseSchema","#portfolioEquitySnapshotResponseSchema","Proto.AssetBalanceSchema"],"sources":["../../../src/services/balances/balances.ts"],"sourcesContent":["import * as Proto from \"../../gen/ledger/read/v1/ledger_read_pb.js\";\nimport { createClient, type Client } from \"@connectrpc/connect\";\nimport { parse } from \"../../shared/validation.js\";\nimport type { PolyesterRealtime } from \"../../realtime/index.js\";\nimport { connectReadyGatedProtoChannel } from \"../../realtime/ready-gated-subscription.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { accountScopeToSubaccountId, type AccountScopedInput } from \"../../shared/account-scope.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport type { SdkScales } from \"../../shared/decimal-surface.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport {\n BalanceHistoryInputSchema,\n BalancesListInputSchema,\n EquityHistoryInputSchema,\n PortfolioEquityHistoryInputSchema,\n createBalanceHistoryResponseSchema,\n createEquityHistoryResponseSchema,\n formatLedgerBalance,\n createPortfolioEquityHistoryResponseSchema,\n createPortfolioEquitySnapshotResponseSchema,\n type LedgerBalance,\n type BalanceHistoryInput,\n type BalanceHistoryResponse,\n type EquityHistoryInput,\n type EquityHistoryResponse,\n type PortfolioEquityHistoryInput,\n type PortfolioEquityHistoryResponse,\n type PortfolioEquitySnapshotResponse,\n} from \"./balances.schemas.js\";\n\ninterface SubscribeBalancesInput extends BaseSubscribeInput<LedgerBalance> {\n accountId: string;\n}\n\n/**\n * Reads and streams ledger balances plus balance and equity history for the authenticated account scope.\n */\nexport class BalancesService {\n #client: Client<typeof Proto.LedgerReadService>;\n #realtime: PolyesterRealtime;\n #resolver?: SubaccountResolver;\n #scales: SdkScales;\n #balanceHistoryResponseSchema: ReturnType<typeof createBalanceHistoryResponseSchema>;\n #equityHistoryResponseSchema: ReturnType<typeof createEquityHistoryResponseSchema>;\n #portfolioEquityHistoryResponseSchema: ReturnType<\n typeof createPortfolioEquityHistoryResponseSchema\n >;\n #portfolioEquitySnapshotResponseSchema: ReturnType<\n typeof createPortfolioEquitySnapshotResponseSchema\n >;\n\n constructor(\n transports: AuthApiTransports,\n realtime: PolyesterRealtime,\n resolver: SubaccountResolver | undefined,\n scales: SdkScales,\n ) {\n this.#client = createClient(Proto.LedgerReadService, transports.authApi);\n this.#realtime = realtime;\n this.#resolver = resolver;\n this.#scales = scales;\n this.#balanceHistoryResponseSchema = createBalanceHistoryResponseSchema();\n this.#equityHistoryResponseSchema = createEquityHistoryResponseSchema(scales);\n this.#portfolioEquityHistoryResponseSchema =\n createPortfolioEquityHistoryResponseSchema(scales);\n this.#portfolioEquitySnapshotResponseSchema =\n createPortfolioEquitySnapshotResponseSchema(scales);\n }\n\n /**\n * Returns current asset balances for the resolved root account or subaccount, including trading, funding, reserved, and available amounts as decimal strings.\n */\n async list(\n input: AccountScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<LedgerBalance[]> {\n await this.#scales.ready();\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const validated = parse(BalancesListInputSchema, resolved);\n const res = await this.#client.getBalances(\n {\n subaccountId: accountScopeToSubaccountId(validated.account),\n },\n toConnectCallOptions(options),\n );\n return res.balances.map(formatLedgerBalance);\n }\n\n /**\n * Returns columnar balance history for the resolved account scope over a selected range, optionally filtered by a non-negative integer ledger asset ID and account buckets. Ledger 0 or omission includes all assets.\n */\n async getBalanceHistory(\n input: BalanceHistoryInput,\n options?: PolyesterRequestOptions,\n ): Promise<BalanceHistoryResponse> {\n await this.#scales.ready();\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const validated = parse(BalanceHistoryInputSchema, resolved);\n const res = await this.#client.getBalanceHistory(validated, toConnectCallOptions(options));\n return parse(this.#balanceHistoryResponseSchema, res);\n }\n\n /**\n * Returns equity history series for the resolved account scope over a selected range, optionally grouped by account or asset and filtered by account buckets.\n */\n async getEquityHistory(\n input: EquityHistoryInput,\n options?: PolyesterRequestOptions,\n ): Promise<EquityHistoryResponse> {\n await this.#scales.ready();\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const validated = parse(EquityHistoryInputSchema, resolved);\n const res = await this.#client.getEquityHistorySeries(\n validated,\n toConnectCallOptions(options),\n );\n return parse(this.#equityHistoryResponseSchema, res);\n }\n\n /**\n * Returns root portfolio equity history grouped by the master account, leading owned subaccounts, and an optional remaining-subaccounts series.\n */\n async getPortfolioEquityHistory(\n input: PortfolioEquityHistoryInput,\n options?: PolyesterRequestOptions,\n ): Promise<PortfolioEquityHistoryResponse> {\n await this.#scales.ready();\n const validated = parse(PortfolioEquityHistoryInputSchema, input);\n const res = await this.#client.getPortfolioEquityHistorySeries(\n validated,\n toConnectCallOptions(options),\n );\n return parse(this.#portfolioEquityHistoryResponseSchema, res);\n }\n\n /**\n * Returns current root portfolio equity grouped by logical account and asset.\n */\n async getPortfolioEquitySnapshot(\n options?: PolyesterRequestOptions,\n ): Promise<PortfolioEquitySnapshotResponse> {\n await this.#scales.ready();\n const res = await this.#client.getPortfolioEquitySnapshot(\n {},\n toConnectCallOptions(options),\n );\n return parse(this.#portfolioEquitySnapshotResponseSchema, res);\n }\n\n /**\n * Subscribes to private balance updates on private:ledger:balances:{accountId}:proto and emits every balance record as a decimal-string row. Records for assets unknown to the catalog route a CatalogLookupError to onError.\n */\n subscribe(input: SubscribeBalancesInput): () => void {\n const channel = `private:ledger:balances:${input.accountId}:proto`;\n return connectReadyGatedProtoChannel(this.#realtime, {\n channel,\n schema: Proto.AssetBalanceSchema,\n ready: () => this.#scales.ready(),\n onPublication: (data) => {\n input.onEvent(formatLedgerBalance(data));\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAyCA,IAAa,kBAAb,MAA6B;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CAIA,YACI,YACA,UACA,UACA,QACF;EACE,KAAKA,UAAU,aAAaC,mBAAyB,WAAW,OAAO;EACvE,KAA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M,KAAKO,uCAAuC,GAAG;CAChE;;;;CAKA,MAAM,2BACF,SACwC;EACxC,MAAM,KAAKH,QAAQ,MAAM;EACzB,MAAM,MAAM,MAAM,KAAKJ,QAAQ,2BAC3B,CAAC,GACD,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,KAAKQ,wCAAwC,GAAG;CACjE;;;;CAKA,UAAU,OAA2C;EACjD,MAAM,UAAU,2BAA2B,MAAM,UAAU;EAC3D,OAAO,8BAA8B,KAAKN,WAAW;GACjD;GACA,QAAQO;GACR,aAAa,KAAKL,QAAQ,MAAM;GAChC,gBAAgB,SAAS;IACrB,MAAM,QAAQ,oBAAoB,IAAI,CAAC;GAC3C;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}
@@ -75,72 +75,6 @@ declare const BalanceHistoryInputSchema: v.SchemaWithPipe<readonly [v.StrictObje
75
75
  accountCodes: (AccountCode.FUNDING | AccountCode.TRADING)[];
76
76
  }>]>;
77
77
  type BalanceHistoryInput = v.InferInput<typeof BalanceHistoryInputSchema>;
78
- declare const ExportStatementInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
79
- /** Period start, inclusive, in epoch milliseconds (UTC). */
80
- readonly startTime: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
81
- /** Period end, exclusive, in epoch milliseconds (UTC); at most 366 days after `startTime`. */
82
- readonly endTime: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
83
- /** Ledger asset ID to cover only that asset; omit or `0` for every asset. */
84
- readonly assetId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, 0>;
85
- /** Previous `nextPageToken`; reuse only with the same account, asset and period. */
86
- readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, "">;
87
- readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
88
- readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
89
- }, undefined>], undefined>, undefined>;
90
- }, undefined>, v.CheckAction<{
91
- startTime: number;
92
- endTime: number;
93
- assetId: number;
94
- pageToken: string;
95
- account?: "active" | "main" | {
96
- subaccountId: string;
97
- } | undefined;
98
- }, "endTime must be after startTime.">, v.CheckAction<{
99
- startTime: number;
100
- endTime: number;
101
- assetId: number;
102
- pageToken: string;
103
- account?: "active" | "main" | {
104
- subaccountId: string;
105
- } | undefined;
106
- }, "A statement period is at most 366 days.">, v.TransformAction<{
107
- startTime: number;
108
- endTime: number;
109
- assetId: number;
110
- pageToken: string;
111
- account?: "active" | "main" | {
112
- subaccountId: string;
113
- } | undefined;
114
- }, {
115
- subaccountId: bigint | undefined;
116
- startTime: import("@bufbuild/protobuf/wkt").Timestamp;
117
- endTime: import("@bufbuild/protobuf/wkt").Timestamp;
118
- assetId: number;
119
- pageToken: string;
120
- }>]>;
121
- type ExportStatementInput = v.InferInput<typeof ExportStatementInputSchema>;
122
- /**
123
- * One page of an account statement. `csv` is RFC 4180 UTF-8 text with CRLF line endings; only
124
- * the first page starts with the header row, so concatenating pages in order yields the whole
125
- * statement. Read columns by header name, since later releases may append columns, and keep
126
- * amounts as decimal strings. An empty `nextPageToken` means no more pages.
127
- */
128
- interface StatementPage {
129
- csv: string;
130
- nextPageToken: string;
131
- /**
132
- * The statement covers movements up to this time (epoch ms, exclusive): the earliest of
133
- * `endTime`, the first page's request time and the time account history is complete
134
- * through. Every page carries the same value. Before `endTime`, the statement is partial:
135
- * the rest appears in a statement requested later.
136
- */
137
- completeThrough: number | undefined;
138
- }
139
- /** A whole account statement: every page's CSV and the time it is complete through. */
140
- interface Statement {
141
- csv: string;
142
- completeThrough: number | undefined;
143
- }
144
78
  declare function createBalanceHistoryResponseSchema(): v.SchemaWithPipe<readonly [v.ObjectSchema<{
145
79
  readonly range: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d">]>;
146
80
  readonly bucket: v.StringSchema<undefined>;
@@ -487,5 +421,5 @@ declare function createPortfolioEquitySnapshotResponseSchema(scales: SdkScales):
487
421
  }>]>;
488
422
  type PortfolioEquitySnapshotResponse = v.InferOutput<ReturnType<typeof createPortfolioEquitySnapshotResponseSchema>>;
489
423
  //#endregion
490
- export { BalanceHistoryInput, BalanceHistoryInputSchema, BalanceHistoryResponse, BalanceRange, BalanceRangeSchema, EquityGroupBy, EquityGroupBySchema, EquityHistoryInput, EquityHistoryInputSchema, EquityHistoryResponse, EquitySeries, EquitySeriesGrouping, EquitySeriesSchema, ExportStatementInput, ExportStatementInputSchema, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryInputSchema, PortfolioEquityHistoryResponse, PortfolioEquitySeries, PortfolioEquitySeriesGrouping, PortfolioEquitySeriesSchema, PortfolioEquitySnapshotResponse, Statement, StatementPage, createBalanceHistoryResponseSchema, createEquityHistoryResponseSchema, createLedgerBalanceSchema, createPortfolioEquityHistoryResponseSchema, createPortfolioEquitySnapshotResponseSchema, formatLedgerBalance };
424
+ export { BalanceHistoryInput, BalanceHistoryInputSchema, BalanceHistoryResponse, BalanceRange, BalanceRangeSchema, EquityGroupBy, EquityGroupBySchema, EquityHistoryInput, EquityHistoryInputSchema, EquityHistoryResponse, EquitySeries, EquitySeriesGrouping, EquitySeriesSchema, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryInputSchema, PortfolioEquityHistoryResponse, PortfolioEquitySeries, PortfolioEquitySeriesGrouping, PortfolioEquitySeriesSchema, PortfolioEquitySnapshotResponse, createBalanceHistoryResponseSchema, createEquityHistoryResponseSchema, createLedgerBalanceSchema, createPortfolioEquityHistoryResponseSchema, createPortfolioEquitySnapshotResponseSchema, formatLedgerBalance };
491
425
  //# sourceMappingURL=balances.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"balances.schemas.d.ts","names":[],"sources":["../../../src/services/balances/balances.schemas.ts"],"mappings":";;;;;;;;iBA2DgB,6BAAyB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASzB,oBAAoB,GAAG,eAA+B;KAY1D,gBAAgB,EAAE,YAAY,kBAAkB;cAQ/C,oBAAkB,EAAA;KAEnB,eAAe,EAAE,mBAAmB;cASnC,qBAAmB,EAAA;KAEpB,gBAAgB,EAAE,mBAAmB;cAEpC,2BAAyB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;KAwB1B,sBAAsB,EAAE,kBAAkB;cAOzC,4BAA0B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4B3B,uBAAuB,EAAE,kBAAkB;;;;;;;UAQtC;EACb;EACA;;;;;;;EAOA;;;UAIa;EACb;EACA;;iBAUY,sCAAkC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BtC,yBAAyB,EAAE,YACnC,kBAAkB;cAGT,0BAAwB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;KAwBzB,qBAAqB,EAAE,kBAAkB;cAExC,mCAAiC,EAAA;;;KAIlC,8BAA8B,EAAE,kBAAkB;KAmBlD;EAEF;EACA,aAAa,YAAY;EACzB;;EAGA;EACA;EACA;;cAGG,oBAAkB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKO,UAAA;EAA8B;;iBA2BpD,kCAAkC,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;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