@polyester/sdk 0.36.0-devnet-20261115165158 → 0.36.0-devnet-20261116002603

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 (351) hide show
  1. package/CHANGELOG.md +38 -4
  2. package/dist/browser-core.js +1 -1
  3. package/dist/client.d.ts +4 -0
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +4 -0
  6. package/dist/client.js.map +1 -1
  7. package/dist/gen/ai/v1/assistant_pb.d.ts +83 -5
  8. package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
  9. package/dist/gen/ai/v1/assistant_pb.js +67 -11
  10. package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
  11. package/dist/gen/alerts/v1/price_alerts_pb.d.ts +1 -1
  12. package/dist/gen/auth/v1/address_book_pb.d.ts +1 -1
  13. package/dist/gen/auth/v1/api_keys_pb.d.ts +5 -5
  14. package/dist/gen/auth/v1/api_keys_pb.js +4 -4
  15. package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
  16. package/dist/gen/auth/v1/auth_pb.d.ts +27 -2
  17. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  18. package/dist/gen/auth/v1/auth_pb.js +18 -1
  19. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  20. package/dist/gen/auth/v1/mfa_pb.d.ts +1 -1
  21. package/dist/gen/auth/v1/policies_pb.d.ts +19 -2
  22. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  23. package/dist/gen/auth/v1/policies_pb.js +18 -1
  24. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  25. package/dist/gen/auth/v1/profile_pb.d.ts +8 -12
  26. package/dist/gen/auth/v1/profile_pb.d.ts.map +1 -1
  27. package/dist/gen/auth/v1/profile_pb.js +1 -1
  28. package/dist/gen/auth/v1/profile_pb.js.map +1 -1
  29. package/dist/gen/auth/v1/resolve_pb.d.ts +1 -1
  30. package/dist/gen/auth/v1/social_verification_pb.d.ts +45 -11
  31. package/dist/gen/auth/v1/social_verification_pb.d.ts.map +1 -1
  32. package/dist/gen/auth/v1/social_verification_pb.js +1 -1
  33. package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
  34. package/dist/gen/auth/v1/subaccounts_pb.d.ts +18 -2
  35. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  36. package/dist/gen/auth/v1/subaccounts_pb.js +16 -2
  37. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  38. package/dist/gen/chain/analytics/v1/analytics_read_pb.d.ts +1 -1
  39. package/dist/gen/chain/deposit/v1/deposit_pb.d.ts +1 -1
  40. package/dist/gen/chain/guard/v1/guard_signer_pb.d.ts +1 -1
  41. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +229 -39
  42. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
  43. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js +34 -10
  44. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
  45. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +13 -1
  46. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts.map +1 -1
  47. package/dist/gen/chain/lifecycle/v1/types_pb.js +13 -1
  48. package/dist/gen/chain/lifecycle/v1/types_pb.js.map +1 -1
  49. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +7 -4
  50. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
  51. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
  52. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +11 -2
  53. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  54. package/dist/gen/chain/withdraw/v1/withdraw_pb.js +10 -1
  55. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  56. package/dist/gen/chain/zipper/v1/reason_pb.d.ts +1 -1
  57. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts +11 -7
  58. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts.map +1 -1
  59. package/dist/gen/chain/zipper/v1/zipper_pb.js +2 -2
  60. package/dist/gen/chain/zipper/v1/zipper_pb.js.map +1 -1
  61. package/dist/gen/changelog/v1/changelog_pb.d.ts +1 -1
  62. package/dist/gen/checkpoints/v1/checkpoints_pb.d.ts +1 -1
  63. package/dist/gen/claims/v1/claims_pb.d.ts +1 -1
  64. package/dist/gen/fees/v1/fees_pb.d.ts +1 -1
  65. package/dist/gen/index.d.ts +3 -1
  66. package/dist/gen/index.js +23 -21
  67. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +58 -17
  68. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
  69. package/dist/gen/ledger/read/v1/ledger_read_pb.js +32 -1
  70. package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
  71. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts +424 -0
  72. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts.map +1 -0
  73. package/dist/gen/ledger/read/v1/statement_export_pb.js +154 -0
  74. package/dist/gen/ledger/read/v1/statement_export_pb.js.map +1 -0
  75. package/dist/gen/marketdata/v1/asset_info_pb.d.ts +1 -1
  76. package/dist/gen/marketdata/v1/heatmap_pb.d.ts +1 -1
  77. package/dist/gen/marketdata/v1/marketdata_pb.d.ts +1 -1
  78. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts +1 -1
  79. package/dist/gen/notifications/v1/notifications_pb.d.ts +1 -1
  80. package/dist/gen/orderbook/v1/orderbook_pb.d.ts +1 -1
  81. package/dist/gen/orders/v1/orders_pb.d.ts +29 -5
  82. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  83. package/dist/gen/orders/v1/orders_pb.js +1 -1
  84. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  85. package/dist/gen/orders/v1/orders_read_pb.d.ts +3 -2
  86. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  87. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  88. package/dist/gen/polyester/ratelimit/v1/types_pb.d.ts +1 -1
  89. package/dist/gen/polyester/type/v1/u128_pb.d.ts +1 -1
  90. package/dist/gen/privatews/v1/private_ws_pb.d.ts +1 -1
  91. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +13 -8
  92. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts.map +1 -1
  93. package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -1
  94. package/dist/gen/rewards/v1/rewards_pb.d.ts +1 -1
  95. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +23 -11
  96. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
  97. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +4 -2
  98. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
  99. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +48 -12
  100. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  101. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +35 -6
  102. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  103. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts +1 -1
  104. package/dist/gen/swap/v1/swap_pb.d.ts +1 -1
  105. package/dist/gen/system/v1/system_pb.d.ts +1 -1
  106. package/dist/gen/tradews/v1/trade_ws_pb.d.ts +1 -1
  107. package/dist/gen/transfer/v1/dust_conversion_pb.d.ts +741 -0
  108. package/dist/gen/transfer/v1/dust_conversion_pb.d.ts.map +1 -0
  109. package/dist/gen/transfer/v1/dust_conversion_pb.js +235 -0
  110. package/dist/gen/transfer/v1/dust_conversion_pb.js.map +1 -0
  111. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +368 -4
  112. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
  113. package/dist/gen/transfer/v1/internal_transfer_pb.js +166 -4
  114. package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
  115. package/dist/gen/triggers/v1/triggers_pb.d.ts +11 -6
  116. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  117. package/dist/gen/triggers/v1/triggers_pb.js +4 -2
  118. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  119. package/dist/gen/vip/v1/vip_pb.d.ts +1 -1
  120. package/dist/index.d.ts +13 -7
  121. package/dist/index.js +1 -1
  122. package/dist/realtime/snapshot-then-stream.js +1 -1
  123. package/dist/server-core.js +3 -3
  124. package/dist/services/accounts/accounts.js +1 -1
  125. package/dist/services/accounts/accounts.schemas.js +1 -1
  126. package/dist/services/address-book/address-book.js +1 -1
  127. package/dist/services/api-keys/api-keys.js +1 -1
  128. package/dist/services/api-keys/api-keys.schemas.js +1 -1
  129. package/dist/services/assistant/assistant-events.schemas.d.ts +29 -29
  130. package/dist/services/assistant/assistant.codecs.d.ts +7 -1
  131. package/dist/services/assistant/assistant.codecs.d.ts.map +1 -1
  132. package/dist/services/assistant/assistant.codecs.js +5 -1
  133. package/dist/services/assistant/assistant.codecs.js.map +1 -1
  134. package/dist/services/assistant/assistant.d.ts +4 -3
  135. package/dist/services/assistant/assistant.d.ts.map +1 -1
  136. package/dist/services/assistant/assistant.js +7 -5
  137. package/dist/services/assistant/assistant.js.map +1 -1
  138. package/dist/services/assistant/assistant.schemas.d.ts +40 -3
  139. package/dist/services/assistant/assistant.schemas.d.ts.map +1 -1
  140. package/dist/services/assistant/assistant.schemas.js +19 -5
  141. package/dist/services/assistant/assistant.schemas.js.map +1 -1
  142. package/dist/services/assistant/assistant.types.d.ts +3 -3
  143. package/dist/services/auth/account-signer-auth.js +2 -2
  144. package/dist/services/auth/auth.js +1 -1
  145. package/dist/services/auth/profile/profile.d.ts +1 -1
  146. package/dist/services/auth/profile/profile.js +3 -3
  147. package/dist/services/auth/profile/profile.js.map +1 -1
  148. package/dist/services/auth/profile/profile.schemas.d.ts +0 -1
  149. package/dist/services/auth/profile/profile.schemas.d.ts.map +1 -1
  150. package/dist/services/auth/profile/profile.schemas.js +0 -1
  151. package/dist/services/auth/profile/profile.schemas.js.map +1 -1
  152. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +3 -1
  153. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -1
  154. package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -1
  155. package/dist/services/auto-withdraw/auto-withdraw.js +1 -1
  156. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +22 -22
  157. package/dist/services/auto-withdraw/auto-withdraw.schemas.js +1 -1
  158. package/dist/services/balances/balances.d.ts +4 -3
  159. package/dist/services/balances/balances.d.ts.map +1 -1
  160. package/dist/services/balances/balances.js +13 -5
  161. package/dist/services/balances/balances.js.map +1 -1
  162. package/dist/services/balances/balances.schemas.d.ts +30 -5
  163. package/dist/services/balances/balances.schemas.d.ts.map +1 -1
  164. package/dist/services/balances/balances.schemas.js +5 -9
  165. package/dist/services/balances/balances.schemas.js.map +1 -1
  166. package/dist/services/balances/balances.types.d.ts +2 -2
  167. package/dist/services/candles/candles.js +2 -2
  168. package/dist/services/candles/candles.schemas.d.ts +10 -10
  169. package/dist/services/chain-analytics/chain-analytics.js +1 -1
  170. package/dist/services/changelog/changelog.js +1 -1
  171. package/dist/services/changelog/changelog.schemas.d.ts +22 -22
  172. package/dist/services/checkpoints/checkpoints.js +1 -1
  173. package/dist/services/claims/claims.js +1 -1
  174. package/dist/services/claims/claims.schemas.d.ts +2 -2
  175. package/dist/services/claims/claims.schemas.js +1 -1
  176. package/dist/services/deposit/deposit.js +1 -1
  177. package/dist/services/dust-conversion/dust-conversion.codecs.d.ts +22 -0
  178. package/dist/services/dust-conversion/dust-conversion.codecs.d.ts.map +1 -0
  179. package/dist/services/dust-conversion/dust-conversion.codecs.js +22 -0
  180. package/dist/services/dust-conversion/dust-conversion.codecs.js.map +1 -0
  181. package/dist/services/dust-conversion/dust-conversion.d.ts +59 -0
  182. package/dist/services/dust-conversion/dust-conversion.d.ts.map +1 -0
  183. package/dist/services/dust-conversion/dust-conversion.js +87 -0
  184. package/dist/services/dust-conversion/dust-conversion.js.map +1 -0
  185. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts +561 -0
  186. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts.map +1 -0
  187. package/dist/services/dust-conversion/dust-conversion.schemas.js +190 -0
  188. package/dist/services/dust-conversion/dust-conversion.schemas.js.map +1 -0
  189. package/dist/services/dust-conversion/dust-conversion.types.d.ts +3 -0
  190. package/dist/services/dust-conversion/service.d.ts +8 -0
  191. package/dist/services/dust-conversion/service.d.ts.map +1 -0
  192. package/dist/services/dust-conversion/service.js +9 -0
  193. package/dist/services/dust-conversion/service.js.map +1 -0
  194. package/dist/services/fees/fees.js +1 -1
  195. package/dist/services/guard-signer/guard-signer.js +1 -1
  196. package/dist/services/guard-signer/guard-signer.schemas.js +1 -1
  197. package/dist/services/heatmap/heatmap.js +2 -2
  198. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts +13 -1
  199. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts.map +1 -1
  200. package/dist/services/internal-transfers/internal-transfers.codecs.js +22 -2
  201. package/dist/services/internal-transfers/internal-transfers.codecs.js.map +1 -1
  202. package/dist/services/internal-transfers/internal-transfers.d.ts +14 -2
  203. package/dist/services/internal-transfers/internal-transfers.d.ts.map +1 -1
  204. package/dist/services/internal-transfers/internal-transfers.js +30 -4
  205. package/dist/services/internal-transfers/internal-transfers.js.map +1 -1
  206. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +265 -5
  207. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts.map +1 -1
  208. package/dist/services/internal-transfers/internal-transfers.schemas.js +62 -4
  209. package/dist/services/internal-transfers/internal-transfers.schemas.js.map +1 -1
  210. package/dist/services/internal-transfers/internal-transfers.types.d.ts +3 -3
  211. package/dist/services/lifecycle/lifecycle.codecs.d.ts +1 -1
  212. package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
  213. package/dist/services/lifecycle/lifecycle.codecs.js +1 -0
  214. package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
  215. package/dist/services/lifecycle/lifecycle.d.ts +26 -8
  216. package/dist/services/lifecycle/lifecycle.d.ts.map +1 -1
  217. package/dist/services/lifecycle/lifecycle.js +42 -10
  218. package/dist/services/lifecycle/lifecycle.js.map +1 -1
  219. package/dist/services/lifecycle/lifecycle.schemas.d.ts +108 -84
  220. package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
  221. package/dist/services/lifecycle/lifecycle.schemas.js +45 -46
  222. package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
  223. package/dist/services/lifecycle/lifecycle.types.d.ts +2 -2
  224. package/dist/services/lifecycle/service.js +1 -1
  225. package/dist/services/lifecycle/service.js.map +1 -1
  226. package/dist/services/market-data/market-data.js +3 -3
  227. package/dist/services/market-overview/market-overview.js +2 -2
  228. package/dist/services/market-overview/market-overview.schemas.js +1 -1
  229. package/dist/services/notifications/notifications.js +1 -1
  230. package/dist/services/orderbook/orderbook.d.ts.map +1 -1
  231. package/dist/services/orderbook/orderbook.js +3 -2
  232. package/dist/services/orderbook/orderbook.js.map +1 -1
  233. package/dist/services/orderbook/orderbook.schemas.d.ts +10 -0
  234. package/dist/services/orderbook/orderbook.schemas.d.ts.map +1 -1
  235. package/dist/services/orderbook/orderbook.schemas.js +4 -1
  236. package/dist/services/orderbook/orderbook.schemas.js.map +1 -1
  237. package/dist/services/orders/order-errors.schemas.d.ts +11 -1
  238. package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
  239. package/dist/services/orders/order-errors.schemas.js +12 -2
  240. package/dist/services/orders/order-errors.schemas.js.map +1 -1
  241. package/dist/services/orders/orders-batch.schemas.d.ts +67 -27
  242. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  243. package/dist/services/orders/orders-batch.schemas.js +2 -2
  244. package/dist/services/orders/orders-identifiers.schemas.js +2 -1
  245. package/dist/services/orders/orders-identifiers.schemas.js.map +1 -1
  246. package/dist/services/orders/orders-input.schemas.d.ts +11 -4
  247. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  248. package/dist/services/orders/orders-input.schemas.js +3 -2
  249. package/dist/services/orders/orders-input.schemas.js.map +1 -1
  250. package/dist/services/orders/orders-modify.schemas.js +2 -2
  251. package/dist/services/orders/orders-output.schemas.d.ts +14 -14
  252. package/dist/services/orders/orders-risk.schemas.js +3 -3
  253. package/dist/services/orders/orders.js +2 -2
  254. package/dist/services/policies/api-key-policies/api-key-policies.js +1 -1
  255. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  256. package/dist/services/policies/shared.codecs.js +10 -4
  257. package/dist/services/policies/shared.codecs.js.map +1 -1
  258. package/dist/services/policies/shared.d.ts +1 -1
  259. package/dist/services/policies/subaccount-policies/subaccount-policies.js +2 -2
  260. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +3 -3
  261. package/dist/services/price-alerts/price-alerts.js +1 -1
  262. package/dist/services/price-alerts/price-alerts.schemas.d.ts +10 -10
  263. package/dist/services/rate-limits/rate-limits.d.ts +4 -1
  264. package/dist/services/rate-limits/rate-limits.d.ts.map +1 -1
  265. package/dist/services/rate-limits/rate-limits.js +5 -2
  266. package/dist/services/rate-limits/rate-limits.js.map +1 -1
  267. package/dist/services/rate-limits/rate-limits.schemas.d.ts +1 -0
  268. package/dist/services/rate-limits/rate-limits.schemas.d.ts.map +1 -1
  269. package/dist/services/rate-limits/rate-limits.schemas.js +1 -0
  270. package/dist/services/rate-limits/rate-limits.schemas.js.map +1 -1
  271. package/dist/services/rewards/rewards.js +1 -1
  272. package/dist/services/social-verification/social-verification.codecs.js +6 -2
  273. package/dist/services/social-verification/social-verification.codecs.js.map +1 -1
  274. package/dist/services/social-verification/social-verification.d.ts +14 -3
  275. package/dist/services/social-verification/social-verification.d.ts.map +1 -1
  276. package/dist/services/social-verification/social-verification.js +15 -4
  277. package/dist/services/social-verification/social-verification.js.map +1 -1
  278. package/dist/services/social-verification/social-verification.schemas.d.ts +13 -3
  279. package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
  280. package/dist/services/social-verification/social-verification.schemas.js +13 -5
  281. package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
  282. package/dist/services/statement-exports/service.d.ts +8 -0
  283. package/dist/services/statement-exports/service.d.ts.map +1 -0
  284. package/dist/services/statement-exports/service.js +9 -0
  285. package/dist/services/statement-exports/service.js.map +1 -0
  286. package/dist/services/statement-exports/statement-exports.codecs.d.ts +17 -0
  287. package/dist/services/statement-exports/statement-exports.codecs.d.ts.map +1 -0
  288. package/dist/services/statement-exports/statement-exports.codecs.js +19 -0
  289. package/dist/services/statement-exports/statement-exports.codecs.js.map +1 -0
  290. package/dist/services/statement-exports/statement-exports.d.ts +34 -0
  291. package/dist/services/statement-exports/statement-exports.d.ts.map +1 -0
  292. package/dist/services/statement-exports/statement-exports.js +53 -0
  293. package/dist/services/statement-exports/statement-exports.js.map +1 -0
  294. package/dist/services/statement-exports/statement-exports.schemas.d.ts +269 -0
  295. package/dist/services/statement-exports/statement-exports.schemas.d.ts.map +1 -0
  296. package/dist/services/statement-exports/statement-exports.schemas.js +98 -0
  297. package/dist/services/statement-exports/statement-exports.schemas.js.map +1 -0
  298. package/dist/services/statement-exports/statement-exports.types.d.ts +3 -0
  299. package/dist/services/subaccounts/subaccounts.codecs.js +3 -1
  300. package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
  301. package/dist/services/subaccounts/subaccounts.js +3 -3
  302. package/dist/services/subaccounts/subaccounts.schemas.d.ts +13 -13
  303. package/dist/services/system/system.js +1 -1
  304. package/dist/services/system/system.schemas.d.ts +7 -7
  305. package/dist/services/trades/trades.js +2 -2
  306. package/dist/services/trades/trades.schemas.d.ts +1 -1
  307. package/dist/services/trading-withdraws/trading-withdraws.js +1 -1
  308. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +1 -1
  309. package/dist/services/trading-withdraws/wallet-message.js +1 -1
  310. package/dist/services/transfers/transfers.js +2 -2
  311. package/dist/services/triggers/trigger-child-order.schemas.js +3 -3
  312. package/dist/services/triggers/trigger-input.schemas.d.ts +5 -4
  313. package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
  314. package/dist/services/triggers/trigger-input.schemas.js +4 -4
  315. package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
  316. package/dist/services/triggers/triggers-output.schemas.d.ts +33 -23
  317. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  318. package/dist/services/triggers/triggers.js +2 -2
  319. package/dist/services/vip/vip.js +1 -1
  320. package/dist/services/vip/vip.schemas.js +1 -1
  321. package/dist/services/zipper/zipper.js +1 -1
  322. package/dist/services/zipper/zipper.schemas.d.ts.map +1 -1
  323. package/dist/services/zipper/zipper.schemas.js +11 -1
  324. package/dist/services/zipper/zipper.schemas.js.map +1 -1
  325. package/dist/shared/account-scope.js +4 -1
  326. package/dist/shared/account-scope.js.map +1 -1
  327. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  328. package/dist/shared/connect-error-mapping.js +3 -0
  329. package/dist/shared/connect-error-mapping.js.map +1 -1
  330. package/dist/shared/error-detail.d.ts +5 -0
  331. package/dist/shared/error-detail.d.ts.map +1 -1
  332. package/dist/shared/error-detail.js.map +1 -1
  333. package/dist/shared/error-details/alerts.js +1 -1
  334. package/dist/shared/error-details/assistant.js +1 -1
  335. package/dist/shared/error-details/auth.js +8 -3
  336. package/dist/shared/error-details/auth.js.map +1 -1
  337. package/dist/shared/error-details/claims.js +1 -1
  338. package/dist/shared/error-details/internal-transfer.js +1 -1
  339. package/dist/shared/error-details/ledger.js +1 -1
  340. package/dist/shared/error-details/market-overview.js +1 -1
  341. package/dist/shared/error-details/notifications.js +1 -1
  342. package/dist/shared/error-details/orders.js +1 -1
  343. package/dist/shared/error-details/profile.js +1 -1
  344. package/dist/shared/error-details/rate-limit.js +1 -1
  345. package/dist/shared/error-details/withdraw.js +1 -1
  346. package/dist/shared/rate-limit.schemas.js +1 -1
  347. package/dist/utils/cookies.js +1 -1
  348. package/dist/wired-services.d.ts.map +1 -1
  349. package/dist/wired-services.js +21 -17
  350. package/dist/wired-services.js.map +1 -1
  351. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.codecs.js","names":[],"sources":["../../../src/services/lifecycle/lifecycle.codecs.ts"],"sourcesContent":["import {\n FlowDomain,\n FlowKind,\n FlowState,\n LifecycleReason,\n LifecycleSource,\n RequestFeeStatus,\n} from \"../../gen/chain/lifecycle/v1/types_pb.js\";\nimport {\n FlowParticipation,\n FlowStep,\n FlowStepActivityKind,\n FlowTimelineStatus,\n ListOrderBy,\n ListScope,\n Sort,\n TxLookupKind,\n} from \"../../gen/chain/lifecycle/v1/lifecycle_read_pb.js\";\nimport { ZipperReasonCode } from \"../../gen/chain/zipper/v1/reason_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const LIFECYCLE_FLOW_KIND_VALUES = [\"deposit\", \"withdraw\", \"transfer\"] as const;\nexport type LifecycleFlowKindValue = (typeof LIFECYCLE_FLOW_KIND_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_STATE_VALUES = [\n \"pending_source\",\n \"pending_polyester_chain\",\n \"pending_ledger\",\n \"completed\",\n \"failed\",\n \"dropped\",\n \"refunded\",\n] as const;\nexport type LifecycleFlowStateValue = (typeof LIFECYCLE_FLOW_STATE_VALUES)[number];\n\nexport const LIFECYCLE_LIST_SCOPE_VALUES = [\"all\", \"open\", \"terminal\"] as const;\nexport type LifecycleListScopeValue = (typeof LIFECYCLE_LIST_SCOPE_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_PARTICIPATION_VALUES = [\"owner\", \"recipient\"] as const;\nexport type LifecycleFlowParticipationValue = (typeof LIFECYCLE_FLOW_PARTICIPATION_VALUES)[number];\n\nexport const LIFECYCLE_TX_LOOKUP_KIND_VALUES = [\"source\", \"any\"] as const;\nexport type LifecycleTxLookupKindValue = (typeof LIFECYCLE_TX_LOOKUP_KIND_VALUES)[number];\n\nexport const LIFECYCLE_SORT_VALUES = [\"newest\", \"oldest\"] as const;\nexport type LifecycleSortValue = (typeof LIFECYCLE_SORT_VALUES)[number];\n\nexport const LIFECYCLE_LIST_ORDER_BY_VALUES = [\"last_activity\", \"started_at\"] as const;\nexport type LifecycleListOrderByValue = (typeof LIFECYCLE_LIST_ORDER_BY_VALUES)[number];\n\nexport const LIFECYCLE_REASON_VALUES = [\n \"unspecified\",\n \"zipper_validation_rejected\",\n \"zipper_execution_rejected\",\n \"zipper_withdraw_execution_failed\",\n \"zipper_deposit_refund_failed\",\n \"zipper_compliance_transferred\",\n \"ledger_mirror_rejected\",\n \"ledger_mirror_transfer_exceeds_credits\",\n \"ledger_mirror_transfer_exists\",\n \"ledger_mirror_pending_transfer_not_found\",\n \"ledger_mirror_transfer_id_already_failed\",\n \"trading_withdraw_policy_denied\",\n \"trading_withdraw_contract_reverted\",\n \"trading_withdraw_execution_failed\",\n \"deposit_source_not_confirmed\",\n] as const;\n/**\n * Catalog labels plus a code-preserving fallback for wire values the generated\n * enum does not know. Proto3 enums are open — the backend can emit codes ahead\n * of a contract update — and rejecting them froze flows out of the UI.\n */\nexport type LifecycleReasonValue =\n | (typeof LIFECYCLE_REASON_VALUES)[number]\n | `unknown_reason_${number}`;\n\nexport const LIFECYCLE_FLOW_STEP_VALUES = [\n \"source\",\n \"transfer\",\n \"request\",\n \"validation\",\n \"execution\",\n \"bridge_fulfillment\",\n \"dropped\",\n \"failed\",\n \"refunded\",\n \"fulfilling\",\n \"settlement\",\n] as const;\nexport type LifecycleFlowStepValue = (typeof LIFECYCLE_FLOW_STEP_VALUES)[number];\n\nexport const LIFECYCLE_SOURCE_VALUES = [\n \"unspecified\",\n \"relayer\",\n \"polyester_chain\",\n \"executor\",\n \"ledger\",\n \"lifecycle\",\n] as const;\nexport type LifecycleSourceValue = (typeof LIFECYCLE_SOURCE_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_STEP_ACTIVITY_KIND_VALUES = [\n \"minted\",\n \"funding\",\n \"trading\",\n \"unspecified\",\n] as const;\nexport type LifecycleFlowStepActivityKindValue =\n (typeof LIFECYCLE_FLOW_STEP_ACTIVITY_KIND_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_TIMELINE_STATUS_VALUES = [\"completed\", \"current\", \"planned\"] as const;\nexport type LifecycleFlowTimelineStatusValue =\n (typeof LIFECYCLE_FLOW_TIMELINE_STATUS_VALUES)[number];\n\nexport const LIFECYCLE_REQUEST_FEE_STATUS_VALUES = [\"locked\", \"settled\", \"kept\"] as const;\nexport type LifecycleRequestFeeStatusValue = (typeof LIFECYCLE_REQUEST_FEE_STATUS_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_DOMAIN_VALUES = [\n \"external_chain\",\n \"zipper\",\n \"funding\",\n \"trading\",\n \"lending\",\n] as const;\nexport type LifecycleFlowDomainValue = (typeof LIFECYCLE_FLOW_DOMAIN_VALUES)[number];\n\nexport const LifecycleFlowDomainCodec = {\n protoToOutput: {\n [FlowDomain.DOMAIN_UNSPECIFIED]: \"unspecified\",\n [FlowDomain.DOMAIN_EXTERNAL_CHAIN]: \"external_chain\",\n [FlowDomain.DOMAIN_ZIPPER]: \"zipper\",\n [FlowDomain.DOMAIN_FUNDING]: \"funding\",\n [FlowDomain.DOMAIN_TRADING]: \"trading\",\n [FlowDomain.DOMAIN_LENDING]: \"lending\",\n } satisfies ProtoToOutput<FlowDomain, LifecycleFlowDomainValue>,\n} as const;\n\nexport const LifecycleFlowKindCodec = {\n inputToProto: {\n deposit: FlowKind.KIND_DEPOSIT,\n withdraw: FlowKind.KIND_WITHDRAW,\n transfer: FlowKind.KIND_TRANSFER,\n } satisfies InputToProto<LifecycleFlowKindValue, FlowKind>,\n protoToOutput: {\n [FlowKind.KIND_UNSPECIFIED]: \"unspecified\",\n [FlowKind.KIND_DEPOSIT]: \"deposit\",\n [FlowKind.KIND_WITHDRAW]: \"withdraw\",\n [FlowKind.KIND_TRANSFER]: \"transfer\",\n } satisfies ProtoToOutput<FlowKind, LifecycleFlowKindValue>,\n} as const;\n\nexport const LifecycleFlowStateCodec = {\n inputToProto: {\n pending_source: FlowState.STATE_PENDING_SOURCE,\n pending_polyester_chain: FlowState.STATE_PENDING_POLYESTER_CHAIN,\n pending_ledger: FlowState.STATE_PENDING_LEDGER,\n completed: FlowState.STATE_COMPLETED,\n failed: FlowState.STATE_FAILED,\n dropped: FlowState.STATE_DROPPED,\n refunded: FlowState.STATE_REFUNDED,\n } satisfies InputToProto<LifecycleFlowStateValue, FlowState>,\n protoToOutput: {\n [FlowState.STATE_UNSPECIFIED]: \"unspecified\",\n [FlowState.STATE_PENDING_SOURCE]: \"pending_source\",\n [FlowState.STATE_PENDING_POLYESTER_CHAIN]: \"pending_polyester_chain\",\n [FlowState.STATE_PENDING_LEDGER]: \"pending_ledger\",\n [FlowState.STATE_COMPLETED]: \"completed\",\n [FlowState.STATE_FAILED]: \"failed\",\n [FlowState.STATE_DROPPED]: \"dropped\",\n [FlowState.STATE_REFUNDED]: \"refunded\",\n } satisfies ProtoToOutput<FlowState, LifecycleFlowStateValue>,\n} as const;\n\nexport const LifecycleListScopeCodec = {\n inputToProto: {\n all: ListScope.LIST_ALL,\n open: ListScope.LIST_OPEN_ONLY,\n terminal: ListScope.LIST_TERMINAL_ONLY,\n } satisfies InputToProto<LifecycleListScopeValue, ListScope>,\n protoToOutput: {\n [ListScope.LIST_UNSPECIFIED]: \"unspecified\",\n [ListScope.LIST_ALL]: \"all\",\n [ListScope.LIST_OPEN_ONLY]: \"open\",\n [ListScope.LIST_TERMINAL_ONLY]: \"terminal\",\n } satisfies ProtoToOutput<ListScope, LifecycleListScopeValue>,\n} as const;\n\nexport const LifecycleFlowParticipationCodec = {\n inputToProto: {\n owner: FlowParticipation.PARTICIPATION_OWNER,\n recipient: FlowParticipation.PARTICIPATION_RECIPIENT,\n } satisfies InputToProto<LifecycleFlowParticipationValue, FlowParticipation>,\n protoToOutput: {\n [FlowParticipation.PARTICIPATION_UNSPECIFIED]: \"unspecified\",\n [FlowParticipation.PARTICIPATION_OWNER]: \"owner\",\n [FlowParticipation.PARTICIPATION_RECIPIENT]: \"recipient\",\n } satisfies ProtoToOutput<FlowParticipation, LifecycleFlowParticipationValue>,\n} as const;\n\nexport const LifecycleSortCodec = {\n inputToProto: {\n newest: Sort.NEWEST,\n oldest: Sort.OLDEST,\n } satisfies InputToProto<LifecycleSortValue, Sort>,\n} as const;\n\nexport const LifecycleListOrderByCodec = {\n inputToProto: {\n last_activity: ListOrderBy.ORDER_BY_LAST_ACTIVITY,\n started_at: ListOrderBy.ORDER_BY_STARTED_AT,\n } satisfies InputToProto<LifecycleListOrderByValue, ListOrderBy>,\n} as const;\n\n/**\n * LifecycleReason is a stable product-facing reason catalog. Unlike the other\n * lifecycle enums, `REASON_UNSPECIFIED` (0) is a valid wire value — it is\n * the normal state for flows without a notable reason — so the codec maps the\n * full enum including zero.\n */\nexport const LifecycleReasonCodec = {\n protoToOutput: {\n [LifecycleReason.REASON_UNSPECIFIED]: \"unspecified\",\n [LifecycleReason.ZIPPER_VALIDATION_REJECTED]: \"zipper_validation_rejected\",\n [LifecycleReason.ZIPPER_EXECUTION_REJECTED]: \"zipper_execution_rejected\",\n [LifecycleReason.ZIPPER_WITHDRAW_EXECUTION_FAILED]: \"zipper_withdraw_execution_failed\",\n [LifecycleReason.ZIPPER_DEPOSIT_REFUND_FAILED]: \"zipper_deposit_refund_failed\",\n [LifecycleReason.ZIPPER_COMPLIANCE_TRANSFERRED]: \"zipper_compliance_transferred\",\n [LifecycleReason.LEDGER_MIRROR_REJECTED]: \"ledger_mirror_rejected\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_EXCEEDS_CREDITS]:\n \"ledger_mirror_transfer_exceeds_credits\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_EXISTS]: \"ledger_mirror_transfer_exists\",\n [LifecycleReason.LEDGER_MIRROR_PENDING_TRANSFER_NOT_FOUND]:\n \"ledger_mirror_pending_transfer_not_found\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_ID_ALREADY_FAILED]:\n \"ledger_mirror_transfer_id_already_failed\",\n [LifecycleReason.TRADING_WITHDRAW_POLICY_DENIED]: \"trading_withdraw_policy_denied\",\n [LifecycleReason.TRADING_WITHDRAW_CONTRACT_REVERTED]: \"trading_withdraw_contract_reverted\",\n [LifecycleReason.TRADING_WITHDRAW_EXECUTION_FAILED]: \"trading_withdraw_execution_failed\",\n [LifecycleReason.DEPOSIT_SOURCE_NOT_CONFIRMED]: \"deposit_source_not_confirmed\",\n } satisfies Record<LifecycleReason, LifecycleReasonValue>,\n} as const;\n\n/**\n * Maps a wire reason code to its catalog label, preserving uncataloged codes\n * as `unknown_reason_${code}` instead of failing the whole flow payload.\n */\nexport function lifecycleReasonFromCode(code: number): LifecycleReasonValue {\n const known = LifecycleReasonCodec.protoToOutput as Partial<\n Record<number, LifecycleReasonValue>\n >;\n return known[code] ?? `unknown_reason_${code}`;\n}\n\nexport const LifecycleTxLookupKindCodec = {\n inputToProto: {\n source: TxLookupKind.TX_SOURCE,\n any: TxLookupKind.TX_ANY,\n } satisfies InputToProto<LifecycleTxLookupKindValue, TxLookupKind>,\n protoToOutput: {\n [TxLookupKind.TX_UNSPECIFIED]: \"unspecified\",\n [TxLookupKind.TX_SOURCE]: \"source\",\n [TxLookupKind.TX_ANY]: \"any\",\n } satisfies ProtoToOutput<TxLookupKind, LifecycleTxLookupKindValue>,\n} as const;\n\nexport const LifecycleFlowStepCodec = {\n protoToOutput: {\n [FlowStep.UNSPECIFIED]: \"unspecified\",\n [FlowStep.SOURCE]: \"source\",\n [FlowStep.TRANSFER]: \"transfer\",\n [FlowStep.REQUEST]: \"request\",\n [FlowStep.VALIDATION]: \"validation\",\n [FlowStep.EXECUTION]: \"execution\",\n [FlowStep.BRIDGE_FULFILLMENT]: \"bridge_fulfillment\",\n [FlowStep.DROPPED]: \"dropped\",\n [FlowStep.FAILED]: \"failed\",\n [FlowStep.REFUNDED]: \"refunded\",\n [FlowStep.FULFILLING]: \"fulfilling\",\n [FlowStep.SETTLEMENT]: \"settlement\",\n } satisfies ProtoToOutput<FlowStep, LifecycleFlowStepValue>,\n} as const;\n\nexport const LifecycleSourceCodec = {\n /**\n * In-progress flows may emit SOURCE_UNSPECIFIED (0) before a subsystem is\n * attributed, so zero must decode like other lifecycle \"unspecified\" enums.\n */\n protoToOutput: {\n [LifecycleSource.SOURCE_UNSPECIFIED]: \"unspecified\",\n [LifecycleSource.SOURCE_RELAYER]: \"relayer\",\n [LifecycleSource.SOURCE_POLYESTER_CHAIN]: \"polyester_chain\",\n [LifecycleSource.SOURCE_EXECUTOR]: \"executor\",\n [LifecycleSource.SOURCE_LEDGER]: \"ledger\",\n [LifecycleSource.SOURCE_LIFECYCLE]: \"lifecycle\",\n } satisfies Record<LifecycleSource, LifecycleSourceValue>,\n} as const;\n\nexport const LifecycleFlowStepActivityKindCodec = {\n protoToOutput: {\n [FlowStepActivityKind.ACTIVITY_MINTED]: \"minted\",\n [FlowStepActivityKind.ACTIVITY_FUNDING]: \"funding\",\n [FlowStepActivityKind.ACTIVITY_TRADING]: \"trading\",\n [FlowStepActivityKind.ACTIVITY_UNSPECIFIED]: \"unspecified\",\n } satisfies Record<FlowStepActivityKind, LifecycleFlowStepActivityKindValue>,\n} as const;\n\nexport const LifecycleFlowTimelineStatusCodec = {\n protoToOutput: {\n [FlowTimelineStatus.TIMELINE_STATUS_UNSPECIFIED]: \"unspecified\",\n [FlowTimelineStatus.TIMELINE_STATUS_COMPLETED]: \"completed\",\n [FlowTimelineStatus.TIMELINE_STATUS_CURRENT]: \"current\",\n [FlowTimelineStatus.TIMELINE_STATUS_PLANNED]: \"planned\",\n } satisfies ProtoToOutput<FlowTimelineStatus, LifecycleFlowTimelineStatusValue>,\n} as const;\n\nexport const LifecycleRequestFeeStatusCodec = {\n protoToOutput: {\n [RequestFeeStatus.UNSPECIFIED]: \"unspecified\",\n [RequestFeeStatus.LOCKED]: \"locked\",\n [RequestFeeStatus.SETTLED]: \"settled\",\n [RequestFeeStatus.KEPT]: \"kept\",\n } satisfies ProtoToOutput<RequestFeeStatus, LifecycleRequestFeeStatusValue>,\n} as const;\n\n/**\n * Zipper's exact outcome code, for branching on the outcome. Show `message`, or look up copy by\n * `reasonId`, rather than keying display text on this code: a withdrawal whose execution failed\n * keeps its code while `reasonId` and `message` say it is under review.\n */\nexport const ZIPPER_REASON_CODE_VALUES = [\n \"unspecified\",\n \"deposit_wait_expired\",\n \"deposit_amount_invalid\",\n \"deposit_amount_below_minimum\",\n \"deposit_amount_not_above_fee\",\n \"deposit_net_amount_below_minimum\",\n \"evm_deposit_source_tx_invalid\",\n \"evm_deposit_source_tx_zero\",\n \"evm_deposit_source_tx_not_found\",\n \"evm_deposit_source_tx_reverted\",\n \"evm_deposit_transfer_mismatch\",\n \"utxo_deposit_transaction_mismatch\",\n \"btc_deposit_transaction_mismatch\",\n \"bch_deposit_transaction_mismatch\",\n \"doge_deposit_transaction_mismatch\",\n \"ltc_deposit_transaction_mismatch\",\n \"utxo_deposit_source_is_deposit_address\",\n \"solana_deposit_signature_invalid\",\n \"solana_deposit_transaction_failed\",\n \"solana_deposit_transfer_mismatch\",\n \"xrp_deposit_source_hash_index_invalid\",\n \"xrp_deposit_source_address_invalid\",\n \"xrp_deposit_address_invalid\",\n \"xrp_deposit_payment_mismatch\",\n \"rejection_unmapped\",\n \"withdrawal_amount_invalid\",\n \"withdrawal_amount_below_minimum\",\n \"withdrawal_asset_invalid\",\n \"withdrawal_sender_invalid\",\n \"withdrawal_destination_invalid\",\n \"withdrawal_asset_unavailable\",\n \"evm_withdrawal_destination_invalid\",\n \"btc_withdrawal_destination_invalid\",\n \"bch_withdrawal_destination_invalid\",\n \"doge_withdrawal_destination_invalid\",\n \"ltc_withdrawal_destination_invalid\",\n \"solana_withdrawal_destination_invalid\",\n \"xrp_withdrawal_classic_address_invalid\",\n \"xrp_withdrawal_destination_tag_invalid\",\n \"withdrawal_liquidity_insufficient\",\n \"compliance_high_risk_address\",\n \"compliance_address_blocked\",\n \"compliance_address_return\",\n \"request_verification_rejected\",\n \"rejected\",\n \"error_unmapped\",\n \"error_network_unsupported\",\n \"error_request_processing_failed\",\n \"error_request_verification_failed\",\n \"error_result_submission_failed\",\n \"error_status_unknown\",\n] as const;\n\nexport type ZipperReasonCodeValue =\n | (typeof ZIPPER_REASON_CODE_VALUES)[number]\n | `unknown_zipper_reason_${number}`;\n\nexport const ZipperReasonCodeCodec = {\n protoToOutput: {\n [ZipperReasonCode.REASON_UNSPECIFIED]: \"unspecified\",\n [ZipperReasonCode.DEPOSIT_WAIT_EXPIRED]: \"deposit_wait_expired\",\n [ZipperReasonCode.DEPOSIT_AMOUNT_INVALID]: \"deposit_amount_invalid\",\n [ZipperReasonCode.DEPOSIT_AMOUNT_BELOW_MINIMUM]: \"deposit_amount_below_minimum\",\n [ZipperReasonCode.DEPOSIT_AMOUNT_NOT_ABOVE_FEE]: \"deposit_amount_not_above_fee\",\n [ZipperReasonCode.DEPOSIT_NET_AMOUNT_BELOW_MINIMUM]: \"deposit_net_amount_below_minimum\",\n [ZipperReasonCode.EVM_DEPOSIT_SOURCE_TX_INVALID]: \"evm_deposit_source_tx_invalid\",\n [ZipperReasonCode.EVM_DEPOSIT_SOURCE_TX_ZERO]: \"evm_deposit_source_tx_zero\",\n [ZipperReasonCode.EVM_DEPOSIT_SOURCE_TX_NOT_FOUND]: \"evm_deposit_source_tx_not_found\",\n [ZipperReasonCode.EVM_DEPOSIT_SOURCE_TX_REVERTED]: \"evm_deposit_source_tx_reverted\",\n [ZipperReasonCode.EVM_DEPOSIT_TRANSFER_MISMATCH]: \"evm_deposit_transfer_mismatch\",\n [ZipperReasonCode.UTXO_DEPOSIT_TRANSACTION_MISMATCH]: \"utxo_deposit_transaction_mismatch\",\n [ZipperReasonCode.BTC_DEPOSIT_TRANSACTION_MISMATCH]: \"btc_deposit_transaction_mismatch\",\n [ZipperReasonCode.BCH_DEPOSIT_TRANSACTION_MISMATCH]: \"bch_deposit_transaction_mismatch\",\n [ZipperReasonCode.DOGE_DEPOSIT_TRANSACTION_MISMATCH]: \"doge_deposit_transaction_mismatch\",\n [ZipperReasonCode.LTC_DEPOSIT_TRANSACTION_MISMATCH]: \"ltc_deposit_transaction_mismatch\",\n [ZipperReasonCode.UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS]:\n \"utxo_deposit_source_is_deposit_address\",\n [ZipperReasonCode.SOLANA_DEPOSIT_SIGNATURE_INVALID]: \"solana_deposit_signature_invalid\",\n [ZipperReasonCode.SOLANA_DEPOSIT_TRANSACTION_FAILED]: \"solana_deposit_transaction_failed\",\n [ZipperReasonCode.SOLANA_DEPOSIT_TRANSFER_MISMATCH]: \"solana_deposit_transfer_mismatch\",\n [ZipperReasonCode.XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID]:\n \"xrp_deposit_source_hash_index_invalid\",\n [ZipperReasonCode.XRP_DEPOSIT_SOURCE_ADDRESS_INVALID]: \"xrp_deposit_source_address_invalid\",\n [ZipperReasonCode.XRP_DEPOSIT_ADDRESS_INVALID]: \"xrp_deposit_address_invalid\",\n [ZipperReasonCode.XRP_DEPOSIT_PAYMENT_MISMATCH]: \"xrp_deposit_payment_mismatch\",\n [ZipperReasonCode.REJECTION_UNMAPPED]: \"rejection_unmapped\",\n [ZipperReasonCode.WITHDRAWAL_AMOUNT_INVALID]: \"withdrawal_amount_invalid\",\n [ZipperReasonCode.WITHDRAWAL_AMOUNT_BELOW_MINIMUM]: \"withdrawal_amount_below_minimum\",\n [ZipperReasonCode.WITHDRAWAL_ASSET_INVALID]: \"withdrawal_asset_invalid\",\n [ZipperReasonCode.WITHDRAWAL_SENDER_INVALID]: \"withdrawal_sender_invalid\",\n [ZipperReasonCode.WITHDRAWAL_DESTINATION_INVALID]: \"withdrawal_destination_invalid\",\n [ZipperReasonCode.WITHDRAWAL_ASSET_UNAVAILABLE]: \"withdrawal_asset_unavailable\",\n [ZipperReasonCode.EVM_WITHDRAWAL_DESTINATION_INVALID]: \"evm_withdrawal_destination_invalid\",\n [ZipperReasonCode.BTC_WITHDRAWAL_DESTINATION_INVALID]: \"btc_withdrawal_destination_invalid\",\n [ZipperReasonCode.BCH_WITHDRAWAL_DESTINATION_INVALID]: \"bch_withdrawal_destination_invalid\",\n [ZipperReasonCode.DOGE_WITHDRAWAL_DESTINATION_INVALID]:\n \"doge_withdrawal_destination_invalid\",\n [ZipperReasonCode.LTC_WITHDRAWAL_DESTINATION_INVALID]: \"ltc_withdrawal_destination_invalid\",\n [ZipperReasonCode.SOLANA_WITHDRAWAL_DESTINATION_INVALID]:\n \"solana_withdrawal_destination_invalid\",\n [ZipperReasonCode.XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID]:\n \"xrp_withdrawal_classic_address_invalid\",\n [ZipperReasonCode.XRP_WITHDRAWAL_DESTINATION_TAG_INVALID]:\n \"xrp_withdrawal_destination_tag_invalid\",\n [ZipperReasonCode.WITHDRAWAL_LIQUIDITY_INSUFFICIENT]: \"withdrawal_liquidity_insufficient\",\n [ZipperReasonCode.COMPLIANCE_HIGH_RISK_ADDRESS]: \"compliance_high_risk_address\",\n [ZipperReasonCode.COMPLIANCE_ADDRESS_BLOCKED]: \"compliance_address_blocked\",\n [ZipperReasonCode.COMPLIANCE_ADDRESS_RETURN]: \"compliance_address_return\",\n [ZipperReasonCode.REQUEST_VERIFICATION_REJECTED]: \"request_verification_rejected\",\n [ZipperReasonCode.REJECTED]: \"rejected\",\n [ZipperReasonCode.ERROR_UNMAPPED]: \"error_unmapped\",\n [ZipperReasonCode.ERROR_NETWORK_UNSUPPORTED]: \"error_network_unsupported\",\n [ZipperReasonCode.ERROR_REQUEST_PROCESSING_FAILED]: \"error_request_processing_failed\",\n [ZipperReasonCode.ERROR_REQUEST_VERIFICATION_FAILED]: \"error_request_verification_failed\",\n [ZipperReasonCode.ERROR_RESULT_SUBMISSION_FAILED]: \"error_result_submission_failed\",\n [ZipperReasonCode.ERROR_STATUS_UNKNOWN]: \"error_status_unknown\",\n } satisfies Record<ZipperReasonCode, ZipperReasonCodeValue>,\n} as const;\n\n/**\n * Maps a wire Zipper reason code to its label, preserving uncataloged codes as\n * `unknown_zipper_reason_${code}` instead of failing the whole flow payload.\n */\nexport function zipperReasonFromCode(code: number): ZipperReasonCodeValue {\n const known = ZipperReasonCodeCodec.protoToOutput as Partial<\n Record<number, ZipperReasonCodeValue>\n >;\n return known[code] ?? `unknown_zipper_reason_${code}`;\n}\n"],"mappings":";;;;AAqBA,MAAa,6BAA6B;CAAC;CAAW;CAAY;AAAU;AAG5E,MAAa,8BAA8B;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAGA,MAAa,8BAA8B;CAAC;CAAO;CAAQ;AAAU;AAGrE,MAAa,sCAAsC,CAAC,SAAS,WAAW;AAGxE,MAAa,kCAAkC,CAAC,UAAU,KAAK;AAG/D,MAAa,wBAAwB,CAAC,UAAU,QAAQ;AAGxD,MAAa,iCAAiC,CAAC,iBAAiB,YAAY;AA+E5E,MAAa,2BAA2B,EACpC,eAAe;EACsB,IAAA;EACG,IAAA;EACR,IAAA;EACC,IAAA;EACA,IAAA;EACA,IAAA;AACjC,EACJ;AAEA,MAAa,yBAAyB;CAClC,cAAc;EACV,SAAA;EACA,UAAA;EACA,UAAA;CACJ;CACA,eAAe;GACkB,IAAA;GACJ,IAAA;GACC,IAAA;GACA,IAAA;CAC9B;AACJ;AAEA,MAAa,0BAA0B;CACnC,cAAc;EACV,gBAAA;EACA,yBAAA;EACA,gBAAA;EACA,WAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;CACJ;CACA,eAAe;GACoB,IAAA;GACG,IAAA;GACS,IAAA;GACT,IAAA;GACL,IAAA;GACH,IAAA;GACC,IAAA;GACC,IAAA;CAChC;AACJ;AAEA,MAAa,0BAA0B;CACnC,cAAc;EACV,KAAA;EACA,MAAA;EACA,UAAA;CACJ;CACA,eAAe;GACmB,IAAA;GACR,IAAA;GACM,IAAA;GACI,IAAA;CACpC;AACJ;AAEA,MAAa,kCAAkC;CAC3C,cAAc;EACV,OAAA;EACA,WAAA;CACJ;CACA,eAAe;GACoC,IAAA;GACN,IAAA;GACI,IAAA;CACjD;AACJ;AAEA,MAAa,qBAAqB,EAC9B,cAAc;CACV,QAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,4BAA4B,EACrC,cAAc;CACV,eAAA;CACA,YAAA;AACJ,EACJ;;;;;;;AAQA,MAAa,uBAAuB,EAChC,eAAe;EAC2B,IAAA;EACQ,MAAA;EACD,MAAA;EACO,MAAA;EACJ,MAAA;EACC,MAAA;EACP,MAAA;EAEtC,MAAA;EAC6C,MAAA;EAE7C,MAAA;EAEA,MAAA;EAC8C,MAAA;EACI,MAAA;EACD,MAAA;EACL,MAAA;AACpD,EACJ;;;;;AAMA,SAAgB,wBAAwB,MAAoC;CAIxE,OAHc,qBAAqB,cAGtB,SAAS,kBAAkB;AAC5C;AAEA,MAAa,6BAA6B;CACtC,cAAc;EACV,QAAA;EACA,KAAA;CACJ;CACA,eAAe;GACoB,IAAA;GACL,IAAA;GACH,IAAA;CAC3B;AACJ;AAEA,MAAa,yBAAyB,EAClC,eAAe;EACa,IAAA;EACL,IAAA;EACE,IAAA;EACD,IAAA;EACG,IAAA;EACD,IAAA;EACS,IAAA;EACX,IAAA;EACD,IAAA;EACE,IAAA;EACE,KAAA;EACA,KAAA;AAC3B,EACJ;AAEA,MAAa,uBAAuB;;;;;AAKhC,eAAe;EAC2B,IAAA;EACJ,IAAA;EACQ,IAAA;EACP,IAAA;EACF,IAAA;EACG,IAAA;AACxC,EACJ;AAEA,MAAa,qCAAqC,EAC9C,eAAe;EAC6B,IAAA;EACC,IAAA;EACA,IAAA;EACI,IAAA;AACjD,EACJ;AAEA,MAAa,mCAAmC,EAC5C,eAAe;EACuC,IAAA;EACF,IAAA;EACF,IAAA;EACA,IAAA;AAClD,EACJ;AAEA,MAAa,iCAAiC,EAC1C,eAAe;EACqB,IAAA;EACL,IAAA;EACC,IAAA;EACH,IAAA;AAC7B,EACJ;AAiEA,MAAa,wBAAwB,EACjC,eAAe;EAC4B,IAAA;EACE,OAAA;EACE,OAAA;EACM,OAAA;EACA,OAAA;EACI,OAAA;EACH,OAAA;EACH,OAAA;EACK,OAAA;EACD,OAAA;EACD,OAAA;EACI,OAAA;EACD,OAAA;EACA,OAAA;EACC,OAAA;EACD,OAAA;EAEjD,OAAA;EACiD,OAAA;EACC,OAAA;EACD,OAAA;EAEjD,OAAA;EACmD,OAAA;EACP,OAAA;EACC,OAAA;EACV,OAAA;EACO,OAAA;EACM,OAAA;EACP,OAAA;EACC,OAAA;EACK,OAAA;EACF,OAAA;EACM,OAAA;EACA,OAAA;EACA,OAAA;EAEnD,OAAA;EACmD,OAAA;EAEnD,OAAA;EAEA,OAAA;EAEA,OAAA;EACkD,OAAA;EACL,OAAA;EACF,OAAA;EACD,OAAA;EACI,OAAA;EACrB,OAAA;EACM,MAAA;EACW,OAAA;EACM,OAAA;EACE,OAAA;EACH,OAAA;EACV,OAAA;AAC7C,EACJ;;;;;AAMA,SAAgB,qBAAqB,MAAqC;CAItE,OAHc,sBAAsB,cAGvB,SAAS,yBAAyB;AACnD"}
1
+ {"version":3,"file":"lifecycle.codecs.js","names":[],"sources":["../../../src/services/lifecycle/lifecycle.codecs.ts"],"sourcesContent":["import {\n FlowDomain,\n FlowKind,\n FlowState,\n LifecycleReason,\n LifecycleSource,\n RequestFeeStatus,\n} from \"../../gen/chain/lifecycle/v1/types_pb.js\";\nimport {\n FlowParticipation,\n FlowStep,\n FlowStepActivityKind,\n FlowTimelineStatus,\n ListOrderBy,\n ListScope,\n Sort,\n TxLookupKind,\n} from \"../../gen/chain/lifecycle/v1/lifecycle_read_pb.js\";\nimport { ZipperReasonCode } from \"../../gen/chain/zipper/v1/reason_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const LIFECYCLE_FLOW_KIND_VALUES = [\"deposit\", \"withdraw\", \"transfer\"] as const;\nexport type LifecycleFlowKindValue = (typeof LIFECYCLE_FLOW_KIND_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_STATE_VALUES = [\n \"pending_source\",\n \"pending_polyester_chain\",\n \"pending_ledger\",\n \"completed\",\n \"failed\",\n \"dropped\",\n \"refunded\",\n] as const;\nexport type LifecycleFlowStateValue = (typeof LIFECYCLE_FLOW_STATE_VALUES)[number];\n\nexport const LIFECYCLE_LIST_SCOPE_VALUES = [\"all\", \"open\", \"terminal\"] as const;\nexport type LifecycleListScopeValue = (typeof LIFECYCLE_LIST_SCOPE_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_PARTICIPATION_VALUES = [\"owner\", \"recipient\"] as const;\nexport type LifecycleFlowParticipationValue = (typeof LIFECYCLE_FLOW_PARTICIPATION_VALUES)[number];\n\nexport const LIFECYCLE_TX_LOOKUP_KIND_VALUES = [\"source\", \"any\"] as const;\nexport type LifecycleTxLookupKindValue = (typeof LIFECYCLE_TX_LOOKUP_KIND_VALUES)[number];\n\nexport const LIFECYCLE_SORT_VALUES = [\"newest\", \"oldest\"] as const;\nexport type LifecycleSortValue = (typeof LIFECYCLE_SORT_VALUES)[number];\n\nexport const LIFECYCLE_LIST_ORDER_BY_VALUES = [\"last_activity\", \"started_at\"] as const;\nexport type LifecycleListOrderByValue = (typeof LIFECYCLE_LIST_ORDER_BY_VALUES)[number];\n\nexport const LIFECYCLE_REASON_VALUES = [\n \"unspecified\",\n \"zipper_validation_rejected\",\n \"zipper_execution_rejected\",\n \"zipper_withdraw_execution_failed\",\n \"zipper_deposit_refund_failed\",\n \"zipper_compliance_transferred\",\n \"zipper_deposit_delivered_to_wallet\",\n \"ledger_mirror_rejected\",\n \"ledger_mirror_transfer_exceeds_credits\",\n \"ledger_mirror_transfer_exists\",\n \"ledger_mirror_pending_transfer_not_found\",\n \"ledger_mirror_transfer_id_already_failed\",\n \"trading_withdraw_policy_denied\",\n \"trading_withdraw_contract_reverted\",\n \"trading_withdraw_execution_failed\",\n \"deposit_source_not_confirmed\",\n] as const;\n/**\n * Catalog labels plus a code-preserving fallback for wire values the generated\n * enum does not know. Proto3 enums are open — the backend can emit codes ahead\n * of a contract update — and rejecting them froze flows out of the UI.\n */\nexport type LifecycleReasonValue =\n | (typeof LIFECYCLE_REASON_VALUES)[number]\n | `unknown_reason_${number}`;\n\nexport const LIFECYCLE_FLOW_STEP_VALUES = [\n \"source\",\n \"transfer\",\n \"request\",\n \"validation\",\n \"execution\",\n \"bridge_fulfillment\",\n \"dropped\",\n \"failed\",\n \"refunded\",\n \"fulfilling\",\n \"settlement\",\n] as const;\nexport type LifecycleFlowStepValue = (typeof LIFECYCLE_FLOW_STEP_VALUES)[number];\n\nexport const LIFECYCLE_SOURCE_VALUES = [\n \"unspecified\",\n \"relayer\",\n \"polyester_chain\",\n \"executor\",\n \"ledger\",\n \"lifecycle\",\n] as const;\nexport type LifecycleSourceValue = (typeof LIFECYCLE_SOURCE_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_STEP_ACTIVITY_KIND_VALUES = [\n \"minted\",\n \"funding\",\n \"trading\",\n \"unspecified\",\n] as const;\nexport type LifecycleFlowStepActivityKindValue =\n (typeof LIFECYCLE_FLOW_STEP_ACTIVITY_KIND_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_TIMELINE_STATUS_VALUES = [\"completed\", \"current\", \"planned\"] as const;\nexport type LifecycleFlowTimelineStatusValue =\n (typeof LIFECYCLE_FLOW_TIMELINE_STATUS_VALUES)[number];\n\nexport const LIFECYCLE_REQUEST_FEE_STATUS_VALUES = [\"locked\", \"settled\", \"kept\"] as const;\nexport type LifecycleRequestFeeStatusValue = (typeof LIFECYCLE_REQUEST_FEE_STATUS_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_DOMAIN_VALUES = [\n \"external_chain\",\n \"zipper\",\n \"funding\",\n \"trading\",\n \"lending\",\n] as const;\nexport type LifecycleFlowDomainValue = (typeof LIFECYCLE_FLOW_DOMAIN_VALUES)[number];\n\nexport const LifecycleFlowDomainCodec = {\n protoToOutput: {\n [FlowDomain.DOMAIN_UNSPECIFIED]: \"unspecified\",\n [FlowDomain.DOMAIN_EXTERNAL_CHAIN]: \"external_chain\",\n [FlowDomain.DOMAIN_ZIPPER]: \"zipper\",\n [FlowDomain.DOMAIN_FUNDING]: \"funding\",\n [FlowDomain.DOMAIN_TRADING]: \"trading\",\n [FlowDomain.DOMAIN_LENDING]: \"lending\",\n } satisfies ProtoToOutput<FlowDomain, LifecycleFlowDomainValue>,\n} as const;\n\nexport const LifecycleFlowKindCodec = {\n inputToProto: {\n deposit: FlowKind.KIND_DEPOSIT,\n withdraw: FlowKind.KIND_WITHDRAW,\n transfer: FlowKind.KIND_TRANSFER,\n } satisfies InputToProto<LifecycleFlowKindValue, FlowKind>,\n protoToOutput: {\n [FlowKind.KIND_UNSPECIFIED]: \"unspecified\",\n [FlowKind.KIND_DEPOSIT]: \"deposit\",\n [FlowKind.KIND_WITHDRAW]: \"withdraw\",\n [FlowKind.KIND_TRANSFER]: \"transfer\",\n } satisfies ProtoToOutput<FlowKind, LifecycleFlowKindValue>,\n} as const;\n\nexport const LifecycleFlowStateCodec = {\n inputToProto: {\n pending_source: FlowState.STATE_PENDING_SOURCE,\n pending_polyester_chain: FlowState.STATE_PENDING_POLYESTER_CHAIN,\n pending_ledger: FlowState.STATE_PENDING_LEDGER,\n completed: FlowState.STATE_COMPLETED,\n failed: FlowState.STATE_FAILED,\n dropped: FlowState.STATE_DROPPED,\n refunded: FlowState.STATE_REFUNDED,\n } satisfies InputToProto<LifecycleFlowStateValue, FlowState>,\n protoToOutput: {\n [FlowState.STATE_UNSPECIFIED]: \"unspecified\",\n [FlowState.STATE_PENDING_SOURCE]: \"pending_source\",\n [FlowState.STATE_PENDING_POLYESTER_CHAIN]: \"pending_polyester_chain\",\n [FlowState.STATE_PENDING_LEDGER]: \"pending_ledger\",\n [FlowState.STATE_COMPLETED]: \"completed\",\n [FlowState.STATE_FAILED]: \"failed\",\n [FlowState.STATE_DROPPED]: \"dropped\",\n [FlowState.STATE_REFUNDED]: \"refunded\",\n } satisfies ProtoToOutput<FlowState, LifecycleFlowStateValue>,\n} as const;\n\nexport const LifecycleListScopeCodec = {\n inputToProto: {\n all: ListScope.LIST_ALL,\n open: ListScope.LIST_OPEN_ONLY,\n terminal: ListScope.LIST_TERMINAL_ONLY,\n } satisfies InputToProto<LifecycleListScopeValue, ListScope>,\n protoToOutput: {\n [ListScope.LIST_UNSPECIFIED]: \"unspecified\",\n [ListScope.LIST_ALL]: \"all\",\n [ListScope.LIST_OPEN_ONLY]: \"open\",\n [ListScope.LIST_TERMINAL_ONLY]: \"terminal\",\n } satisfies ProtoToOutput<ListScope, LifecycleListScopeValue>,\n} as const;\n\nexport const LifecycleFlowParticipationCodec = {\n inputToProto: {\n owner: FlowParticipation.PARTICIPATION_OWNER,\n recipient: FlowParticipation.PARTICIPATION_RECIPIENT,\n } satisfies InputToProto<LifecycleFlowParticipationValue, FlowParticipation>,\n protoToOutput: {\n [FlowParticipation.PARTICIPATION_UNSPECIFIED]: \"unspecified\",\n [FlowParticipation.PARTICIPATION_OWNER]: \"owner\",\n [FlowParticipation.PARTICIPATION_RECIPIENT]: \"recipient\",\n } satisfies ProtoToOutput<FlowParticipation, LifecycleFlowParticipationValue>,\n} as const;\n\nexport const LifecycleSortCodec = {\n inputToProto: {\n newest: Sort.NEWEST,\n oldest: Sort.OLDEST,\n } satisfies InputToProto<LifecycleSortValue, Sort>,\n} as const;\n\nexport const LifecycleListOrderByCodec = {\n inputToProto: {\n last_activity: ListOrderBy.ORDER_BY_LAST_ACTIVITY,\n started_at: ListOrderBy.ORDER_BY_STARTED_AT,\n } satisfies InputToProto<LifecycleListOrderByValue, ListOrderBy>,\n} as const;\n\n/**\n * LifecycleReason is a stable product-facing reason catalog. Unlike the other\n * lifecycle enums, `REASON_UNSPECIFIED` (0) is a valid wire value — it is\n * the normal state for flows without a notable reason — so the codec maps the\n * full enum including zero.\n */\nexport const LifecycleReasonCodec = {\n protoToOutput: {\n [LifecycleReason.REASON_UNSPECIFIED]: \"unspecified\",\n [LifecycleReason.ZIPPER_VALIDATION_REJECTED]: \"zipper_validation_rejected\",\n [LifecycleReason.ZIPPER_EXECUTION_REJECTED]: \"zipper_execution_rejected\",\n [LifecycleReason.ZIPPER_WITHDRAW_EXECUTION_FAILED]: \"zipper_withdraw_execution_failed\",\n [LifecycleReason.ZIPPER_DEPOSIT_REFUND_FAILED]: \"zipper_deposit_refund_failed\",\n [LifecycleReason.ZIPPER_COMPLIANCE_TRANSFERRED]: \"zipper_compliance_transferred\",\n [LifecycleReason.ZIPPER_DEPOSIT_DELIVERED_TO_WALLET]: \"zipper_deposit_delivered_to_wallet\",\n [LifecycleReason.LEDGER_MIRROR_REJECTED]: \"ledger_mirror_rejected\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_EXCEEDS_CREDITS]:\n \"ledger_mirror_transfer_exceeds_credits\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_EXISTS]: \"ledger_mirror_transfer_exists\",\n [LifecycleReason.LEDGER_MIRROR_PENDING_TRANSFER_NOT_FOUND]:\n \"ledger_mirror_pending_transfer_not_found\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_ID_ALREADY_FAILED]:\n \"ledger_mirror_transfer_id_already_failed\",\n [LifecycleReason.TRADING_WITHDRAW_POLICY_DENIED]: \"trading_withdraw_policy_denied\",\n [LifecycleReason.TRADING_WITHDRAW_CONTRACT_REVERTED]: \"trading_withdraw_contract_reverted\",\n [LifecycleReason.TRADING_WITHDRAW_EXECUTION_FAILED]: \"trading_withdraw_execution_failed\",\n [LifecycleReason.DEPOSIT_SOURCE_NOT_CONFIRMED]: \"deposit_source_not_confirmed\",\n } satisfies Record<LifecycleReason, LifecycleReasonValue>,\n} as const;\n\n/**\n * Maps a wire reason code to its catalog label, preserving uncataloged codes\n * as `unknown_reason_${code}` instead of failing the whole flow payload.\n */\nexport function lifecycleReasonFromCode(code: number): LifecycleReasonValue {\n const known = LifecycleReasonCodec.protoToOutput as Partial<\n Record<number, LifecycleReasonValue>\n >;\n return known[code] ?? `unknown_reason_${code}`;\n}\n\nexport const LifecycleTxLookupKindCodec = {\n inputToProto: {\n source: TxLookupKind.TX_SOURCE,\n any: TxLookupKind.TX_ANY,\n } satisfies InputToProto<LifecycleTxLookupKindValue, TxLookupKind>,\n protoToOutput: {\n [TxLookupKind.TX_UNSPECIFIED]: \"unspecified\",\n [TxLookupKind.TX_SOURCE]: \"source\",\n [TxLookupKind.TX_ANY]: \"any\",\n } satisfies ProtoToOutput<TxLookupKind, LifecycleTxLookupKindValue>,\n} as const;\n\nexport const LifecycleFlowStepCodec = {\n protoToOutput: {\n [FlowStep.UNSPECIFIED]: \"unspecified\",\n [FlowStep.SOURCE]: \"source\",\n [FlowStep.TRANSFER]: \"transfer\",\n [FlowStep.REQUEST]: \"request\",\n [FlowStep.VALIDATION]: \"validation\",\n [FlowStep.EXECUTION]: \"execution\",\n [FlowStep.BRIDGE_FULFILLMENT]: \"bridge_fulfillment\",\n [FlowStep.DROPPED]: \"dropped\",\n [FlowStep.FAILED]: \"failed\",\n [FlowStep.REFUNDED]: \"refunded\",\n [FlowStep.FULFILLING]: \"fulfilling\",\n [FlowStep.SETTLEMENT]: \"settlement\",\n } satisfies ProtoToOutput<FlowStep, LifecycleFlowStepValue>,\n} as const;\n\nexport const LifecycleSourceCodec = {\n /**\n * In-progress flows may emit SOURCE_UNSPECIFIED (0) before a subsystem is\n * attributed, so zero must decode like other lifecycle \"unspecified\" enums.\n */\n protoToOutput: {\n [LifecycleSource.SOURCE_UNSPECIFIED]: \"unspecified\",\n [LifecycleSource.SOURCE_RELAYER]: \"relayer\",\n [LifecycleSource.SOURCE_POLYESTER_CHAIN]: \"polyester_chain\",\n [LifecycleSource.SOURCE_EXECUTOR]: \"executor\",\n [LifecycleSource.SOURCE_LEDGER]: \"ledger\",\n [LifecycleSource.SOURCE_LIFECYCLE]: \"lifecycle\",\n } satisfies Record<LifecycleSource, LifecycleSourceValue>,\n} as const;\n\nexport const LifecycleFlowStepActivityKindCodec = {\n protoToOutput: {\n [FlowStepActivityKind.ACTIVITY_MINTED]: \"minted\",\n [FlowStepActivityKind.ACTIVITY_FUNDING]: \"funding\",\n [FlowStepActivityKind.ACTIVITY_TRADING]: \"trading\",\n [FlowStepActivityKind.ACTIVITY_UNSPECIFIED]: \"unspecified\",\n } satisfies Record<FlowStepActivityKind, LifecycleFlowStepActivityKindValue>,\n} as const;\n\nexport const LifecycleFlowTimelineStatusCodec = {\n protoToOutput: {\n [FlowTimelineStatus.TIMELINE_STATUS_UNSPECIFIED]: \"unspecified\",\n [FlowTimelineStatus.TIMELINE_STATUS_COMPLETED]: \"completed\",\n [FlowTimelineStatus.TIMELINE_STATUS_CURRENT]: \"current\",\n [FlowTimelineStatus.TIMELINE_STATUS_PLANNED]: \"planned\",\n } satisfies ProtoToOutput<FlowTimelineStatus, LifecycleFlowTimelineStatusValue>,\n} as const;\n\nexport const LifecycleRequestFeeStatusCodec = {\n protoToOutput: {\n [RequestFeeStatus.UNSPECIFIED]: \"unspecified\",\n [RequestFeeStatus.LOCKED]: \"locked\",\n [RequestFeeStatus.SETTLED]: \"settled\",\n [RequestFeeStatus.KEPT]: \"kept\",\n } satisfies ProtoToOutput<RequestFeeStatus, LifecycleRequestFeeStatusValue>,\n} as const;\n\n/**\n * Zipper's exact outcome code, for branching on the outcome. Show `message`, or look up copy by\n * `reasonId`, rather than keying display text on this code: a withdrawal whose execution failed\n * keeps its code while `reasonId` and `message` say it is under review.\n */\nexport const ZIPPER_REASON_CODE_VALUES = [\n \"unspecified\",\n \"deposit_wait_expired\",\n \"deposit_amount_invalid\",\n \"deposit_amount_below_minimum\",\n \"deposit_amount_not_above_fee\",\n \"deposit_net_amount_below_minimum\",\n \"evm_deposit_source_tx_invalid\",\n \"evm_deposit_source_tx_zero\",\n \"evm_deposit_source_tx_not_found\",\n \"evm_deposit_source_tx_reverted\",\n \"evm_deposit_transfer_mismatch\",\n \"utxo_deposit_transaction_mismatch\",\n \"btc_deposit_transaction_mismatch\",\n \"bch_deposit_transaction_mismatch\",\n \"doge_deposit_transaction_mismatch\",\n \"ltc_deposit_transaction_mismatch\",\n \"utxo_deposit_source_is_deposit_address\",\n \"solana_deposit_signature_invalid\",\n \"solana_deposit_transaction_failed\",\n \"solana_deposit_transfer_mismatch\",\n \"xrp_deposit_source_hash_index_invalid\",\n \"xrp_deposit_source_address_invalid\",\n \"xrp_deposit_address_invalid\",\n \"xrp_deposit_payment_mismatch\",\n \"rejection_unmapped\",\n \"withdrawal_amount_invalid\",\n \"withdrawal_amount_below_minimum\",\n \"withdrawal_asset_invalid\",\n \"withdrawal_sender_invalid\",\n \"withdrawal_destination_invalid\",\n \"withdrawal_asset_unavailable\",\n \"evm_withdrawal_destination_invalid\",\n \"btc_withdrawal_destination_invalid\",\n \"bch_withdrawal_destination_invalid\",\n \"doge_withdrawal_destination_invalid\",\n \"ltc_withdrawal_destination_invalid\",\n \"solana_withdrawal_destination_invalid\",\n \"xrp_withdrawal_classic_address_invalid\",\n \"xrp_withdrawal_destination_tag_invalid\",\n \"withdrawal_liquidity_insufficient\",\n \"compliance_high_risk_address\",\n \"compliance_address_blocked\",\n \"compliance_address_return\",\n \"request_verification_rejected\",\n \"rejected\",\n \"error_unmapped\",\n \"error_network_unsupported\",\n \"error_request_processing_failed\",\n \"error_request_verification_failed\",\n \"error_result_submission_failed\",\n \"error_status_unknown\",\n] as const;\n\nexport type ZipperReasonCodeValue =\n | (typeof ZIPPER_REASON_CODE_VALUES)[number]\n | `unknown_zipper_reason_${number}`;\n\nexport const ZipperReasonCodeCodec = {\n protoToOutput: {\n [ZipperReasonCode.REASON_UNSPECIFIED]: \"unspecified\",\n [ZipperReasonCode.DEPOSIT_WAIT_EXPIRED]: \"deposit_wait_expired\",\n [ZipperReasonCode.DEPOSIT_AMOUNT_INVALID]: \"deposit_amount_invalid\",\n [ZipperReasonCode.DEPOSIT_AMOUNT_BELOW_MINIMUM]: \"deposit_amount_below_minimum\",\n [ZipperReasonCode.DEPOSIT_AMOUNT_NOT_ABOVE_FEE]: \"deposit_amount_not_above_fee\",\n [ZipperReasonCode.DEPOSIT_NET_AMOUNT_BELOW_MINIMUM]: \"deposit_net_amount_below_minimum\",\n [ZipperReasonCode.EVM_DEPOSIT_SOURCE_TX_INVALID]: \"evm_deposit_source_tx_invalid\",\n [ZipperReasonCode.EVM_DEPOSIT_SOURCE_TX_ZERO]: \"evm_deposit_source_tx_zero\",\n [ZipperReasonCode.EVM_DEPOSIT_SOURCE_TX_NOT_FOUND]: \"evm_deposit_source_tx_not_found\",\n [ZipperReasonCode.EVM_DEPOSIT_SOURCE_TX_REVERTED]: \"evm_deposit_source_tx_reverted\",\n [ZipperReasonCode.EVM_DEPOSIT_TRANSFER_MISMATCH]: \"evm_deposit_transfer_mismatch\",\n [ZipperReasonCode.UTXO_DEPOSIT_TRANSACTION_MISMATCH]: \"utxo_deposit_transaction_mismatch\",\n [ZipperReasonCode.BTC_DEPOSIT_TRANSACTION_MISMATCH]: \"btc_deposit_transaction_mismatch\",\n [ZipperReasonCode.BCH_DEPOSIT_TRANSACTION_MISMATCH]: \"bch_deposit_transaction_mismatch\",\n [ZipperReasonCode.DOGE_DEPOSIT_TRANSACTION_MISMATCH]: \"doge_deposit_transaction_mismatch\",\n [ZipperReasonCode.LTC_DEPOSIT_TRANSACTION_MISMATCH]: \"ltc_deposit_transaction_mismatch\",\n [ZipperReasonCode.UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS]:\n \"utxo_deposit_source_is_deposit_address\",\n [ZipperReasonCode.SOLANA_DEPOSIT_SIGNATURE_INVALID]: \"solana_deposit_signature_invalid\",\n [ZipperReasonCode.SOLANA_DEPOSIT_TRANSACTION_FAILED]: \"solana_deposit_transaction_failed\",\n [ZipperReasonCode.SOLANA_DEPOSIT_TRANSFER_MISMATCH]: \"solana_deposit_transfer_mismatch\",\n [ZipperReasonCode.XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID]:\n \"xrp_deposit_source_hash_index_invalid\",\n [ZipperReasonCode.XRP_DEPOSIT_SOURCE_ADDRESS_INVALID]: \"xrp_deposit_source_address_invalid\",\n [ZipperReasonCode.XRP_DEPOSIT_ADDRESS_INVALID]: \"xrp_deposit_address_invalid\",\n [ZipperReasonCode.XRP_DEPOSIT_PAYMENT_MISMATCH]: \"xrp_deposit_payment_mismatch\",\n [ZipperReasonCode.REJECTION_UNMAPPED]: \"rejection_unmapped\",\n [ZipperReasonCode.WITHDRAWAL_AMOUNT_INVALID]: \"withdrawal_amount_invalid\",\n [ZipperReasonCode.WITHDRAWAL_AMOUNT_BELOW_MINIMUM]: \"withdrawal_amount_below_minimum\",\n [ZipperReasonCode.WITHDRAWAL_ASSET_INVALID]: \"withdrawal_asset_invalid\",\n [ZipperReasonCode.WITHDRAWAL_SENDER_INVALID]: \"withdrawal_sender_invalid\",\n [ZipperReasonCode.WITHDRAWAL_DESTINATION_INVALID]: \"withdrawal_destination_invalid\",\n [ZipperReasonCode.WITHDRAWAL_ASSET_UNAVAILABLE]: \"withdrawal_asset_unavailable\",\n [ZipperReasonCode.EVM_WITHDRAWAL_DESTINATION_INVALID]: \"evm_withdrawal_destination_invalid\",\n [ZipperReasonCode.BTC_WITHDRAWAL_DESTINATION_INVALID]: \"btc_withdrawal_destination_invalid\",\n [ZipperReasonCode.BCH_WITHDRAWAL_DESTINATION_INVALID]: \"bch_withdrawal_destination_invalid\",\n [ZipperReasonCode.DOGE_WITHDRAWAL_DESTINATION_INVALID]:\n \"doge_withdrawal_destination_invalid\",\n [ZipperReasonCode.LTC_WITHDRAWAL_DESTINATION_INVALID]: \"ltc_withdrawal_destination_invalid\",\n [ZipperReasonCode.SOLANA_WITHDRAWAL_DESTINATION_INVALID]:\n \"solana_withdrawal_destination_invalid\",\n [ZipperReasonCode.XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID]:\n \"xrp_withdrawal_classic_address_invalid\",\n [ZipperReasonCode.XRP_WITHDRAWAL_DESTINATION_TAG_INVALID]:\n \"xrp_withdrawal_destination_tag_invalid\",\n [ZipperReasonCode.WITHDRAWAL_LIQUIDITY_INSUFFICIENT]: \"withdrawal_liquidity_insufficient\",\n [ZipperReasonCode.COMPLIANCE_HIGH_RISK_ADDRESS]: \"compliance_high_risk_address\",\n [ZipperReasonCode.COMPLIANCE_ADDRESS_BLOCKED]: \"compliance_address_blocked\",\n [ZipperReasonCode.COMPLIANCE_ADDRESS_RETURN]: \"compliance_address_return\",\n [ZipperReasonCode.REQUEST_VERIFICATION_REJECTED]: \"request_verification_rejected\",\n [ZipperReasonCode.REJECTED]: \"rejected\",\n [ZipperReasonCode.ERROR_UNMAPPED]: \"error_unmapped\",\n [ZipperReasonCode.ERROR_NETWORK_UNSUPPORTED]: \"error_network_unsupported\",\n [ZipperReasonCode.ERROR_REQUEST_PROCESSING_FAILED]: \"error_request_processing_failed\",\n [ZipperReasonCode.ERROR_REQUEST_VERIFICATION_FAILED]: \"error_request_verification_failed\",\n [ZipperReasonCode.ERROR_RESULT_SUBMISSION_FAILED]: \"error_result_submission_failed\",\n [ZipperReasonCode.ERROR_STATUS_UNKNOWN]: \"error_status_unknown\",\n } satisfies Record<ZipperReasonCode, ZipperReasonCodeValue>,\n} as const;\n\n/**\n * Maps a wire Zipper reason code to its label, preserving uncataloged codes as\n * `unknown_zipper_reason_${code}` instead of failing the whole flow payload.\n */\nexport function zipperReasonFromCode(code: number): ZipperReasonCodeValue {\n const known = ZipperReasonCodeCodec.protoToOutput as Partial<\n Record<number, ZipperReasonCodeValue>\n >;\n return known[code] ?? `unknown_zipper_reason_${code}`;\n}\n"],"mappings":"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"}
@@ -1,8 +1,9 @@
1
- import { PublicApiTransports } from "../../shared/transports.js";
1
+ import { AuthAndPublicApiTransports } from "../../shared/transports.js";
2
2
  import { PolyesterRequestOptions } from "../../shared/request-options.js";
3
+ import { SubaccountResolver } from "../subaccount-resolver.js";
3
4
  import { PolyesterRealtime } from "../../realtime/types.js";
4
5
  import { BaseSubscribeInput } from "../../shared/types.js";
5
- import { GetLifecycleFlowInput, GetLifecycleFlowOutput, LifecycleFlowDetail, LifecycleFlowSummary, ListLifecycleFlowsByTxInput, ListLifecycleFlowsByTxOutput, ListLifecycleFlowsInput, ListLifecycleFlowsOutput } from "./lifecycle.schemas.js";
6
+ import { GetLifecycleAccountFlowInput, GetLifecycleFlowInput, GetLifecycleFlowOutput, LifecycleFlowDetail, LifecycleFlowSummary, ListLifecycleAccountFlowsInput, ListLifecycleFlowsByTxInput, ListLifecycleFlowsByTxOutput, ListLifecycleFlowsInput, ListLifecycleFlowsOutput } from "./lifecycle.schemas.js";
6
7
  //#region src/services/lifecycle/lifecycle.d.ts
7
8
  interface SubscribeOpenLifecycleFlowsInput extends BaseSubscribeInput<LifecycleFlowSummary> {
8
9
  accountId?: string;
@@ -15,18 +16,35 @@ interface SubscribeLifecycleFlowDetailInput extends BaseSubscribeInput<Lifecycle
15
16
  */
16
17
  declare class LifecycleService {
17
18
  #private;
18
- constructor(transports: PublicApiTransports, realtime: PolyesterRealtime);
19
+ constructor(transports: AuthAndPublicApiTransports, realtime: PolyesterRealtime, resolver?: SubaccountResolver);
19
20
  /**
20
21
  * Returns paginated lifecycle flow summaries filtered by kind, state, scope, account selector, transaction reference, chain ids, and asset ids. The response is ordered by the selected timestamp and includes an opaque next page token.
21
22
  *
22
- * With an `accountSelector`, the list holds the flows the account owns and the
23
- * transfers it receives from other accounts; each row's `participation` says which.
24
- * Pass `participation: "owner"` for the owned flows only. A `pageToken` only resumes
25
- * the request it came from: change nothing but `limit` between pages.
23
+ * Lists only flows a chain transaction started. With an `accountSelector` (a smart
24
+ * account address), the list holds the flows the account owns and the transfers it
25
+ * receives from other accounts; each row's `participation` says which. Pass
26
+ * `participation: "owner"` for the owned flows only. A `pageToken` only resumes the
27
+ * request it came from: change nothing but `limit` between pages. Use `listAccountFlows`
28
+ * for every flow of the signed-in account.
26
29
  */
27
30
  listFlows(input: ListLifecycleFlowsInput, options?: PolyesterRequestOptions): Promise<ListLifecycleFlowsOutput>;
28
31
  /**
29
- * Fetches one lifecycle flow by its public flow id and returns summary, factual steps, timeline, and live-state detail when available.
32
+ * Lists the signed-in account's flows: the ones it owns and the transfers it receives,
33
+ * including flows no chain transaction started, such as transfers between Trading accounts.
34
+ * Each row's `participation` says which. Takes the same filters as `listFlows`; a
35
+ * `pageToken` only resumes the request it came from. API keys need `read-funding-flows`.
36
+ */
37
+ listAccountFlows(input?: ListLifecycleAccountFlowsInput, options?: PolyesterRequestOptions): Promise<ListLifecycleFlowsOutput>;
38
+ /**
39
+ * Fetches one flow the signed-in account owns or receives, including one no chain
40
+ * transaction started. A flow the account takes no part in throws `ResourceNotFoundError`. API keys
41
+ * need `read-funding-flows`.
42
+ */
43
+ getAccountFlow(input: GetLifecycleAccountFlowInput, options?: PolyesterRequestOptions): Promise<GetLifecycleFlowOutput>;
44
+ /**
45
+ * Fetches one lifecycle flow by its public flow id and returns summary, factual steps,
46
+ * timeline, and live-state detail when available. Finds only flows a chain transaction
47
+ * started; the account reads its other flows with `getAccountFlow`.
30
48
  */
31
49
  getFlow(input: GetLifecycleFlowInput, options?: PolyesterRequestOptions): Promise<GetLifecycleFlowOutput>;
32
50
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"mappings":";;;;;;UAqCU,yCAAyC,mBAAmB;EAClE;;UAGM,0CAA0C,mBAAmB;EACnE;;;;;cAMS;;EAIG,YAAA,YAAY,qBAAqB,UAAU;;;;;;;;;EAajD,UACF,OAAO,yBACP,UAAU,0BACX,QAAQ;;;;EAUL,QACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;;;EAYL,cACF,OAAO,6BACP,UAAU,0BACX,QAAQ;;;;EAYX,mBAAmB,OAAO;;;;EAqB1B,oBAAoB,OAAO"}
1
+ {"version":3,"file":"lifecycle.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"mappings":";;;;;;;UA0CU,yCAAyC,mBAAmB;EAClE;;UAGM,0CAA0C,mBAAmB;EACnE;;;;;cAMS;;EAOL,YAAA,YAAY,4BACZ,UAAU,mBACV,WAAW;;;;;;;;;;;EAkBT,UACF,OAAO,yBACP,UAAU,0BACX,QAAQ;;;;;;;EAaL,iBACF,QAAO,gCACP,UAAU,0BACX,QAAQ;;;;;;EAeL,eACF,OAAO,8BACP,UAAU,0BACX,QAAQ;;;;;;EAeL,QACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;;;EAYL,cACF,OAAO,6BACP,UAAU,0BACX,QAAQ;;;;EAYX,mBAAmB,OAAO;;;;EAqB1B,oBAAoB,OAAO"}
@@ -1,29 +1,36 @@
1
- import { isDev } from "../../utils/is-dev.js";
2
- import { FlowDetailViewSchema, FlowSummaryViewSchema, GetFlowByIdRequestSchema, LifecycleReadService } from "../../gen/chain/lifecycle/v1/lifecycle_read_pb.js";
3
1
  import { parse } from "../../shared/validation.js";
4
2
  import { toConnectCallOptions } from "../../shared/request-options.js";
5
- import { GetLifecycleFlowInputSchema, GetLifecycleFlowOutputSchema, LifecycleFlowDetailSchema, LifecycleFlowSummarySchema, ListLifecycleFlowsByTxInputSchema, ListLifecycleFlowsByTxOutputSchema, ListLifecycleFlowsInputSchema, ListLifecycleFlowsOutputSchema } from "./lifecycle.schemas.js";
6
- import * as v from "valibot";
3
+ import { resolveAccountScopedInput } from "../subaccount-resolver.js";
4
+ import { FlowDetailViewSchema, FlowSummaryViewSchema, GetFlowByIdRequestSchema, LifecycleReadService } from "../../gen/chain/lifecycle/v1/lifecycle_read_pb.js";
5
+ import { isDev } from "../../utils/is-dev.js";
6
+ import { GetLifecycleAccountFlowInputSchema, GetLifecycleFlowInputSchema, GetLifecycleFlowOutputSchema, LifecycleFlowDetailSchema, LifecycleFlowSummarySchema, ListLifecycleAccountFlowsInputSchema, ListLifecycleFlowsByTxInputSchema, ListLifecycleFlowsByTxOutputSchema, ListLifecycleFlowsInputSchema, ListLifecycleFlowsOutputSchema } from "./lifecycle.schemas.js";
7
7
  import { create } from "@bufbuild/protobuf";
8
8
  import { createClient } from "@connectrpc/connect";
9
+ import * as v from "valibot";
9
10
  //#region src/services/lifecycle/lifecycle.ts
10
11
  /**
11
12
  * Reads and streams chain lifecycle flow state, history, progress, and transaction matches.
12
13
  */
13
14
  var LifecycleService = class {
14
15
  #client;
16
+ #authClient;
15
17
  #realtime;
16
- constructor(transports, realtime) {
18
+ #resolver;
19
+ constructor(transports, realtime, resolver) {
17
20
  this.#client = createClient(LifecycleReadService, transports.publicApi);
21
+ this.#authClient = createClient(LifecycleReadService, transports.authApi);
18
22
  this.#realtime = realtime;
23
+ this.#resolver = resolver;
19
24
  }
20
25
  /**
21
26
  * Returns paginated lifecycle flow summaries filtered by kind, state, scope, account selector, transaction reference, chain ids, and asset ids. The response is ordered by the selected timestamp and includes an opaque next page token.
22
27
  *
23
- * With an `accountSelector`, the list holds the flows the account owns and the
24
- * transfers it receives from other accounts; each row's `participation` says which.
25
- * Pass `participation: "owner"` for the owned flows only. A `pageToken` only resumes
26
- * the request it came from: change nothing but `limit` between pages.
28
+ * Lists only flows a chain transaction started. With an `accountSelector` (a smart
29
+ * account address), the list holds the flows the account owns and the transfers it
30
+ * receives from other accounts; each row's `participation` says which. Pass
31
+ * `participation: "owner"` for the owned flows only. A `pageToken` only resumes the
32
+ * request it came from: change nothing but `limit` between pages. Use `listAccountFlows`
33
+ * for every flow of the signed-in account.
27
34
  */
28
35
  async listFlows(input, options) {
29
36
  const parsedInput = parse(ListLifecycleFlowsInputSchema, input);
@@ -31,7 +38,32 @@ var LifecycleService = class {
31
38
  return parse(ListLifecycleFlowsOutputSchema, response);
32
39
  }
33
40
  /**
34
- * Fetches one lifecycle flow by its public flow id and returns summary, factual steps, timeline, and live-state detail when available.
41
+ * Lists the signed-in account's flows: the ones it owns and the transfers it receives,
42
+ * including flows no chain transaction started, such as transfers between Trading accounts.
43
+ * Each row's `participation` says which. Takes the same filters as `listFlows`; a
44
+ * `pageToken` only resumes the request it came from. API keys need `read-funding-flows`.
45
+ */
46
+ async listAccountFlows(input = {}, options) {
47
+ const resolved = resolveAccountScopedInput(input, this.#resolver);
48
+ const request = parse(ListLifecycleAccountFlowsInputSchema, resolved);
49
+ const response = await this.#authClient.listAccountFlows(request, toConnectCallOptions(options));
50
+ return parse(ListLifecycleFlowsOutputSchema, response);
51
+ }
52
+ /**
53
+ * Fetches one flow the signed-in account owns or receives, including one no chain
54
+ * transaction started. A flow the account takes no part in throws `ResourceNotFoundError`. API keys
55
+ * need `read-funding-flows`.
56
+ */
57
+ async getAccountFlow(input, options) {
58
+ const resolved = resolveAccountScopedInput(input, this.#resolver);
59
+ const request = parse(GetLifecycleAccountFlowInputSchema, resolved);
60
+ const response = await this.#authClient.getAccountFlow(request, toConnectCallOptions(options));
61
+ return parse(GetLifecycleFlowOutputSchema, response);
62
+ }
63
+ /**
64
+ * Fetches one lifecycle flow by its public flow id and returns summary, factual steps,
65
+ * timeline, and live-state detail when available. Finds only flows a chain transaction
66
+ * started; the account reads its other flows with `getAccountFlow`.
35
67
  */
36
68
  async getFlow(input, options) {
37
69
  const parsedInput = parse(GetLifecycleFlowInputSchema, input);
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.js","names":["#client","#realtime"],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport { create } from \"@bufbuild/protobuf\";\nimport {\n FlowDetailViewSchema,\n FlowSummaryViewSchema,\n GetFlowByIdRequestSchema,\n LifecycleReadService,\n} from \"../../gen/chain/lifecycle/v1/lifecycle_read_pb.js\";\nimport type { PolyesterRealtime } from \"../../realtime/types.js\";\nimport type { PublicApiTransports } from \"../../shared/transports.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { isDev } from \"../../utils/is-dev.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n GetLifecycleFlowInputSchema,\n GetLifecycleFlowOutputSchema,\n LifecycleFlowDetailSchema,\n LifecycleFlowSummarySchema,\n ListLifecycleFlowsByTxOutputSchema,\n ListLifecycleFlowsByTxInputSchema,\n ListLifecycleFlowsOutputSchema,\n ListLifecycleFlowsInputSchema,\n type GetLifecycleFlowInput,\n type GetLifecycleFlowOutput,\n type LifecycleFlowDetail,\n type LifecycleFlowSummary,\n type ListLifecycleFlowsByTxInput,\n type ListLifecycleFlowsByTxOutput,\n type ListLifecycleFlowsInput,\n type ListLifecycleFlowsOutput,\n} from \"./lifecycle.schemas.js\";\n\ninterface SubscribeOpenLifecycleFlowsInput extends BaseSubscribeInput<LifecycleFlowSummary> {\n accountId?: string;\n}\n\ninterface SubscribeLifecycleFlowDetailInput extends BaseSubscribeInput<LifecycleFlowDetail> {\n flowId: string;\n}\n\n/**\n * Reads and streams chain lifecycle flow state, history, progress, and transaction matches.\n */\nexport class LifecycleService {\n #client: Client<typeof LifecycleReadService>;\n #realtime: PolyesterRealtime;\n\n constructor(transports: PublicApiTransports, realtime: PolyesterRealtime) {\n this.#client = createClient(LifecycleReadService, transports.publicApi);\n this.#realtime = realtime;\n }\n\n /**\n * Returns paginated lifecycle flow summaries filtered by kind, state, scope, account selector, transaction reference, chain ids, and asset ids. The response is ordered by the selected timestamp and includes an opaque next page token.\n *\n * With an `accountSelector`, the list holds the flows the account owns and the\n * transfers it receives from other accounts; each row's `participation` says which.\n * Pass `participation: \"owner\"` for the owned flows only. A `pageToken` only resumes\n * the request it came from: change nothing but `limit` between pages.\n */\n async listFlows(\n input: ListLifecycleFlowsInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsOutput> {\n const parsedInput = parse(ListLifecycleFlowsInputSchema, input);\n const response = await this.#client.listFlows(parsedInput, toConnectCallOptions(options));\n const res = parse(ListLifecycleFlowsOutputSchema, response);\n return res;\n }\n\n /**\n * Fetches one lifecycle flow by its public flow id and returns summary, factual steps, timeline, and live-state detail when available.\n */\n async getFlow(\n input: GetLifecycleFlowInput,\n options?: PolyesterRequestOptions,\n ): Promise<GetLifecycleFlowOutput> {\n const parsedInput = parse(GetLifecycleFlowInputSchema, input);\n const response = await this.#client.getFlowById(\n create(GetFlowByIdRequestSchema, parsedInput),\n toConnectCallOptions(options),\n );\n return parse(GetLifecycleFlowOutputSchema, response);\n }\n\n /**\n * Searches lifecycle flows that reference a 0x-prefixed transaction hash, using source-only or any-reference lookup mode. A single transaction may match zero, one, or many flows.\n */\n async listFlowsByTx(\n input: ListLifecycleFlowsByTxInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsByTxOutput> {\n const parsedInput = parse(ListLifecycleFlowsByTxInputSchema, input);\n const response = await this.#client.listFlowsByTx(\n parsedInput,\n toConnectCallOptions(options),\n );\n return parse(ListLifecycleFlowsByTxOutputSchema, response);\n }\n\n /**\n * Subscribes to open lifecycle flow summary updates, using private:chain:lifecycle:flows:{accountId}:proto when an account id is provided and the public flow channel otherwise.\n */\n subscribeOpenFlows(input: SubscribeOpenLifecycleFlowsInput): () => void {\n const accountId = input.accountId?.trim();\n const channel = accountId\n ? `private:chain:lifecycle:flows:${accountId}:proto`\n : \"public:chain:lifecycle:flows:proto\";\n return this.#realtime.connectProtoChannel({\n channel,\n schema: FlowSummaryViewSchema,\n onPublication: (data) => {\n const flow = parse(LifecycleFlowSummarySchema, data);\n input.onEvent(flow);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n\n /**\n * Subscribes to detail updates for one lifecycle flow on public:chain:lifecycle:flow:{flowId}:proto. Invalid flow ids are rejected locally with a no-op unsubscribe function.\n */\n subscribeFlowDetail(input: SubscribeLifecycleFlowDetailInput): () => void {\n const parsedFlowId = v.safeParse(GetLifecycleFlowInputSchema, { flowId: input.flowId });\n if (!parsedFlowId.success) {\n if (isDev()) {\n console.error(\n \"[LifecycleService] flowId is required for flow detail subscription.\",\n );\n }\n return () => {};\n }\n\n const channel = `public:chain:lifecycle:flow:${parsedFlowId.output.flowId}:proto`;\n return this.#realtime.connectProtoChannel({\n channel,\n schema: FlowDetailViewSchema,\n onPublication: (data) => {\n const flow = parse(LifecycleFlowDetailSchema, data);\n input.onEvent(flow);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAgDA,IAAa,mBAAb,MAA8B;CAC1B;CACA;CAEA,YAAY,YAAiC,UAA6B;EACtE,KAAKA,UAAU,aAAa,sBAAsB,WAAW,SAAS;EACtE,KAAKC,YAAY;CACrB;;;;;;;;;CAUA,MAAM,UACF,OACA,SACiC;EACjC,MAAM,cAAc,MAAM,+BAA+B,KAAK;EAC9D,MAAM,WAAW,MAAM,KAAKD,QAAQ,UAAU,aAAa,qBAAqB,OAAO,CAAC;EAExF,OADY,MAAM,gCAAgC,QACzC;CACb;;;;CAKA,MAAM,QACF,OACA,SAC+B;EAC/B,MAAM,cAAc,MAAM,6BAA6B,KAAK;EAC5D,MAAM,WAAW,MAAM,KAAKA,QAAQ,YAChC,OAAO,0BAA0B,WAAW,GAC5C,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,8BAA8B,QAAQ;CACvD;;;;CAKA,MAAM,cACF,OACA,SACqC;EACrC,MAAM,cAAc,MAAM,mCAAmC,KAAK;EAClE,MAAM,WAAW,MAAM,KAAKA,QAAQ,cAChC,aACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,oCAAoC,QAAQ;CAC7D;;;;CAKA,mBAAmB,OAAqD;EACpE,MAAM,YAAY,MAAM,WAAW,KAAK;EACxC,MAAM,UAAU,YACV,iCAAiC,UAAU,UAC3C;EACN,OAAO,KAAKC,UAAU,oBAAoB;GACtC;GACA,QAAQ;GACR,gBAAgB,SAAS;IACrB,MAAM,OAAO,MAAM,4BAA4B,IAAI;IACnD,MAAM,QAAQ,IAAI;GACtB;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;;;;CAKA,oBAAoB,OAAsD;EACtE,MAAM,eAAe,EAAE,UAAU,6BAA6B,EAAE,QAAQ,MAAM,OAAO,CAAC;EACtF,IAAI,CAAC,aAAa,SAAS;GACvB,IAAI,MAAM,GACN,QAAQ,MACJ,qEACJ;GAEJ,aAAa,CAAC;EAClB;EAEA,MAAM,UAAU,+BAA+B,aAAa,OAAO,OAAO;EAC1E,OAAO,KAAKA,UAAU,oBAAoB;GACtC;GACA,QAAQ;GACR,gBAAgB,SAAS;IACrB,MAAM,OAAO,MAAM,2BAA2B,IAAI;IAClD,MAAM,QAAQ,IAAI;GACtB;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}
1
+ {"version":3,"file":"lifecycle.js","names":["#client","#authClient","#realtime","#resolver"],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport { create } from \"@bufbuild/protobuf\";\nimport {\n FlowDetailViewSchema,\n FlowSummaryViewSchema,\n GetFlowByIdRequestSchema,\n LifecycleReadService,\n} from \"../../gen/chain/lifecycle/v1/lifecycle_read_pb.js\";\nimport type { PolyesterRealtime } from \"../../realtime/types.js\";\nimport type { AuthAndPublicApiTransports } from \"../../shared/transports.js\";\nimport { resolveAccountScopedInput, type SubaccountResolver } from \"../subaccount-resolver.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { isDev } from \"../../utils/is-dev.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n GetLifecycleAccountFlowInputSchema,\n GetLifecycleFlowInputSchema,\n GetLifecycleFlowOutputSchema,\n LifecycleFlowDetailSchema,\n LifecycleFlowSummarySchema,\n ListLifecycleFlowsByTxOutputSchema,\n ListLifecycleFlowsByTxInputSchema,\n ListLifecycleFlowsOutputSchema,\n ListLifecycleFlowsInputSchema,\n ListLifecycleAccountFlowsInputSchema,\n type GetLifecycleAccountFlowInput,\n type GetLifecycleFlowInput,\n type GetLifecycleFlowOutput,\n type LifecycleFlowDetail,\n type LifecycleFlowSummary,\n type ListLifecycleFlowsByTxInput,\n type ListLifecycleFlowsByTxOutput,\n type ListLifecycleFlowsInput,\n type ListLifecycleAccountFlowsInput,\n type ListLifecycleFlowsOutput,\n} from \"./lifecycle.schemas.js\";\n\ninterface SubscribeOpenLifecycleFlowsInput extends BaseSubscribeInput<LifecycleFlowSummary> {\n accountId?: string;\n}\n\ninterface SubscribeLifecycleFlowDetailInput extends BaseSubscribeInput<LifecycleFlowDetail> {\n flowId: string;\n}\n\n/**\n * Reads and streams chain lifecycle flow state, history, progress, and transaction matches.\n */\nexport class LifecycleService {\n #client: Client<typeof LifecycleReadService>;\n #authClient: Client<typeof LifecycleReadService>;\n #realtime: PolyesterRealtime;\n #resolver?: SubaccountResolver;\n\n constructor(\n transports: AuthAndPublicApiTransports,\n realtime: PolyesterRealtime,\n resolver?: SubaccountResolver,\n ) {\n this.#client = createClient(LifecycleReadService, transports.publicApi);\n this.#authClient = createClient(LifecycleReadService, transports.authApi);\n this.#realtime = realtime;\n this.#resolver = resolver;\n }\n\n /**\n * Returns paginated lifecycle flow summaries filtered by kind, state, scope, account selector, transaction reference, chain ids, and asset ids. The response is ordered by the selected timestamp and includes an opaque next page token.\n *\n * Lists only flows a chain transaction started. With an `accountSelector` (a smart\n * account address), the list holds the flows the account owns and the transfers it\n * receives from other accounts; each row's `participation` says which. Pass\n * `participation: \"owner\"` for the owned flows only. A `pageToken` only resumes the\n * request it came from: change nothing but `limit` between pages. Use `listAccountFlows`\n * for every flow of the signed-in account.\n */\n async listFlows(\n input: ListLifecycleFlowsInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsOutput> {\n const parsedInput = parse(ListLifecycleFlowsInputSchema, input);\n const response = await this.#client.listFlows(parsedInput, toConnectCallOptions(options));\n const res = parse(ListLifecycleFlowsOutputSchema, response);\n return res;\n }\n\n /**\n * Lists the signed-in account's flows: the ones it owns and the transfers it receives,\n * including flows no chain transaction started, such as transfers between Trading accounts.\n * Each row's `participation` says which. Takes the same filters as `listFlows`; a\n * `pageToken` only resumes the request it came from. API keys need `read-funding-flows`.\n */\n async listAccountFlows(\n input: ListLifecycleAccountFlowsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsOutput> {\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const request = parse(ListLifecycleAccountFlowsInputSchema, resolved);\n const response = await this.#authClient.listAccountFlows(\n request,\n toConnectCallOptions(options),\n );\n return parse(ListLifecycleFlowsOutputSchema, response);\n }\n\n /**\n * Fetches one flow the signed-in account owns or receives, including one no chain\n * transaction started. A flow the account takes no part in throws `ResourceNotFoundError`. API keys\n * need `read-funding-flows`.\n */\n async getAccountFlow(\n input: GetLifecycleAccountFlowInput,\n options?: PolyesterRequestOptions,\n ): Promise<GetLifecycleFlowOutput> {\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const request = parse(GetLifecycleAccountFlowInputSchema, resolved);\n const response = await this.#authClient.getAccountFlow(\n request,\n toConnectCallOptions(options),\n );\n return parse(GetLifecycleFlowOutputSchema, response);\n }\n\n /**\n * Fetches one lifecycle flow by its public flow id and returns summary, factual steps,\n * timeline, and live-state detail when available. Finds only flows a chain transaction\n * started; the account reads its other flows with `getAccountFlow`.\n */\n async getFlow(\n input: GetLifecycleFlowInput,\n options?: PolyesterRequestOptions,\n ): Promise<GetLifecycleFlowOutput> {\n const parsedInput = parse(GetLifecycleFlowInputSchema, input);\n const response = await this.#client.getFlowById(\n create(GetFlowByIdRequestSchema, parsedInput),\n toConnectCallOptions(options),\n );\n return parse(GetLifecycleFlowOutputSchema, response);\n }\n\n /**\n * Searches lifecycle flows that reference a 0x-prefixed transaction hash, using source-only or any-reference lookup mode. A single transaction may match zero, one, or many flows.\n */\n async listFlowsByTx(\n input: ListLifecycleFlowsByTxInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsByTxOutput> {\n const parsedInput = parse(ListLifecycleFlowsByTxInputSchema, input);\n const response = await this.#client.listFlowsByTx(\n parsedInput,\n toConnectCallOptions(options),\n );\n return parse(ListLifecycleFlowsByTxOutputSchema, response);\n }\n\n /**\n * Subscribes to open lifecycle flow summary updates, using private:chain:lifecycle:flows:{accountId}:proto when an account id is provided and the public flow channel otherwise.\n */\n subscribeOpenFlows(input: SubscribeOpenLifecycleFlowsInput): () => void {\n const accountId = input.accountId?.trim();\n const channel = accountId\n ? `private:chain:lifecycle:flows:${accountId}:proto`\n : \"public:chain:lifecycle:flows:proto\";\n return this.#realtime.connectProtoChannel({\n channel,\n schema: FlowSummaryViewSchema,\n onPublication: (data) => {\n const flow = parse(LifecycleFlowSummarySchema, data);\n input.onEvent(flow);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n\n /**\n * Subscribes to detail updates for one lifecycle flow on public:chain:lifecycle:flow:{flowId}:proto. Invalid flow ids are rejected locally with a no-op unsubscribe function.\n */\n subscribeFlowDetail(input: SubscribeLifecycleFlowDetailInput): () => void {\n const parsedFlowId = v.safeParse(GetLifecycleFlowInputSchema, { flowId: input.flowId });\n if (!parsedFlowId.success) {\n if (isDev()) {\n console.error(\n \"[LifecycleService] flowId is required for flow detail subscription.\",\n );\n }\n return () => {};\n }\n\n const channel = `public:chain:lifecycle:flow:${parsedFlowId.output.flowId}:proto`;\n return this.#realtime.connectProtoChannel({\n channel,\n schema: FlowDetailViewSchema,\n onPublication: (data) => {\n const flow = parse(LifecycleFlowDetailSchema, data);\n input.onEvent(flow);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAqDA,IAAa,mBAAb,MAA8B;CAC1B;CACA;CACA;CACA;CAEA,YACI,YACA,UACA,UACF;EACE,KAAKA,UAAU,aAAa,sBAAsB,WAAW,SAAS;EACtE,KAAKC,cAAc,aAAa,sBAAsB,WAAW,OAAO;EACxE,KAAKC,YAAY;EACjB,KAAKC,YAAY;CACrB;;;;;;;;;;;CAYA,MAAM,UACF,OACA,SACiC;EACjC,MAAM,cAAc,MAAM,+BAA+B,KAAK;EAC9D,MAAM,WAAW,MAAM,KAAKH,QAAQ,UAAU,aAAa,qBAAqB,OAAO,CAAC;EAExF,OADY,MAAM,gCAAgC,QACzC;CACb;;;;;;;CAQA,MAAM,iBACF,QAAwC,CAAC,GACzC,SACiC;EACjC,MAAM,WAAW,0BAA0B,OAAO,KAAKG,SAAS;EAChE,MAAM,UAAU,MAAM,sCAAsC,QAAQ;EACpE,MAAM,WAAW,MAAM,KAAKF,YAAY,iBACpC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,gCAAgC,QAAQ;CACzD;;;;;;CAOA,MAAM,eACF,OACA,SAC+B;EAC/B,MAAM,WAAW,0BAA0B,OAAO,KAAKE,SAAS;EAChE,MAAM,UAAU,MAAM,oCAAoC,QAAQ;EAClE,MAAM,WAAW,MAAM,KAAKF,YAAY,eACpC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,8BAA8B,QAAQ;CACvD;;;;;;CAOA,MAAM,QACF,OACA,SAC+B;EAC/B,MAAM,cAAc,MAAM,6BAA6B,KAAK;EAC5D,MAAM,WAAW,MAAM,KAAKD,QAAQ,YAChC,OAAO,0BAA0B,WAAW,GAC5C,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,8BAA8B,QAAQ;CACvD;;;;CAKA,MAAM,cACF,OACA,SACqC;EACrC,MAAM,cAAc,MAAM,mCAAmC,KAAK;EAClE,MAAM,WAAW,MAAM,KAAKA,QAAQ,cAChC,aACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,oCAAoC,QAAQ;CAC7D;;;;CAKA,mBAAmB,OAAqD;EACpE,MAAM,YAAY,MAAM,WAAW,KAAK;EACxC,MAAM,UAAU,YACV,iCAAiC,UAAU,UAC3C;EACN,OAAO,KAAKE,UAAU,oBAAoB;GACtC;GACA,QAAQ;GACR,gBAAgB,SAAS;IACrB,MAAM,OAAO,MAAM,4BAA4B,IAAI;IACnD,MAAM,QAAQ,IAAI;GACtB;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;;;;CAKA,oBAAoB,OAAsD;EACtE,MAAM,eAAe,EAAE,UAAU,6BAA6B,EAAE,QAAQ,MAAM,OAAO,CAAC;EACtF,IAAI,CAAC,aAAa,SAAS;GACvB,IAAI,MAAM,GACN,QAAQ,MACJ,qEACJ;GAEJ,aAAa,CAAC;EAClB;EAEA,MAAM,UAAU,+BAA+B,aAAa,OAAO,OAAO;EAC1E,OAAO,KAAKA,UAAU,oBAAoB;GACtC;GACA,QAAQ;GACR,gBAAgB,SAAS;IACrB,MAAM,OAAO,MAAM,2BAA2B,IAAI;IAClD,MAAM,QAAQ,IAAI;GACtB;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}