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

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 (283) hide show
  1. package/CHANGELOG.md +42 -4
  2. package/dist/client.d.ts +4 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +4 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/gen/ai/v1/assistant_pb.d.ts +82 -4
  7. package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
  8. package/dist/gen/ai/v1/assistant_pb.js +66 -10
  9. package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
  10. package/dist/gen/auth/v1/api_keys_pb.d.ts +4 -4
  11. package/dist/gen/auth/v1/api_keys_pb.js +4 -4
  12. package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
  13. package/dist/gen/auth/v1/auth_pb.d.ts +26 -1
  14. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  15. package/dist/gen/auth/v1/auth_pb.js +18 -1
  16. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  17. package/dist/gen/auth/v1/policies_pb.d.ts +18 -1
  18. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  19. package/dist/gen/auth/v1/policies_pb.js +18 -1
  20. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  21. package/dist/gen/auth/v1/profile_pb.d.ts +7 -11
  22. package/dist/gen/auth/v1/profile_pb.d.ts.map +1 -1
  23. package/dist/gen/auth/v1/profile_pb.js +1 -1
  24. package/dist/gen/auth/v1/profile_pb.js.map +1 -1
  25. package/dist/gen/auth/v1/social_verification_pb.d.ts +44 -10
  26. package/dist/gen/auth/v1/social_verification_pb.d.ts.map +1 -1
  27. package/dist/gen/auth/v1/social_verification_pb.js +1 -1
  28. package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
  29. package/dist/gen/auth/v1/subaccounts_pb.d.ts +17 -1
  30. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  31. package/dist/gen/auth/v1/subaccounts_pb.js +15 -1
  32. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  33. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +228 -38
  34. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
  35. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js +34 -10
  36. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
  37. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +12 -0
  38. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts.map +1 -1
  39. package/dist/gen/chain/lifecycle/v1/types_pb.js +13 -1
  40. package/dist/gen/chain/lifecycle/v1/types_pb.js.map +1 -1
  41. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +6 -3
  42. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
  43. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
  44. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +10 -1
  45. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  46. package/dist/gen/chain/withdraw/v1/withdraw_pb.js +10 -1
  47. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  48. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts +10 -6
  49. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts.map +1 -1
  50. package/dist/gen/chain/zipper/v1/zipper_pb.js +2 -2
  51. package/dist/gen/chain/zipper/v1/zipper_pb.js.map +1 -1
  52. package/dist/gen/index.d.ts +3 -1
  53. package/dist/gen/index.js +4 -2
  54. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +57 -16
  55. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
  56. package/dist/gen/ledger/read/v1/ledger_read_pb.js +32 -1
  57. package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
  58. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts +424 -0
  59. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts.map +1 -0
  60. package/dist/gen/ledger/read/v1/statement_export_pb.js +154 -0
  61. package/dist/gen/ledger/read/v1/statement_export_pb.js.map +1 -0
  62. package/dist/gen/orders/v1/orders_pb.d.ts +28 -4
  63. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  64. package/dist/gen/orders/v1/orders_pb.js +1 -1
  65. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  66. package/dist/gen/orders/v1/orders_read_pb.d.ts +2 -1
  67. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  68. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  69. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +12 -7
  70. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts.map +1 -1
  71. package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -1
  72. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +22 -10
  73. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
  74. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +4 -2
  75. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
  76. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +47 -11
  77. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  78. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +35 -6
  79. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  80. package/dist/gen/transfer/v1/dust_conversion_pb.d.ts +741 -0
  81. package/dist/gen/transfer/v1/dust_conversion_pb.d.ts.map +1 -0
  82. package/dist/gen/transfer/v1/dust_conversion_pb.js +235 -0
  83. package/dist/gen/transfer/v1/dust_conversion_pb.js.map +1 -0
  84. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +367 -3
  85. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
  86. package/dist/gen/transfer/v1/internal_transfer_pb.js +166 -4
  87. package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
  88. package/dist/gen/triggers/v1/triggers_pb.d.ts +10 -5
  89. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  90. package/dist/gen/triggers/v1/triggers_pb.js +4 -2
  91. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  92. package/dist/index.d.ts +13 -7
  93. package/dist/services/address-book/address-book.schemas.d.ts +2 -2
  94. package/dist/services/assistant/assistant-events.schemas.d.ts +66 -66
  95. package/dist/services/assistant/assistant.codecs.d.ts +7 -1
  96. package/dist/services/assistant/assistant.codecs.d.ts.map +1 -1
  97. package/dist/services/assistant/assistant.codecs.js +5 -1
  98. package/dist/services/assistant/assistant.codecs.js.map +1 -1
  99. package/dist/services/assistant/assistant.d.ts +4 -3
  100. package/dist/services/assistant/assistant.d.ts.map +1 -1
  101. package/dist/services/assistant/assistant.js +6 -4
  102. package/dist/services/assistant/assistant.js.map +1 -1
  103. package/dist/services/assistant/assistant.schemas.d.ts +40 -3
  104. package/dist/services/assistant/assistant.schemas.d.ts.map +1 -1
  105. package/dist/services/assistant/assistant.schemas.js +18 -4
  106. package/dist/services/assistant/assistant.schemas.js.map +1 -1
  107. package/dist/services/assistant/assistant.types.d.ts +3 -3
  108. package/dist/services/auth/profile/profile.d.ts +1 -1
  109. package/dist/services/auth/profile/profile.js +1 -1
  110. package/dist/services/auth/profile/profile.js.map +1 -1
  111. package/dist/services/auth/profile/profile.schemas.d.ts +0 -1
  112. package/dist/services/auth/profile/profile.schemas.d.ts.map +1 -1
  113. package/dist/services/auth/profile/profile.schemas.js +0 -1
  114. package/dist/services/auth/profile/profile.schemas.js.map +1 -1
  115. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +3 -1
  116. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -1
  117. package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -1
  118. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +19 -19
  119. package/dist/services/auto-withdraw/auto-withdraw.schemas.js +1 -1
  120. package/dist/services/balances/balances.d.ts +4 -3
  121. package/dist/services/balances/balances.d.ts.map +1 -1
  122. package/dist/services/balances/balances.js +12 -4
  123. package/dist/services/balances/balances.js.map +1 -1
  124. package/dist/services/balances/balances.schemas.d.ts +30 -5
  125. package/dist/services/balances/balances.schemas.d.ts.map +1 -1
  126. package/dist/services/balances/balances.schemas.js +6 -10
  127. package/dist/services/balances/balances.schemas.js.map +1 -1
  128. package/dist/services/balances/balances.types.d.ts +2 -2
  129. package/dist/services/checkpoints/checkpoints.schemas.d.ts +2 -2
  130. package/dist/services/claims/claims.schemas.js +1 -1
  131. package/dist/services/dust-conversion/dust-conversion.codecs.d.ts +22 -0
  132. package/dist/services/dust-conversion/dust-conversion.codecs.d.ts.map +1 -0
  133. package/dist/services/dust-conversion/dust-conversion.codecs.js +22 -0
  134. package/dist/services/dust-conversion/dust-conversion.codecs.js.map +1 -0
  135. package/dist/services/dust-conversion/dust-conversion.d.ts +59 -0
  136. package/dist/services/dust-conversion/dust-conversion.d.ts.map +1 -0
  137. package/dist/services/dust-conversion/dust-conversion.js +87 -0
  138. package/dist/services/dust-conversion/dust-conversion.js.map +1 -0
  139. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts +561 -0
  140. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts.map +1 -0
  141. package/dist/services/dust-conversion/dust-conversion.schemas.js +190 -0
  142. package/dist/services/dust-conversion/dust-conversion.schemas.js.map +1 -0
  143. package/dist/services/dust-conversion/dust-conversion.types.d.ts +3 -0
  144. package/dist/services/dust-conversion/service.d.ts +8 -0
  145. package/dist/services/dust-conversion/service.d.ts.map +1 -0
  146. package/dist/services/dust-conversion/service.js +9 -0
  147. package/dist/services/dust-conversion/service.js.map +1 -0
  148. package/dist/services/heatmap/heatmap.schemas.d.ts +3 -3
  149. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts +13 -1
  150. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts.map +1 -1
  151. package/dist/services/internal-transfers/internal-transfers.codecs.js +22 -2
  152. package/dist/services/internal-transfers/internal-transfers.codecs.js.map +1 -1
  153. package/dist/services/internal-transfers/internal-transfers.d.ts +14 -2
  154. package/dist/services/internal-transfers/internal-transfers.d.ts.map +1 -1
  155. package/dist/services/internal-transfers/internal-transfers.js +29 -3
  156. package/dist/services/internal-transfers/internal-transfers.js.map +1 -1
  157. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +265 -5
  158. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts.map +1 -1
  159. package/dist/services/internal-transfers/internal-transfers.schemas.js +63 -5
  160. package/dist/services/internal-transfers/internal-transfers.schemas.js.map +1 -1
  161. package/dist/services/internal-transfers/internal-transfers.types.d.ts +3 -3
  162. package/dist/services/lifecycle/lifecycle.codecs.d.ts +1 -1
  163. package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
  164. package/dist/services/lifecycle/lifecycle.codecs.js +1 -0
  165. package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
  166. package/dist/services/lifecycle/lifecycle.d.ts +26 -8
  167. package/dist/services/lifecycle/lifecycle.d.ts.map +1 -1
  168. package/dist/services/lifecycle/lifecycle.js +39 -7
  169. package/dist/services/lifecycle/lifecycle.js.map +1 -1
  170. package/dist/services/lifecycle/lifecycle.schemas.d.ts +160 -136
  171. package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
  172. package/dist/services/lifecycle/lifecycle.schemas.js +44 -45
  173. package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
  174. package/dist/services/lifecycle/lifecycle.types.d.ts +2 -2
  175. package/dist/services/lifecycle/service.js +1 -1
  176. package/dist/services/lifecycle/service.js.map +1 -1
  177. package/dist/services/orderbook/orderbook.d.ts.map +1 -1
  178. package/dist/services/orderbook/orderbook.js +2 -1
  179. package/dist/services/orderbook/orderbook.js.map +1 -1
  180. package/dist/services/orderbook/orderbook.schemas.d.ts +10 -0
  181. package/dist/services/orderbook/orderbook.schemas.d.ts.map +1 -1
  182. package/dist/services/orderbook/orderbook.schemas.js +4 -1
  183. package/dist/services/orderbook/orderbook.schemas.js.map +1 -1
  184. package/dist/services/orders/order-errors.schemas.d.ts +11 -1
  185. package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
  186. package/dist/services/orders/order-errors.schemas.js +11 -1
  187. package/dist/services/orders/order-errors.schemas.js.map +1 -1
  188. package/dist/services/orders/orders-batch.schemas.d.ts +67 -27
  189. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  190. package/dist/services/orders/orders-identifiers.schemas.js +2 -1
  191. package/dist/services/orders/orders-identifiers.schemas.js.map +1 -1
  192. package/dist/services/orders/orders-input.schemas.d.ts +11 -4
  193. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  194. package/dist/services/orders/orders-input.schemas.js +1 -0
  195. package/dist/services/orders/orders-input.schemas.js.map +1 -1
  196. package/dist/services/orders/orders-output.schemas.d.ts +17 -17
  197. package/dist/services/orders/orders-output.schemas.js +1 -1
  198. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  199. package/dist/services/policies/shared.codecs.js +9 -3
  200. package/dist/services/policies/shared.codecs.js.map +1 -1
  201. package/dist/services/policies/shared.d.ts +1 -1
  202. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +5 -5
  203. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts.map +1 -1
  204. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +2 -3
  205. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js.map +1 -1
  206. package/dist/services/price-alerts/price-alerts.schemas.d.ts +10 -10
  207. package/dist/services/rate-limits/rate-limits.d.ts +4 -1
  208. package/dist/services/rate-limits/rate-limits.d.ts.map +1 -1
  209. package/dist/services/rate-limits/rate-limits.js +4 -1
  210. package/dist/services/rate-limits/rate-limits.js.map +1 -1
  211. package/dist/services/rate-limits/rate-limits.schemas.d.ts +1 -0
  212. package/dist/services/rate-limits/rate-limits.schemas.d.ts.map +1 -1
  213. package/dist/services/rate-limits/rate-limits.schemas.js +1 -0
  214. package/dist/services/rate-limits/rate-limits.schemas.js.map +1 -1
  215. package/dist/services/rewards/rewards.schemas.d.ts +4 -4
  216. package/dist/services/social-verification/social-verification.codecs.js +6 -2
  217. package/dist/services/social-verification/social-verification.codecs.js.map +1 -1
  218. package/dist/services/social-verification/social-verification.d.ts +14 -3
  219. package/dist/services/social-verification/social-verification.d.ts.map +1 -1
  220. package/dist/services/social-verification/social-verification.js +14 -3
  221. package/dist/services/social-verification/social-verification.js.map +1 -1
  222. package/dist/services/social-verification/social-verification.schemas.d.ts +13 -3
  223. package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
  224. package/dist/services/social-verification/social-verification.schemas.js +12 -4
  225. package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
  226. package/dist/services/statement-exports/service.d.ts +8 -0
  227. package/dist/services/statement-exports/service.d.ts.map +1 -0
  228. package/dist/services/statement-exports/service.js +9 -0
  229. package/dist/services/statement-exports/service.js.map +1 -0
  230. package/dist/services/statement-exports/statement-exports.codecs.d.ts +17 -0
  231. package/dist/services/statement-exports/statement-exports.codecs.d.ts.map +1 -0
  232. package/dist/services/statement-exports/statement-exports.codecs.js +19 -0
  233. package/dist/services/statement-exports/statement-exports.codecs.js.map +1 -0
  234. package/dist/services/statement-exports/statement-exports.d.ts +34 -0
  235. package/dist/services/statement-exports/statement-exports.d.ts.map +1 -0
  236. package/dist/services/statement-exports/statement-exports.js +53 -0
  237. package/dist/services/statement-exports/statement-exports.js.map +1 -0
  238. package/dist/services/statement-exports/statement-exports.schemas.d.ts +269 -0
  239. package/dist/services/statement-exports/statement-exports.schemas.d.ts.map +1 -0
  240. package/dist/services/statement-exports/statement-exports.schemas.js +98 -0
  241. package/dist/services/statement-exports/statement-exports.schemas.js.map +1 -0
  242. package/dist/services/statement-exports/statement-exports.types.d.ts +3 -0
  243. package/dist/services/subaccounts/subaccounts.codecs.js +3 -1
  244. package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
  245. package/dist/services/subaccounts/subaccounts.schemas.d.ts +22 -22
  246. package/dist/services/system/system.schemas.d.ts +7 -7
  247. package/dist/services/trades/trades.schemas.d.ts +2 -2
  248. package/dist/services/trades/trades.schemas.js +1 -1
  249. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +1 -1
  250. package/dist/services/transfers/transfers.schemas.js +1 -1
  251. package/dist/services/triggers/trigger-input.schemas.d.ts +5 -4
  252. package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
  253. package/dist/services/triggers/trigger-input.schemas.js +2 -2
  254. package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
  255. package/dist/services/triggers/triggers-output.schemas.d.ts +45 -35
  256. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  257. package/dist/services/zipper/zipper.schemas.d.ts.map +1 -1
  258. package/dist/services/zipper/zipper.schemas.js +10 -0
  259. package/dist/services/zipper/zipper.schemas.js.map +1 -1
  260. package/dist/shared/account-scope.js +4 -1
  261. package/dist/shared/account-scope.js.map +1 -1
  262. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  263. package/dist/shared/connect-error-mapping.js +3 -0
  264. package/dist/shared/connect-error-mapping.js.map +1 -1
  265. package/dist/shared/decimal-surface.d.ts.map +1 -1
  266. package/dist/shared/decimal-surface.js +4 -1
  267. package/dist/shared/decimal-surface.js.map +1 -1
  268. package/dist/shared/error-detail.d.ts +5 -0
  269. package/dist/shared/error-detail.d.ts.map +1 -1
  270. package/dist/shared/error-detail.js.map +1 -1
  271. package/dist/shared/error-details/auth.js +7 -2
  272. package/dist/shared/error-details/auth.js.map +1 -1
  273. package/dist/shared/error-details/withdraw.js +1 -1
  274. package/dist/shared/schemas.js +2 -2
  275. package/dist/shared/schemas.js.map +1 -1
  276. package/dist/utils/numbers.js +1 -10
  277. package/dist/utils/numbers.js.map +1 -1
  278. package/dist/utils/u128.js +1 -1
  279. package/dist/utils/u128.js.map +1 -1
  280. package/dist/wired-services.d.ts.map +1 -1
  281. package/dist/wired-services.js +5 -1
  282. package/dist/wired-services.js.map +1 -1
  283. package/package.json +1 -1
@@ -138,8 +138,8 @@ declare function createCreateInternalTransferResultSchema(): v.SchemaWithPipe<re
138
138
  subaccountId: string | undefined;
139
139
  smartAccountAddress: string | undefined;
140
140
  }>]>, undefined>;
141
- readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "accepted" | "rejected" | "failed">]>;
142
- /** Lifecycle flow ID for `lifecycle.getFlow`; empty when the server did not return one. */
141
+ readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "accepted" | "rejected">]>;
142
+ /** Lifecycle flow ID for `lifecycle.getAccountFlow`; empty when the server did not return one. */
143
143
  readonly flowId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, "">;
144
144
  }, undefined>, v.TransformAction<{
145
145
  requestId: string;
@@ -157,10 +157,12 @@ declare function createCreateInternalTransferResultSchema(): v.SchemaWithPipe<re
157
157
  subaccountId: string | undefined;
158
158
  smartAccountAddress: string | undefined;
159
159
  } | undefined;
160
- status: "unspecified" | "accepted" | "rejected" | "failed";
160
+ status: "unspecified" | "failed" | "accepted" | "rejected";
161
161
  flowId: string;
162
162
  }, {
163
163
  acceptedAtUnixMs: number;
164
+ /** Exact acceptance time in nanoseconds since epoch, as a decimal string. */
165
+ acceptedAtNs: string;
164
166
  quantity: string;
165
167
  requestId: string;
166
168
  transferId: string;
@@ -172,10 +174,268 @@ declare function createCreateInternalTransferResultSchema(): v.SchemaWithPipe<re
172
174
  subaccountId: string | undefined;
173
175
  smartAccountAddress: string | undefined;
174
176
  } | undefined;
175
- status: "unspecified" | "accepted" | "rejected" | "failed";
177
+ status: "unspecified" | "failed" | "accepted" | "rejected";
176
178
  flowId: string;
177
179
  }>]>;
178
180
  type CreateInternalTransferResult = v.InferOutput<ReturnType<typeof createCreateInternalTransferResultSchema>>;
181
+ declare function createBatchCreateInternalTransfersInputSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
182
+ /**
183
+ * Up to 10 transfers, run in order. Each leg debits its own `account` (the
184
+ * resolved active account when omitted), and legs may repeat an asset, a source or a
185
+ * destination. Each leg counts as one internal transfer against the rate limit.
186
+ */
187
+ readonly legs: v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
188
+ readonly destination: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.StrictObjectSchema<{
189
+ readonly type: v.LiteralSchema<"account", undefined>;
190
+ readonly accountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>;
191
+ }, undefined>, v.StrictObjectSchema<{
192
+ readonly type: v.LiteralSchema<"subaccount", undefined>;
193
+ readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>;
194
+ }, undefined>, v.StrictObjectSchema<{
195
+ readonly type: v.LiteralSchema<"smartAccountAddress", undefined>;
196
+ readonly address: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
197
+ }, undefined>], undefined>, v.TransformAction<{
198
+ type: "account";
199
+ accountId: bigint;
200
+ } | {
201
+ type: "subaccount";
202
+ subaccountId: bigint;
203
+ } | {
204
+ type: "smartAccountAddress";
205
+ address: string;
206
+ }, {
207
+ readonly case: "destinationAccountId";
208
+ readonly value: bigint;
209
+ } | {
210
+ readonly case: "destinationSubaccountId";
211
+ readonly value: bigint;
212
+ } | {
213
+ readonly case: "destinationSmartAccountAddress";
214
+ readonly value: string;
215
+ }>]>;
216
+ readonly assetId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
217
+ readonly quantity: v.StringSchema<undefined>;
218
+ readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
219
+ readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
220
+ }, undefined>], undefined>, undefined>;
221
+ }, undefined>, undefined>, v.MinLengthAction<{
222
+ destination: {
223
+ readonly case: "destinationAccountId";
224
+ readonly value: bigint;
225
+ } | {
226
+ readonly case: "destinationSubaccountId";
227
+ readonly value: bigint;
228
+ } | {
229
+ readonly case: "destinationSmartAccountAddress";
230
+ readonly value: string;
231
+ };
232
+ assetId: number;
233
+ quantity: string;
234
+ account?: "active" | "main" | {
235
+ subaccountId: string;
236
+ } | undefined;
237
+ }[], 1, "A batch needs at least one leg.">, v.MaxLengthAction<{
238
+ destination: {
239
+ readonly case: "destinationAccountId";
240
+ readonly value: bigint;
241
+ } | {
242
+ readonly case: "destinationSubaccountId";
243
+ readonly value: bigint;
244
+ } | {
245
+ readonly case: "destinationSmartAccountAddress";
246
+ readonly value: string;
247
+ };
248
+ assetId: number;
249
+ quantity: string;
250
+ account?: "active" | "main" | {
251
+ subaccountId: string;
252
+ } | undefined;
253
+ }[], 10, "A batch holds at most 10 legs.">]>;
254
+ /** Covers the whole batch; a retry must send the same legs in the same order. */
255
+ readonly idempotencyKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
256
+ }, undefined>, v.TransformAction<{
257
+ legs: {
258
+ destination: {
259
+ readonly case: "destinationAccountId";
260
+ readonly value: bigint;
261
+ } | {
262
+ readonly case: "destinationSubaccountId";
263
+ readonly value: bigint;
264
+ } | {
265
+ readonly case: "destinationSmartAccountAddress";
266
+ readonly value: string;
267
+ };
268
+ assetId: number;
269
+ quantity: string;
270
+ account?: "active" | "main" | {
271
+ subaccountId: string;
272
+ } | undefined;
273
+ }[];
274
+ idempotencyKey: string;
275
+ }, {
276
+ idempotencyKey: string;
277
+ legs: {
278
+ subaccountId: bigint;
279
+ amountE18: U128Value;
280
+ destination: {
281
+ readonly case: "destinationAccountId";
282
+ readonly value: bigint;
283
+ } | {
284
+ readonly case: "destinationSubaccountId";
285
+ readonly value: bigint;
286
+ } | {
287
+ readonly case: "destinationSmartAccountAddress";
288
+ readonly value: string;
289
+ };
290
+ assetId: number;
291
+ }[];
292
+ }>]>;
293
+ type BatchCreateInternalTransfersInput = v.InferInput<ReturnType<typeof createBatchCreateInternalTransfersInputSchema>>;
294
+ type InternalTransferBatchLegInput = BatchCreateInternalTransfersInput["legs"][number];
295
+ declare const InternalTransferBatchLegResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
296
+ readonly legIndex: v.NumberSchema<undefined>;
297
+ readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "refused" | "pending" | "accepted" | "not_submitted">]>;
298
+ readonly requestId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
299
+ readonly transferId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
300
+ readonly flowId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
301
+ readonly acceptedAtTsNs: v.OptionalSchema<v.BigintSchema<undefined>, 0n>;
302
+ readonly assetId: v.NumberSchema<undefined>;
303
+ readonly assetCode: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
304
+ readonly amountE18: v.OptionalSchema<v.ObjectSchema<{
305
+ readonly hi: v.BigintSchema<undefined>;
306
+ readonly lo: v.BigintSchema<undefined>;
307
+ }, undefined>, undefined>;
308
+ readonly destination: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
309
+ readonly rootAccountPublicId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
310
+ readonly subaccountPublicId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
311
+ readonly smartAccountAddress: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
312
+ }, undefined>, v.TransformAction<{
313
+ rootAccountPublicId?: string | undefined;
314
+ subaccountPublicId?: string | undefined;
315
+ smartAccountAddress?: string | undefined;
316
+ }, {
317
+ rootAccountId: string | undefined;
318
+ subaccountId: string | undefined;
319
+ smartAccountAddress: string | undefined;
320
+ }>]>, undefined>;
321
+ readonly errorCode: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
322
+ readonly errorMessage: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
323
+ }, undefined>, v.TransformAction<{
324
+ legIndex: number;
325
+ status: "unspecified" | "refused" | "pending" | "accepted" | "not_submitted";
326
+ requestId?: string | undefined;
327
+ transferId?: string | undefined;
328
+ flowId?: string | undefined;
329
+ acceptedAtTsNs: bigint;
330
+ assetId: number;
331
+ assetCode?: string | undefined;
332
+ amountE18?: {
333
+ hi: bigint;
334
+ lo: bigint;
335
+ } | undefined;
336
+ destination?: {
337
+ rootAccountId: string | undefined;
338
+ subaccountId: string | undefined;
339
+ smartAccountAddress: string | undefined;
340
+ } | undefined;
341
+ errorCode: number;
342
+ errorMessage?: string | undefined;
343
+ }, {
344
+ acceptedAtUnixMs: number | undefined;
345
+ acceptedAtNs: string | undefined;
346
+ quantity: string | undefined;
347
+ /** Why the leg was refused, or why its outcome is not known yet; unset otherwise. */
348
+ errorCode: "UNSPECIFIED" | "UNAUTHENTICATED" | "RATE_LIMIT_EXCEEDED" | "CONFLICT" | "INVALID_REQUEST" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR" | "PERMISSION_DENIED" | "FAILED_PRECONDITION" | "SUBACCOUNT_NOT_FOUND" | "INSUFFICIENT_FUNDS" | "INVALID_SUBACCOUNT_ID" | "SOURCE_ACCOUNT_INACTIVE" | "UNSUPPORTED_ASSET" | "INVALID_AMOUNT" | "INVALID_DESTINATION" | "DESTINATION_NOT_FOUND" | "DESTINATION_INACTIVE" | "SAME_SOURCE_DESTINATION" | "DESTINATION_NOT_WHITELISTED" | "SMART_ACCOUNT_UNAVAILABLE" | "STEP_UP_UNAVAILABLE" | "IDEMPOTENCY_CONFLICT" | "FUNDS_LOCK_CONFLICT" | "CAPITAL_VIEW_UNAVAILABLE" | "ACCOUNT_SHARD_UNAVAILABLE" | "POLICY_DENIED" | "NOT_FOUND" | "DUST_QUOTE_EXPIRED" | "DUST_PRICE_MOVED" | "DUST_NOT_ELIGIBLE" | "DUST_WINDOW_ACTIVE" | "DUST_DAILY_LIMIT" | "DUST_BUSY" | "DUST_TARGET_UNAVAILABLE" | "DUST_BALANCE_CHANGED" | "DUST_CONVERSION_FAILED" | undefined;
349
+ legIndex: number;
350
+ status: "unspecified" | "refused" | "pending" | "accepted" | "not_submitted";
351
+ requestId?: string | undefined;
352
+ transferId?: string | undefined;
353
+ flowId?: string | undefined;
354
+ assetId: number;
355
+ assetCode?: string | undefined;
356
+ destination?: {
357
+ rootAccountId: string | undefined;
358
+ subaccountId: string | undefined;
359
+ smartAccountAddress: string | undefined;
360
+ } | undefined;
361
+ errorMessage?: string | undefined;
362
+ }>]>;
363
+ type InternalTransferBatchLegResult = v.InferOutput<typeof InternalTransferBatchLegResultSchema>;
364
+ declare const BatchCreateInternalTransfersResultSchema: v.ObjectSchema<{
365
+ /** Batch request ID; unset when the batch was refused. */
366
+ readonly requestId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
367
+ readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "refused" | "submitted">]>;
368
+ /** One result per leg, in request order. */
369
+ readonly legs: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
370
+ readonly legIndex: v.NumberSchema<undefined>;
371
+ readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "refused" | "pending" | "accepted" | "not_submitted">]>;
372
+ readonly requestId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
373
+ readonly transferId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
374
+ readonly flowId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
375
+ readonly acceptedAtTsNs: v.OptionalSchema<v.BigintSchema<undefined>, 0n>;
376
+ readonly assetId: v.NumberSchema<undefined>;
377
+ readonly assetCode: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
378
+ readonly amountE18: v.OptionalSchema<v.ObjectSchema<{
379
+ readonly hi: v.BigintSchema<undefined>;
380
+ readonly lo: v.BigintSchema<undefined>;
381
+ }, undefined>, undefined>;
382
+ readonly destination: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
383
+ readonly rootAccountPublicId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
384
+ readonly subaccountPublicId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
385
+ readonly smartAccountAddress: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
386
+ }, undefined>, v.TransformAction<{
387
+ rootAccountPublicId?: string | undefined;
388
+ subaccountPublicId?: string | undefined;
389
+ smartAccountAddress?: string | undefined;
390
+ }, {
391
+ rootAccountId: string | undefined;
392
+ subaccountId: string | undefined;
393
+ smartAccountAddress: string | undefined;
394
+ }>]>, undefined>;
395
+ readonly errorCode: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
396
+ readonly errorMessage: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, string | undefined>]>;
397
+ }, undefined>, v.TransformAction<{
398
+ legIndex: number;
399
+ status: "unspecified" | "refused" | "pending" | "accepted" | "not_submitted";
400
+ requestId?: string | undefined;
401
+ transferId?: string | undefined;
402
+ flowId?: string | undefined;
403
+ acceptedAtTsNs: bigint;
404
+ assetId: number;
405
+ assetCode?: string | undefined;
406
+ amountE18?: {
407
+ hi: bigint;
408
+ lo: bigint;
409
+ } | undefined;
410
+ destination?: {
411
+ rootAccountId: string | undefined;
412
+ subaccountId: string | undefined;
413
+ smartAccountAddress: string | undefined;
414
+ } | undefined;
415
+ errorCode: number;
416
+ errorMessage?: string | undefined;
417
+ }, {
418
+ acceptedAtUnixMs: number | undefined;
419
+ acceptedAtNs: string | undefined;
420
+ quantity: string | undefined;
421
+ /** Why the leg was refused, or why its outcome is not known yet; unset otherwise. */
422
+ errorCode: "UNSPECIFIED" | "UNAUTHENTICATED" | "RATE_LIMIT_EXCEEDED" | "CONFLICT" | "INVALID_REQUEST" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR" | "PERMISSION_DENIED" | "FAILED_PRECONDITION" | "SUBACCOUNT_NOT_FOUND" | "INSUFFICIENT_FUNDS" | "INVALID_SUBACCOUNT_ID" | "SOURCE_ACCOUNT_INACTIVE" | "UNSUPPORTED_ASSET" | "INVALID_AMOUNT" | "INVALID_DESTINATION" | "DESTINATION_NOT_FOUND" | "DESTINATION_INACTIVE" | "SAME_SOURCE_DESTINATION" | "DESTINATION_NOT_WHITELISTED" | "SMART_ACCOUNT_UNAVAILABLE" | "STEP_UP_UNAVAILABLE" | "IDEMPOTENCY_CONFLICT" | "FUNDS_LOCK_CONFLICT" | "CAPITAL_VIEW_UNAVAILABLE" | "ACCOUNT_SHARD_UNAVAILABLE" | "POLICY_DENIED" | "NOT_FOUND" | "DUST_QUOTE_EXPIRED" | "DUST_PRICE_MOVED" | "DUST_NOT_ELIGIBLE" | "DUST_WINDOW_ACTIVE" | "DUST_DAILY_LIMIT" | "DUST_BUSY" | "DUST_TARGET_UNAVAILABLE" | "DUST_BALANCE_CHANGED" | "DUST_CONVERSION_FAILED" | undefined;
423
+ legIndex: number;
424
+ status: "unspecified" | "refused" | "pending" | "accepted" | "not_submitted";
425
+ requestId?: string | undefined;
426
+ transferId?: string | undefined;
427
+ flowId?: string | undefined;
428
+ assetId: number;
429
+ assetCode?: string | undefined;
430
+ destination?: {
431
+ rootAccountId: string | undefined;
432
+ subaccountId: string | undefined;
433
+ smartAccountAddress: string | undefined;
434
+ } | undefined;
435
+ errorMessage?: string | undefined;
436
+ }>]>, undefined>, readonly []>;
437
+ }, undefined>;
438
+ type BatchCreateInternalTransfersResult = v.InferOutput<typeof BatchCreateInternalTransfersResultSchema>;
179
439
  declare const GetInternalTransferInputSchema: v.SchemaWithPipe<readonly [v.UnionSchema<[v.StrictObjectSchema<{
180
440
  readonly requestId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
181
441
  readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
@@ -228,5 +488,5 @@ declare const GetInternalTransferResultSchema: v.SchemaWithPipe<readonly [v.Obje
228
488
  }>]>;
229
489
  type GetInternalTransferResult = v.InferOutput<typeof GetInternalTransferResultSchema>;
230
490
  //#endregion
231
- export { CreateInternalTransferInput, CreateInternalTransferResult, GetInternalTransferInput, GetInternalTransferInputSchema, GetInternalTransferResult, GetInternalTransferResultSchema, InternalTransferDestination, InternalTransferDestinationInputSchema, ResolvedInternalTransferDestination, ResolvedInternalTransferDestinationSchema, createCreateInternalTransferInputSchema, createCreateInternalTransferResultSchema };
491
+ export { BatchCreateInternalTransfersInput, BatchCreateInternalTransfersResult, BatchCreateInternalTransfersResultSchema, CreateInternalTransferInput, CreateInternalTransferResult, GetInternalTransferInput, GetInternalTransferInputSchema, GetInternalTransferResult, GetInternalTransferResultSchema, InternalTransferBatchLegInput, InternalTransferBatchLegResult, InternalTransferDestination, InternalTransferDestinationInputSchema, ResolvedInternalTransferDestination, ResolvedInternalTransferDestinationSchema, createBatchCreateInternalTransfersInputSchema, createCreateInternalTransferInputSchema, createCreateInternalTransferResultSchema };
232
492
  //# sourceMappingURL=internal-transfers.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal-transfers.schemas.d.ts","names":[],"sources":["../../../src/services/internal-transfers/internal-transfers.schemas.ts"],"mappings":";;;;cAyBa,wCAAsC,EAAA,yBAAA,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoCvC,8BAA8B,EAAE,kBACjC;iBAGK,wCAAwC,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAAA;;;;;;;;;;;;;;;KA0B7D,8BAA8B,EAAE,WACxC,kBAAkB;cAYT,2CAAyC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;KAa1C,sCAAsC,EAAE,mBACzC;iBAGK,4CAAwC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuB5C,+BAA+B,EAAE,YACzC,kBAAkB;cAKT,gCAA8B,EAAA,yBAAA,EAAA,aAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqB/B,2BAA2B,EAAE,kBAAkB;cAE9C,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;KAehC,4BAA4B,EAAE,mBAAmB"}
1
+ {"version":3,"file":"internal-transfers.schemas.d.ts","names":[],"sources":["../../../src/services/internal-transfers/internal-transfers.schemas.ts"],"mappings":";;;;cA6Ba,wCAAsC,EAAA,yBAAA,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoCvC,8BAA8B,EAAE,kBACjC;iBAGK,wCAAwC,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAAA;;;;;;;;;;;;;;;KA0B7D,8BAA8B,EAAE,WACxC,kBAAkB;cAYT,2CAAyC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;KAa1C,sCAAsC,EAAE,mBACzC;iBAGK,4CAAwC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyB5C,+BAA+B,EAAE,YACzC,kBAAkB;iBAMN,8CAA8C,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAA;;;;;;;;;;;;;;KA4CnE,oCAAoC,EAAE,WAC9C,kBAAkB;KAEV,gCAAgC;cAEtC,sCAAoC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyB9B,iCAAiC,EAAE,mBACpC;cAGE,0CAAwC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAQzC,qCAAqC,EAAE,mBACxC;cAKE,gCAA8B,EAAA,yBAAA,EAAA,aAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqB/B,2BAA2B,EAAE,kBAAkB;cAE9C,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;KAehC,4BAA4B,EAAE,mBAAmB"}
@@ -1,11 +1,11 @@
1
1
  import { tsNsToMs } from "../../utils/time.js";
2
2
  import { U128Schema, idInputSchema } from "../../shared/schemas.js";
3
3
  import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
4
+ import { fromU128, toU128 } from "../../utils/u128.js";
4
5
  import { quantityInputToE18, scaledToDecimalOutput } from "../../shared/decimal-surface.js";
5
6
  import { PositiveUint32InputSchema } from "../shared.js";
6
- import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
7
- import { fromU128, toU128 } from "../../utils/u128.js";
8
- import { InternalTransferDestinationCodec, InternalTransferStatusCodec } from "./internal-transfers.codecs.js";
7
+ import { AccountScopeInputEntries, accountScopeToSubaccountId, accountScopeToSubaccountIdOrZero } from "../../shared/account-scope.js";
8
+ import { InternalTransferBatchLegStatusCodec, InternalTransferBatchStatusCodec, InternalTransferDestinationCodec, InternalTransferStatusCodec, internalTransferErrorCodeName } from "./internal-transfers.codecs.js";
9
9
  import * as v from "valibot";
10
10
  //#region src/services/internal-transfers/internal-transfers.schemas.ts
11
11
  const IdSchema = idInputSchema;
@@ -77,14 +77,72 @@ function createCreateInternalTransferResultSchema() {
77
77
  amountE18: U128Schema,
78
78
  destination: v.optional(ResolvedInternalTransferDestinationSchema),
79
79
  status: enumLabelSchema(InternalTransferStatusCodec.protoToOutput),
80
- /** Lifecycle flow ID for `lifecycle.getFlow`; empty when the server did not return one. */
80
+ /** Lifecycle flow ID for `lifecycle.getAccountFlow`; empty when the server did not return one. */
81
81
  flowId: v.optional(v.pipe(v.string(), v.trim()), "")
82
82
  }), v.transform(({ acceptedAtTsNs, amountE18, ...result }) => ({
83
83
  ...result,
84
84
  acceptedAtUnixMs: tsNsToMs(acceptedAtTsNs),
85
+ /** Exact acceptance time in nanoseconds since epoch, as a decimal string. */
86
+ acceptedAtNs: acceptedAtTsNs.toString(),
85
87
  quantity: scaledToDecimalOutput(fromU128(amountE18), 18)
86
88
  })));
87
89
  }
90
+ function createBatchCreateInternalTransfersInputSchema(scales) {
91
+ return v.pipe(v.strictObject({
92
+ /**
93
+ * Up to 10 transfers, run in order. Each leg debits its own `account` (the
94
+ * resolved active account when omitted), and legs may repeat an asset, a source or a
95
+ * destination. Each leg counts as one internal transfer against the rate limit.
96
+ */
97
+ legs: v.pipe(v.array(v.strictObject({
98
+ ...AccountScopeInputEntries,
99
+ destination: InternalTransferDestinationInputSchema,
100
+ assetId: PositiveUint32InputSchema,
101
+ quantity: v.string()
102
+ })), v.minLength(1, "A batch needs at least one leg."), v.maxLength(10, `A batch holds at most 10 legs.`)),
103
+ /** Covers the whole batch; a retry must send the same legs in the same order. */
104
+ idempotencyKey: v.pipe(v.string(), v.trim(), v.minLength(1))
105
+ }), v.transform(({ legs, idempotencyKey }) => ({
106
+ idempotencyKey,
107
+ legs: legs.map(({ account, quantity, ...leg }) => ({
108
+ ...leg,
109
+ subaccountId: accountScopeToSubaccountIdOrZero(account),
110
+ amountE18: toU128(quantityInputToE18({
111
+ scales,
112
+ assetId: leg.assetId,
113
+ quantity
114
+ }))
115
+ }))
116
+ })));
117
+ }
118
+ const InternalTransferBatchLegResultSchema = v.pipe(v.object({
119
+ legIndex: v.number(),
120
+ status: enumLabelSchema(InternalTransferBatchLegStatusCodec.protoToOutput),
121
+ requestId: OptionalResponseStringSchema,
122
+ transferId: OptionalResponseStringSchema,
123
+ flowId: OptionalResponseStringSchema,
124
+ acceptedAtTsNs: v.optional(v.bigint(), 0n),
125
+ assetId: v.number(),
126
+ assetCode: OptionalResponseStringSchema,
127
+ amountE18: v.optional(U128Schema),
128
+ destination: v.optional(ResolvedInternalTransferDestinationSchema),
129
+ errorCode: v.optional(v.number(), 0),
130
+ errorMessage: OptionalResponseStringSchema
131
+ }), v.transform(({ acceptedAtTsNs, amountE18, errorCode, ...leg }) => ({
132
+ ...leg,
133
+ acceptedAtUnixMs: acceptedAtTsNs ? tsNsToMs(acceptedAtTsNs) : void 0,
134
+ acceptedAtNs: acceptedAtTsNs ? acceptedAtTsNs.toString() : void 0,
135
+ quantity: amountE18 ? scaledToDecimalOutput(fromU128(amountE18), 18) : void 0,
136
+ /** Why the leg was refused, or why its outcome is not known yet; unset otherwise. */
137
+ errorCode: errorCode ? internalTransferErrorCodeName(errorCode) : void 0
138
+ })));
139
+ const BatchCreateInternalTransfersResultSchema = v.object({
140
+ /** Batch request ID; unset when the batch was refused. */
141
+ requestId: OptionalResponseStringSchema,
142
+ status: enumLabelSchema(InternalTransferBatchStatusCodec.protoToOutput),
143
+ /** One result per leg, in request order. */
144
+ legs: v.optional(v.array(InternalTransferBatchLegResultSchema), [])
145
+ });
88
146
  const TransferLookupIdSchema = v.pipe(v.string(), v.trim(), v.minLength(1));
89
147
  const GetInternalTransferInputSchema = v.pipe(v.union([v.strictObject({
90
148
  ...AccountScopeInputEntries,
@@ -114,6 +172,6 @@ const GetInternalTransferResultSchema = v.pipe(v.object({
114
172
  acceptedAtNs: acceptedAtTsNs.toString()
115
173
  })));
116
174
  //#endregion
117
- export { GetInternalTransferInputSchema, GetInternalTransferResultSchema, InternalTransferDestinationInputSchema, ResolvedInternalTransferDestinationSchema, createCreateInternalTransferInputSchema, createCreateInternalTransferResultSchema };
175
+ export { BatchCreateInternalTransfersResultSchema, GetInternalTransferInputSchema, GetInternalTransferResultSchema, InternalTransferDestinationInputSchema, ResolvedInternalTransferDestinationSchema, createBatchCreateInternalTransfersInputSchema, createCreateInternalTransferInputSchema, createCreateInternalTransferResultSchema };
118
176
 
119
177
  //# sourceMappingURL=internal-transfers.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal-transfers.schemas.js","names":[],"sources":["../../../src/services/internal-transfers/internal-transfers.schemas.ts"],"sourcesContent":["import type { MessageInitShape } from \"@bufbuild/protobuf\";\nimport { PositiveUint32InputSchema } from \"../shared.js\";\nimport * as v from \"valibot\";\nimport type * as Proto from \"../../gen/transfer/v1/internal_transfer_pb.js\";\nimport { idInputSchema, U128Schema } from \"../../shared/schemas.js\";\nimport { tsNsToMs } from \"../../utils/time.js\";\nimport {\n E18_SCALE,\n quantityInputToE18,\n scaledToDecimalOutput,\n type SdkScales,\n} from \"../../shared/decimal-surface.js\";\nimport {\n InternalTransferDestinationCodec,\n InternalTransferStatusCodec,\n} from \"./internal-transfers.codecs.js\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { fromU128, toU128 } from \"../../utils/u128.js\";\n\nconst IdSchema = idInputSchema;\n\nexport const InternalTransferDestinationInputSchema = v.pipe(\n v.variant(\"type\", [\n v.strictObject({\n type: v.literal(\"account\"),\n accountId: IdSchema(\"accountId\"),\n }),\n v.strictObject({\n type: v.literal(\"subaccount\"),\n subaccountId: IdSchema(\"subaccountId\"),\n }),\n v.strictObject({\n type: v.literal(\"smartAccountAddress\"),\n address: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n ]),\n v.transform((destination) => {\n switch (destination.type) {\n case \"account\":\n return {\n case: InternalTransferDestinationCodec.inputToProtoCase.account,\n value: destination.accountId,\n } as const;\n case \"subaccount\":\n return {\n case: InternalTransferDestinationCodec.inputToProtoCase.subaccount,\n value: destination.subaccountId,\n } as const;\n case \"smartAccountAddress\":\n return {\n case: InternalTransferDestinationCodec.inputToProtoCase.smartAccountAddress,\n value: destination.address,\n } as const;\n }\n }),\n);\n\nexport type InternalTransferDestination = v.InferInput<\n typeof InternalTransferDestinationInputSchema\n>;\n\nexport function createCreateInternalTransferInputSchema(scales: SdkScales) {\n return v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n destination: InternalTransferDestinationInputSchema,\n assetId: PositiveUint32InputSchema,\n quantity: v.string(),\n idempotencyKey: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n v.transform(\n ({ account, quantity, ...input }) =>\n ({\n ...input,\n amountE18: toU128(\n quantityInputToE18({\n scales,\n assetId: input.assetId,\n quantity,\n }),\n ),\n subaccountId: accountScopeToSubaccountId(account),\n }) satisfies MessageInitShape<typeof Proto.CreateInternalTransferRequestSchema>,\n ),\n );\n}\n\nexport type CreateInternalTransferInput = v.InferInput<\n ReturnType<typeof createCreateInternalTransferInputSchema>\n>;\nexport type CreateInternalTransferRequest = v.InferOutput<\n ReturnType<typeof createCreateInternalTransferInputSchema>\n>;\n\nconst NonEmptyResponseStringSchema = v.pipe(v.string(), v.trim(), v.minLength(1));\nconst OptionalResponseStringSchema = v.pipe(\n v.optional(v.pipe(v.string(), v.trim())),\n v.transform((value) => (value ? value : undefined)),\n);\n\nexport const ResolvedInternalTransferDestinationSchema = v.pipe(\n v.object({\n rootAccountPublicId: OptionalResponseStringSchema,\n subaccountPublicId: OptionalResponseStringSchema,\n smartAccountAddress: OptionalResponseStringSchema,\n }),\n v.transform(({ rootAccountPublicId, subaccountPublicId, smartAccountAddress }) => ({\n rootAccountId: rootAccountPublicId,\n subaccountId: subaccountPublicId,\n smartAccountAddress,\n })),\n);\n\nexport type ResolvedInternalTransferDestination = v.InferOutput<\n typeof ResolvedInternalTransferDestinationSchema\n>;\n\nexport function createCreateInternalTransferResultSchema() {\n return v.pipe(\n v.object({\n requestId: NonEmptyResponseStringSchema,\n transferId: NonEmptyResponseStringSchema,\n acceptedAtTsNs: v.bigint(),\n assetId: v.number(),\n assetCode: NonEmptyResponseStringSchema,\n uAssetId: NonEmptyResponseStringSchema,\n amountE18: U128Schema,\n destination: v.optional(ResolvedInternalTransferDestinationSchema),\n status: enumLabelSchema(InternalTransferStatusCodec.protoToOutput),\n /** Lifecycle flow ID for `lifecycle.getFlow`; empty when the server did not return one. */\n flowId: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ acceptedAtTsNs, amountE18, ...result }) => ({\n ...result,\n acceptedAtUnixMs: tsNsToMs(acceptedAtTsNs),\n quantity: scaledToDecimalOutput(fromU128(amountE18), E18_SCALE),\n })),\n );\n}\n\nexport type CreateInternalTransferResult = v.InferOutput<\n ReturnType<typeof createCreateInternalTransferResultSchema>\n>;\n\nconst TransferLookupIdSchema = v.pipe(v.string(), v.trim(), v.minLength(1));\n\nexport const GetInternalTransferInputSchema = v.pipe(\n v.union(\n [\n v.strictObject({ ...AccountScopeInputEntries, requestId: TransferLookupIdSchema }),\n v.strictObject({ ...AccountScopeInputEntries, transferId: TransferLookupIdSchema }),\n ],\n \"Pass exactly one of requestId or transferId.\",\n ),\n v.transform(\n ({ account, ...selector }) =>\n ({\n subaccountId: accountScopeToSubaccountId(account),\n identifier:\n \"requestId\" in selector\n ? { case: \"requestId\", value: selector.requestId }\n : { case: \"transferId\", value: selector.transferId },\n }) satisfies MessageInitShape<typeof Proto.GetInternalTransferRequestSchema>,\n ),\n);\n\n/** Selects an accepted transfer by exactly one of its `requestId` or `transferId`. */\nexport type GetInternalTransferInput = v.InferInput<typeof GetInternalTransferInputSchema>;\n\nexport const GetInternalTransferResultSchema = v.pipe(\n v.object({\n requestId: NonEmptyResponseStringSchema,\n transferId: NonEmptyResponseStringSchema,\n flowId: NonEmptyResponseStringSchema,\n acceptedAtTsNs: v.bigint(),\n }),\n v.transform(({ acceptedAtTsNs, ...result }) => ({\n ...result,\n acceptedAtUnixMs: tsNsToMs(acceptedAtTsNs),\n /** Exact acceptance time in nanoseconds since epoch, as a decimal string. */\n acceptedAtNs: acceptedAtTsNs.toString(),\n })),\n);\n\nexport type GetInternalTransferResult = v.InferOutput<typeof GetInternalTransferResultSchema>;\n"],"mappings":"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"}
1
+ {"version":3,"file":"internal-transfers.schemas.js","names":[],"sources":["../../../src/services/internal-transfers/internal-transfers.schemas.ts"],"sourcesContent":["import type { MessageInitShape } from \"@bufbuild/protobuf\";\nimport { PositiveUint32InputSchema } from \"../shared.js\";\nimport * as v from \"valibot\";\nimport type * as Proto from \"../../gen/transfer/v1/internal_transfer_pb.js\";\nimport { idInputSchema, U128Schema } from \"../../shared/schemas.js\";\nimport { tsNsToMs } from \"../../utils/time.js\";\nimport {\n E18_SCALE,\n quantityInputToE18,\n scaledToDecimalOutput,\n type SdkScales,\n} from \"../../shared/decimal-surface.js\";\nimport {\n InternalTransferBatchLegStatusCodec,\n InternalTransferBatchStatusCodec,\n InternalTransferDestinationCodec,\n InternalTransferStatusCodec,\n internalTransferErrorCodeName,\n} from \"./internal-transfers.codecs.js\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n accountScopeToSubaccountIdOrZero,\n} from \"../../shared/account-scope.js\";\nimport { fromU128, toU128 } from \"../../utils/u128.js\";\n\nconst IdSchema = idInputSchema;\n\nexport const InternalTransferDestinationInputSchema = v.pipe(\n v.variant(\"type\", [\n v.strictObject({\n type: v.literal(\"account\"),\n accountId: IdSchema(\"accountId\"),\n }),\n v.strictObject({\n type: v.literal(\"subaccount\"),\n subaccountId: IdSchema(\"subaccountId\"),\n }),\n v.strictObject({\n type: v.literal(\"smartAccountAddress\"),\n address: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n ]),\n v.transform((destination) => {\n switch (destination.type) {\n case \"account\":\n return {\n case: InternalTransferDestinationCodec.inputToProtoCase.account,\n value: destination.accountId,\n } as const;\n case \"subaccount\":\n return {\n case: InternalTransferDestinationCodec.inputToProtoCase.subaccount,\n value: destination.subaccountId,\n } as const;\n case \"smartAccountAddress\":\n return {\n case: InternalTransferDestinationCodec.inputToProtoCase.smartAccountAddress,\n value: destination.address,\n } as const;\n }\n }),\n);\n\nexport type InternalTransferDestination = v.InferInput<\n typeof InternalTransferDestinationInputSchema\n>;\n\nexport function createCreateInternalTransferInputSchema(scales: SdkScales) {\n return v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n destination: InternalTransferDestinationInputSchema,\n assetId: PositiveUint32InputSchema,\n quantity: v.string(),\n idempotencyKey: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n v.transform(\n ({ account, quantity, ...input }) =>\n ({\n ...input,\n amountE18: toU128(\n quantityInputToE18({\n scales,\n assetId: input.assetId,\n quantity,\n }),\n ),\n subaccountId: accountScopeToSubaccountId(account),\n }) satisfies MessageInitShape<typeof Proto.CreateInternalTransferRequestSchema>,\n ),\n );\n}\n\nexport type CreateInternalTransferInput = v.InferInput<\n ReturnType<typeof createCreateInternalTransferInputSchema>\n>;\nexport type CreateInternalTransferRequest = v.InferOutput<\n ReturnType<typeof createCreateInternalTransferInputSchema>\n>;\n\nconst NonEmptyResponseStringSchema = v.pipe(v.string(), v.trim(), v.minLength(1));\nconst OptionalResponseStringSchema = v.pipe(\n v.optional(v.pipe(v.string(), v.trim())),\n v.transform((value) => (value ? value : undefined)),\n);\n\nexport const ResolvedInternalTransferDestinationSchema = v.pipe(\n v.object({\n rootAccountPublicId: OptionalResponseStringSchema,\n subaccountPublicId: OptionalResponseStringSchema,\n smartAccountAddress: OptionalResponseStringSchema,\n }),\n v.transform(({ rootAccountPublicId, subaccountPublicId, smartAccountAddress }) => ({\n rootAccountId: rootAccountPublicId,\n subaccountId: subaccountPublicId,\n smartAccountAddress,\n })),\n);\n\nexport type ResolvedInternalTransferDestination = v.InferOutput<\n typeof ResolvedInternalTransferDestinationSchema\n>;\n\nexport function createCreateInternalTransferResultSchema() {\n return v.pipe(\n v.object({\n requestId: NonEmptyResponseStringSchema,\n transferId: NonEmptyResponseStringSchema,\n acceptedAtTsNs: v.bigint(),\n assetId: v.number(),\n assetCode: NonEmptyResponseStringSchema,\n uAssetId: NonEmptyResponseStringSchema,\n amountE18: U128Schema,\n destination: v.optional(ResolvedInternalTransferDestinationSchema),\n status: enumLabelSchema(InternalTransferStatusCodec.protoToOutput),\n /** Lifecycle flow ID for `lifecycle.getAccountFlow`; empty when the server did not return one. */\n flowId: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ acceptedAtTsNs, amountE18, ...result }) => ({\n ...result,\n acceptedAtUnixMs: tsNsToMs(acceptedAtTsNs),\n /** Exact acceptance time in nanoseconds since epoch, as a decimal string. */\n acceptedAtNs: acceptedAtTsNs.toString(),\n quantity: scaledToDecimalOutput(fromU128(amountE18), E18_SCALE),\n })),\n );\n}\n\nexport type CreateInternalTransferResult = v.InferOutput<\n ReturnType<typeof createCreateInternalTransferResultSchema>\n>;\n\n/** The most legs one batch may carry. */\nexport const MAX_INTERNAL_TRANSFER_BATCH_LEGS = 10;\n\nexport function createBatchCreateInternalTransfersInputSchema(scales: SdkScales) {\n return v.pipe(\n v.strictObject({\n /**\n * Up to 10 transfers, run in order. Each leg debits its own `account` (the\n * resolved active account when omitted), and legs may repeat an asset, a source or a\n * destination. Each leg counts as one internal transfer against the rate limit.\n */\n legs: v.pipe(\n v.array(\n v.strictObject({\n ...AccountScopeInputEntries,\n destination: InternalTransferDestinationInputSchema,\n assetId: PositiveUint32InputSchema,\n quantity: v.string(),\n }),\n ),\n v.minLength(1, \"A batch needs at least one leg.\"),\n v.maxLength(\n MAX_INTERNAL_TRANSFER_BATCH_LEGS,\n `A batch holds at most ${MAX_INTERNAL_TRANSFER_BATCH_LEGS} legs.`,\n ),\n ),\n /** Covers the whole batch; a retry must send the same legs in the same order. */\n idempotencyKey: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n v.transform(\n ({ legs, idempotencyKey }) =>\n ({\n idempotencyKey,\n legs: legs.map(({ account, quantity, ...leg }) => ({\n ...leg,\n subaccountId: accountScopeToSubaccountIdOrZero(account),\n amountE18: toU128(\n quantityInputToE18({ scales, assetId: leg.assetId, quantity }),\n ),\n })),\n }) satisfies MessageInitShape<\n typeof Proto.BatchCreateInternalTransfersRequestSchema\n >,\n ),\n );\n}\n\nexport type BatchCreateInternalTransfersInput = v.InferInput<\n ReturnType<typeof createBatchCreateInternalTransfersInputSchema>\n>;\nexport type InternalTransferBatchLegInput = BatchCreateInternalTransfersInput[\"legs\"][number];\n\nconst InternalTransferBatchLegResultSchema = v.pipe(\n v.object({\n legIndex: v.number(),\n status: enumLabelSchema(InternalTransferBatchLegStatusCodec.protoToOutput),\n requestId: OptionalResponseStringSchema,\n transferId: OptionalResponseStringSchema,\n flowId: OptionalResponseStringSchema,\n acceptedAtTsNs: v.optional(v.bigint(), 0n),\n assetId: v.number(),\n assetCode: OptionalResponseStringSchema,\n amountE18: v.optional(U128Schema),\n destination: v.optional(ResolvedInternalTransferDestinationSchema),\n errorCode: v.optional(v.number(), 0),\n errorMessage: OptionalResponseStringSchema,\n }),\n v.transform(({ acceptedAtTsNs, amountE18, errorCode, ...leg }) => ({\n ...leg,\n acceptedAtUnixMs: acceptedAtTsNs ? tsNsToMs(acceptedAtTsNs) : undefined,\n acceptedAtNs: acceptedAtTsNs ? acceptedAtTsNs.toString() : undefined,\n quantity: amountE18 ? scaledToDecimalOutput(fromU128(amountE18), E18_SCALE) : undefined,\n /** Why the leg was refused, or why its outcome is not known yet; unset otherwise. */\n errorCode: errorCode ? internalTransferErrorCodeName(errorCode) : undefined,\n })),\n);\n\nexport type InternalTransferBatchLegResult = v.InferOutput<\n typeof InternalTransferBatchLegResultSchema\n>;\n\nexport const BatchCreateInternalTransfersResultSchema = v.object({\n /** Batch request ID; unset when the batch was refused. */\n requestId: OptionalResponseStringSchema,\n status: enumLabelSchema(InternalTransferBatchStatusCodec.protoToOutput),\n /** One result per leg, in request order. */\n legs: v.optional(v.array(InternalTransferBatchLegResultSchema), []),\n});\n\nexport type BatchCreateInternalTransfersResult = v.InferOutput<\n typeof BatchCreateInternalTransfersResultSchema\n>;\n\nconst TransferLookupIdSchema = v.pipe(v.string(), v.trim(), v.minLength(1));\n\nexport const GetInternalTransferInputSchema = v.pipe(\n v.union(\n [\n v.strictObject({ ...AccountScopeInputEntries, requestId: TransferLookupIdSchema }),\n v.strictObject({ ...AccountScopeInputEntries, transferId: TransferLookupIdSchema }),\n ],\n \"Pass exactly one of requestId or transferId.\",\n ),\n v.transform(\n ({ account, ...selector }) =>\n ({\n subaccountId: accountScopeToSubaccountId(account),\n identifier:\n \"requestId\" in selector\n ? { case: \"requestId\", value: selector.requestId }\n : { case: \"transferId\", value: selector.transferId },\n }) satisfies MessageInitShape<typeof Proto.GetInternalTransferRequestSchema>,\n ),\n);\n\n/** Selects an accepted transfer by exactly one of its `requestId` or `transferId`. */\nexport type GetInternalTransferInput = v.InferInput<typeof GetInternalTransferInputSchema>;\n\nexport const GetInternalTransferResultSchema = v.pipe(\n v.object({\n requestId: NonEmptyResponseStringSchema,\n transferId: NonEmptyResponseStringSchema,\n flowId: NonEmptyResponseStringSchema,\n acceptedAtTsNs: v.bigint(),\n }),\n v.transform(({ acceptedAtTsNs, ...result }) => ({\n ...result,\n acceptedAtUnixMs: tsNsToMs(acceptedAtTsNs),\n /** Exact acceptance time in nanoseconds since epoch, as a decimal string. */\n acceptedAtNs: acceptedAtTsNs.toString(),\n })),\n);\n\nexport type GetInternalTransferResult = v.InferOutput<typeof GetInternalTransferResultSchema>;\n"],"mappings":"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"}
@@ -1,3 +1,3 @@
1
- import { CreateInternalTransferInput, CreateInternalTransferResult, GetInternalTransferInput, GetInternalTransferResult, InternalTransferDestination, ResolvedInternalTransferDestination } from "./internal-transfers.schemas.js";
2
- import { InternalTransferStatus } from "./internal-transfers.codecs.js";
3
- export type { CreateInternalTransferInput, CreateInternalTransferResult, GetInternalTransferInput, GetInternalTransferResult, InternalTransferDestination, InternalTransferStatus, ResolvedInternalTransferDestination };
1
+ import { BatchCreateInternalTransfersInput, BatchCreateInternalTransfersResult, CreateInternalTransferInput, CreateInternalTransferResult, GetInternalTransferInput, GetInternalTransferResult, InternalTransferBatchLegInput, InternalTransferBatchLegResult, InternalTransferDestination, ResolvedInternalTransferDestination } from "./internal-transfers.schemas.js";
2
+ import { InternalTransferBatchLegStatus, InternalTransferBatchStatus, InternalTransferErrorCode, InternalTransferStatus } from "./internal-transfers.codecs.js";
3
+ export type { BatchCreateInternalTransfersInput, BatchCreateInternalTransfersResult, CreateInternalTransferInput, CreateInternalTransferResult, GetInternalTransferInput, GetInternalTransferResult, InternalTransferBatchLegInput, InternalTransferBatchLegResult, InternalTransferBatchLegStatus, InternalTransferBatchStatus, InternalTransferDestination, InternalTransferErrorCode, InternalTransferStatus, ResolvedInternalTransferDestination };
@@ -9,7 +9,7 @@ declare const LIFECYCLE_SORT_VALUES: readonly ["newest", "oldest"];
9
9
  type LifecycleSortValue = (typeof LIFECYCLE_SORT_VALUES)[number];
10
10
  declare const LIFECYCLE_LIST_ORDER_BY_VALUES: readonly ["last_activity", "started_at"];
11
11
  type LifecycleListOrderByValue = (typeof LIFECYCLE_LIST_ORDER_BY_VALUES)[number];
12
- declare const LIFECYCLE_REASON_VALUES: readonly ["unspecified", "zipper_validation_rejected", "zipper_execution_rejected", "zipper_withdraw_execution_failed", "zipper_deposit_refund_failed", "zipper_compliance_transferred", "ledger_mirror_rejected", "ledger_mirror_transfer_exceeds_credits", "ledger_mirror_transfer_exists", "ledger_mirror_pending_transfer_not_found", "ledger_mirror_transfer_id_already_failed", "trading_withdraw_policy_denied", "trading_withdraw_contract_reverted", "trading_withdraw_execution_failed", "deposit_source_not_confirmed"];
12
+ declare const LIFECYCLE_REASON_VALUES: readonly ["unspecified", "zipper_validation_rejected", "zipper_execution_rejected", "zipper_withdraw_execution_failed", "zipper_deposit_refund_failed", "zipper_compliance_transferred", "zipper_deposit_delivered_to_wallet", "ledger_mirror_rejected", "ledger_mirror_transfer_exceeds_credits", "ledger_mirror_transfer_exists", "ledger_mirror_pending_transfer_not_found", "ledger_mirror_transfer_id_already_failed", "trading_withdraw_policy_denied", "trading_withdraw_contract_reverted", "trading_withdraw_execution_failed", "deposit_source_not_confirmed"];
13
13
  /**
14
14
  * Catalog labels plus a code-preserving fallback for wire values the generated
15
15
  * enum does not know. Proto3 enums are open — the backend can emit codes ahead
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.codecs.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.codecs.ts"],"mappings":";;;cAmCa;KACD,kCAAkC;cAKjC;KACD,qCAAqC;cAEpC;KACD,6BAA6B;cAE5B;KACD,oCAAoC;cAEnC;;;;;;KAsBD,+BACE;cAyCD;KACD,yCAAyC;;;;;;cAsNxC;KAsDD,gCACE"}
1
+ {"version":3,"file":"lifecycle.codecs.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.codecs.ts"],"mappings":";;;cAmCa;KACD,kCAAkC;cAKjC;KACD,qCAAqC;cAEpC;KACD,6BAA6B;cAE5B;KACD,oCAAoC;cAEnC;;;;;;KAuBD,+BACE;cAyCD;KACD,yCAAyC;;;;;;cAuNxC;KAsDD,gCACE"}
@@ -112,6 +112,7 @@ const LifecycleReasonCodec = { protoToOutput: {
112
112
  [103]: "zipper_withdraw_execution_failed",
113
113
  [104]: "zipper_deposit_refund_failed",
114
114
  [105]: "zipper_compliance_transferred",
115
+ [106]: "zipper_deposit_delivered_to_wallet",
115
116
  [200]: "ledger_mirror_rejected",
116
117
  [201]: "ledger_mirror_transfer_exceeds_credits",
117
118
  [202]: "ledger_mirror_transfer_exists",