@symmio/trading-core 4.3.0 → 4.4.0

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 (576) hide show
  1. package/dist/core/chains/registry.d.ts.map +1 -1
  2. package/dist/core/chains/registry.js +4 -5
  3. package/dist/core/chains/registry.js.map +1 -1
  4. package/dist/core/chains/types.d.ts +36 -1
  5. package/dist/core/chains/types.d.ts.map +1 -1
  6. package/dist/core/chains/types.js.map +1 -1
  7. package/dist/core/config/merge-chain-config.js +6 -3
  8. package/dist/core/config/merge-chain-config.js.map +1 -1
  9. package/dist/gasless/batch/calls.d.ts +21 -7
  10. package/dist/gasless/batch/calls.d.ts.map +1 -1
  11. package/dist/gasless/batch/calls.js +17 -16
  12. package/dist/gasless/batch/calls.js.map +1 -1
  13. package/dist/gasless/batch/resolve-gasless-batch.d.ts +10 -1
  14. package/dist/gasless/batch/resolve-gasless-batch.d.ts.map +1 -1
  15. package/dist/gasless/batch/resolve-gasless-batch.js +17 -15
  16. package/dist/gasless/batch/resolve-gasless-batch.js.map +1 -1
  17. package/dist/gasless/classify-gasless-failure.d.ts +3 -1
  18. package/dist/gasless/classify-gasless-failure.d.ts.map +1 -1
  19. package/dist/gasless/classify-gasless-failure.js +10 -10
  20. package/dist/gasless/classify-gasless-failure.js.map +1 -1
  21. package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js +5 -5
  22. package/dist/gasless/constants.d.ts +21 -0
  23. package/dist/gasless/constants.d.ts.map +1 -1
  24. package/dist/gasless/constants.js +2 -2
  25. package/dist/gasless/constants.js.map +1 -1
  26. package/dist/gasless/delegation-preflight.js +10 -10
  27. package/dist/gasless/deployment-key.d.ts +39 -0
  28. package/dist/gasless/deployment-key.d.ts.map +1 -0
  29. package/dist/gasless/deployment-key.js +22 -0
  30. package/dist/gasless/deployment-key.js.map +1 -0
  31. package/dist/gasless/dispatch/attempt-start.d.ts +31 -0
  32. package/dist/gasless/dispatch/attempt-start.d.ts.map +1 -0
  33. package/dist/gasless/dispatch/attempt-start.js +14 -0
  34. package/dist/gasless/dispatch/attempt-start.js.map +1 -0
  35. package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts +4 -43
  36. package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts.map +1 -1
  37. package/dist/gasless/dispatch/maybe-relay-as-gasless.js +24 -182
  38. package/dist/gasless/dispatch/maybe-relay-as-gasless.js.map +1 -1
  39. package/dist/gasless/dispatch/resolve-gasless-write.d.ts +40 -0
  40. package/dist/gasless/dispatch/resolve-gasless-write.d.ts.map +1 -0
  41. package/dist/gasless/dispatch/resolve-gasless-write.js +48 -0
  42. package/dist/gasless/dispatch/resolve-gasless-write.js.map +1 -0
  43. package/dist/gasless/dispatch/submit-gasless-write.d.ts +11 -0
  44. package/dist/gasless/dispatch/submit-gasless-write.d.ts.map +1 -0
  45. package/dist/gasless/dispatch/submit-gasless-write.js +180 -0
  46. package/dist/gasless/dispatch/submit-gasless-write.js.map +1 -0
  47. package/dist/gasless/dispatch/types.d.ts +42 -0
  48. package/dist/gasless/dispatch/types.d.ts.map +1 -0
  49. package/dist/gasless/effective-instant-selectors.d.ts +11 -0
  50. package/dist/gasless/effective-instant-selectors.d.ts.map +1 -0
  51. package/dist/gasless/effective-instant-selectors.js +25 -0
  52. package/dist/gasless/effective-instant-selectors.js.map +1 -0
  53. package/dist/gasless/fallback.d.ts +43 -0
  54. package/dist/gasless/fallback.d.ts.map +1 -1
  55. package/dist/gasless/fallback.js +27 -17
  56. package/dist/gasless/fallback.js.map +1 -1
  57. package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts +13 -5
  58. package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts.map +1 -1
  59. package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js +88 -81
  60. package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js.map +1 -1
  61. package/dist/gasless/get-session-key-selectors.d.ts +18 -4
  62. package/dist/gasless/get-session-key-selectors.d.ts.map +1 -1
  63. package/dist/gasless/get-session-key-selectors.js +20 -12
  64. package/dist/gasless/get-session-key-selectors.js.map +1 -1
  65. package/dist/gasless/http.d.ts +7 -7
  66. package/dist/gasless/http.d.ts.map +1 -1
  67. package/dist/gasless/http.js +70 -72
  68. package/dist/gasless/http.js.map +1 -1
  69. package/dist/gasless/idempotency-key.d.ts +33 -0
  70. package/dist/gasless/idempotency-key.d.ts.map +1 -0
  71. package/dist/gasless/idempotency-key.js +15 -0
  72. package/dist/gasless/idempotency-key.js.map +1 -0
  73. package/dist/gasless/index.d.ts +2 -0
  74. package/dist/gasless/index.d.ts.map +1 -1
  75. package/dist/gasless/nonce-lock.d.ts +55 -17
  76. package/dist/gasless/nonce-lock.d.ts.map +1 -1
  77. package/dist/gasless/nonce-lock.js +53 -26
  78. package/dist/gasless/nonce-lock.js.map +1 -1
  79. package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.d.ts +30 -0
  80. package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.d.ts.map +1 -0
  81. package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.js +67 -0
  82. package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.js.map +1 -0
  83. package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts +30 -9
  84. package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts.map +1 -1
  85. package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js +99 -102
  86. package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js.map +1 -1
  87. package/dist/gasless/relay-gasless-batch/resolve-batch-signers.d.ts +18 -0
  88. package/dist/gasless/relay-gasless-batch/resolve-batch-signers.d.ts.map +1 -0
  89. package/dist/gasless/relay-gasless-batch/resolve-batch-signers.js +17 -0
  90. package/dist/gasless/relay-gasless-batch/resolve-batch-signers.js.map +1 -0
  91. package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts +8 -5
  92. package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts.map +1 -1
  93. package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js +22 -16
  94. package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js.map +1 -1
  95. package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts +13 -7
  96. package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts.map +1 -1
  97. package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js +46 -36
  98. package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js.map +1 -1
  99. package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts +14 -15
  100. package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts.map +1 -1
  101. package/dist/gasless/relay-instant-operations/relay-instant-operations.js +12 -11
  102. package/dist/gasless/relay-instant-operations/relay-instant-operations.js.map +1 -1
  103. package/dist/gasless/relayable-writes.d.ts.map +1 -1
  104. package/dist/gasless/relayable-writes.js +28 -0
  105. package/dist/gasless/relayable-writes.js.map +1 -1
  106. package/dist/gasless/request-headers.d.ts +7 -0
  107. package/dist/gasless/request-headers.d.ts.map +1 -0
  108. package/dist/gasless/request-headers.js +34 -0
  109. package/dist/gasless/request-headers.js.map +1 -0
  110. package/dist/gasless/resolve-wallet-identities.js +4 -4
  111. package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts +11 -4
  112. package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts.map +1 -1
  113. package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js +2 -2
  114. package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js.map +1 -1
  115. package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts +10 -14
  116. package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts.map +1 -1
  117. package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js +3 -2
  118. package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js.map +1 -1
  119. package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts +15 -15
  120. package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts.map +1 -1
  121. package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js +13 -12
  122. package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js.map +1 -1
  123. package/dist/gasless/unconfirmed-submit.d.ts +12 -8
  124. package/dist/gasless/unconfirmed-submit.d.ts.map +1 -1
  125. package/dist/gasless/unconfirmed-submit.js +1 -1
  126. package/dist/gasless/unconfirmed-submit.js.map +1 -1
  127. package/dist/index.d.ts +26 -9
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +673 -615
  130. package/dist/shared/errors/symm-error.js +3 -3
  131. package/dist/shared/types/properties.d.ts +45 -8
  132. package/dist/shared/types/properties.d.ts.map +1 -1
  133. package/dist/solvers/capabilities.d.ts.map +1 -1
  134. package/dist/solvers/capabilities.js +4 -2
  135. package/dist/solvers/capabilities.js.map +1 -1
  136. package/dist/solvers/estimated-price/get-estimated-price.js +6 -6
  137. package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -1
  138. package/dist/solvers/force-close/force-close-auto.js +70 -69
  139. package/dist/solvers/force-close/force-close-auto.js.map +1 -1
  140. package/dist/solvers/get-error-message/get-error-message.js +4 -4
  141. package/dist/solvers/get-party-a-upnl/get-party-a-upnl.js +4 -4
  142. package/dist/solvers/get-solver-balance-info/get-solver-balance-info.js +4 -4
  143. package/dist/solvers/get-solver-info/get-solver-info.d.ts +5 -2
  144. package/dist/solvers/get-solver-info/get-solver-info.d.ts.map +1 -1
  145. package/dist/solvers/get-solver-info/get-solver-info.js +14 -12
  146. package/dist/solvers/get-solver-info/get-solver-info.js.map +1 -1
  147. package/dist/solvers/get-solver-info/parse-timelock-info.d.ts +5 -0
  148. package/dist/solvers/get-solver-info/parse-timelock-info.d.ts.map +1 -0
  149. package/dist/solvers/get-solver-info/parse-timelock-info.js +27 -0
  150. package/dist/solvers/get-solver-info/parse-timelock-info.js.map +1 -0
  151. package/dist/solvers/get-solver-open-interest/get-solver-open-interest.js +4 -4
  152. package/dist/solvers/get-solver-price-range/get-solver-price-range.js +4 -4
  153. package/dist/solvers/get-solver-readiness/get-solver-readiness.js +4 -4
  154. package/dist/solvers/instant-open/get-instant-opens/adapters/enigma-instant-opens.js +17 -17
  155. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts +8 -7
  156. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts.map +1 -1
  157. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +43 -39
  158. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js.map +1 -1
  159. package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.d.ts +16 -0
  160. package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.d.ts.map +1 -0
  161. package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.js +92 -0
  162. package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.js.map +1 -0
  163. package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +1 -1
  164. package/dist/solvers/instant-open/instant-open/index.d.ts +2 -0
  165. package/dist/solvers/instant-open/instant-open/index.d.ts.map +1 -1
  166. package/dist/solvers/instant-open/instant-open/instant-open.d.ts +22 -6
  167. package/dist/solvers/instant-open/instant-open/instant-open.d.ts.map +1 -1
  168. package/dist/solvers/instant-open/instant-open/instant-open.js +35 -27
  169. package/dist/solvers/instant-open/instant-open/instant-open.js.map +1 -1
  170. package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.d.ts +12 -0
  171. package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.d.ts.map +1 -0
  172. package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.js +49 -0
  173. package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.js.map +1 -0
  174. package/dist/solvers/instant-open/instant-open/prepared/types.d.ts +20 -0
  175. package/dist/solvers/instant-open/instant-open/prepared/types.d.ts.map +1 -0
  176. package/dist/solvers/instant-open/instant-open/types.d.ts +5 -4
  177. package/dist/solvers/instant-open/instant-open/types.d.ts.map +1 -1
  178. package/dist/solvers/instant-open/shared/hedger-api.d.ts.map +1 -1
  179. package/dist/solvers/instant-open/shared/hedger-api.js +38 -26
  180. package/dist/solvers/instant-open/shared/hedger-api.js.map +1 -1
  181. package/dist/solvers/markets/adapters/enigma-markets.js +34 -34
  182. package/dist/solvers/notional-cap/get-notional-cap-page.js +4 -4
  183. package/dist/solvers/revenue/get-solver-revenue.js +10 -10
  184. package/dist/solvers/revenue-records/get-revenue-records.js +11 -11
  185. package/dist/solvers/symbols/get-symbols.js +13 -13
  186. package/dist/solvers/trade-volume/get-trade-volume.js +10 -10
  187. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts +46 -0
  188. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts.map +1 -1
  189. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js +53 -0
  190. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -1
  191. package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +3 -0
  192. package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts.map +1 -1
  193. package/dist/symmio-contracts/account-layer/actions/add-margin.js +41 -27
  194. package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
  195. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +23 -9
  196. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts.map +1 -1
  197. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +15 -36
  198. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
  199. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +3 -0
  200. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts.map +1 -1
  201. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +40 -26
  202. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
  203. package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +1 -1
  204. package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts.map +1 -1
  205. package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +18 -37
  206. package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
  207. package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.d.ts +46 -0
  208. package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.d.ts.map +1 -0
  209. package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.js +20 -0
  210. package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.js.map +1 -0
  211. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.d.ts +31 -0
  212. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
  213. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.js +15 -0
  214. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.js.map +1 -0
  215. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.d.ts +54 -0
  216. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.d.ts.map +1 -0
  217. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.js +26 -0
  218. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.js.map +1 -0
  219. package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +3 -0
  220. package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts.map +1 -1
  221. package/dist/symmio-contracts/account-layer/actions/remove-margin.js +50 -32
  222. package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
  223. package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.d.ts +12 -0
  224. package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.d.ts.map +1 -0
  225. package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.js +10 -0
  226. package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.js.map +1 -0
  227. package/dist/symmio-contracts/account-layer/cancel-timelock-op/index.d.ts +3 -0
  228. package/dist/symmio-contracts/account-layer/cancel-timelock-op/index.d.ts.map +1 -0
  229. package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.d.ts +9 -0
  230. package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.d.ts.map +1 -0
  231. package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.js +13 -0
  232. package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.js.map +1 -0
  233. package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.d.ts +12 -0
  234. package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.d.ts.map +1 -0
  235. package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.js +10 -0
  236. package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.js.map +1 -0
  237. package/dist/symmio-contracts/account-layer/clear-timelocks/index.d.ts +3 -0
  238. package/dist/symmio-contracts/account-layer/clear-timelocks/index.d.ts.map +1 -0
  239. package/dist/symmio-contracts/account-layer/clear-timelocks/query.d.ts +9 -0
  240. package/dist/symmio-contracts/account-layer/clear-timelocks/query.d.ts.map +1 -0
  241. package/dist/symmio-contracts/account-layer/clear-timelocks/query.js +13 -0
  242. package/dist/symmio-contracts/account-layer/clear-timelocks/query.js.map +1 -0
  243. package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.d.ts +12 -0
  244. package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.d.ts.map +1 -0
  245. package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js +9 -0
  246. package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js.map +1 -0
  247. package/dist/symmio-contracts/account-layer/execute-timelock-op/index.d.ts +3 -0
  248. package/dist/symmio-contracts/account-layer/execute-timelock-op/index.d.ts.map +1 -0
  249. package/dist/symmio-contracts/account-layer/execute-timelock-op/query.d.ts +9 -0
  250. package/dist/symmio-contracts/account-layer/execute-timelock-op/query.d.ts.map +1 -0
  251. package/dist/symmio-contracts/account-layer/execute-timelock-op/query.js +13 -0
  252. package/dist/symmio-contracts/account-layer/execute-timelock-op/query.js.map +1 -0
  253. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.d.ts +12 -0
  254. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.d.ts.map +1 -0
  255. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.js +16 -0
  256. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.js.map +1 -0
  257. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/index.d.ts +2 -0
  258. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/index.d.ts.map +1 -0
  259. package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.d.ts +12 -0
  260. package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.d.ts.map +1 -0
  261. package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js +22 -0
  262. package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js.map +1 -0
  263. package/dist/symmio-contracts/account-layer/get-selector-timelock/index.d.ts +3 -0
  264. package/dist/symmio-contracts/account-layer/get-selector-timelock/index.d.ts.map +1 -0
  265. package/dist/symmio-contracts/account-layer/get-selector-timelock/query.d.ts +22 -0
  266. package/dist/symmio-contracts/account-layer/get-selector-timelock/query.d.ts.map +1 -0
  267. package/dist/symmio-contracts/account-layer/get-selector-timelock/query.js +21 -0
  268. package/dist/symmio-contracts/account-layer/get-selector-timelock/query.js.map +1 -0
  269. package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.d.ts +12 -0
  270. package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.d.ts.map +1 -0
  271. package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.js +22 -0
  272. package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.js.map +1 -0
  273. package/dist/symmio-contracts/account-layer/get-timelock-schedule/index.d.ts +2 -0
  274. package/dist/symmio-contracts/account-layer/get-timelock-schedule/index.d.ts.map +1 -0
  275. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.d.ts +13 -0
  276. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.d.ts.map +1 -0
  277. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.js +17 -0
  278. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.js.map +1 -0
  279. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/index.d.ts +2 -0
  280. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/index.d.ts.map +1 -0
  281. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.d.ts +12 -0
  282. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.d.ts.map +1 -0
  283. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.js +67 -0
  284. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.js.map +1 -0
  285. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/index.d.ts +3 -0
  286. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/index.d.ts.map +1 -0
  287. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.d.ts +21 -0
  288. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.d.ts.map +1 -0
  289. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.js +21 -0
  290. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.js.map +1 -0
  291. package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.d.ts +15 -0
  292. package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.d.ts.map +1 -0
  293. package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.js +17 -0
  294. package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.js.map +1 -0
  295. package/dist/symmio-contracts/account-layer/hash-timelock-approval/index.d.ts +2 -0
  296. package/dist/symmio-contracts/account-layer/hash-timelock-approval/index.d.ts.map +1 -0
  297. package/dist/symmio-contracts/account-layer/hook-metadata.d.ts +47 -0
  298. package/dist/symmio-contracts/account-layer/hook-metadata.d.ts.map +1 -0
  299. package/dist/symmio-contracts/account-layer/hook-metadata.js +30 -0
  300. package/dist/symmio-contracts/account-layer/hook-metadata.js.map +1 -0
  301. package/dist/symmio-contracts/account-layer/index.d.ts +21 -0
  302. package/dist/symmio-contracts/account-layer/index.d.ts.map +1 -1
  303. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/index.d.ts +2 -0
  304. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/index.d.ts.map +1 -0
  305. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.d.ts +14 -0
  306. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.d.ts.map +1 -0
  307. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.js +17 -0
  308. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.js.map +1 -0
  309. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.js +6 -6
  310. package/dist/symmio-contracts/account-layer/query/get-account-balance-info.js +6 -6
  311. package/dist/symmio-contracts/account-layer/query/get-account-balance-of.js +6 -6
  312. package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.d.ts +43 -0
  313. package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.d.ts.map +1 -0
  314. package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.js +31 -0
  315. package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.js.map +1 -0
  316. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.js +6 -6
  317. package/dist/symmio-contracts/account-layer/query/get-sub-account-virtual-nonce.js +6 -6
  318. package/dist/symmio-contracts/account-layer/query/get-sub-accounts-count-of-user.js +6 -6
  319. package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts-addresses.js +6 -6
  320. package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts.js +6 -6
  321. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-addresses-of-sub-account.js +6 -6
  322. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.d.ts +39 -0
  323. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
  324. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.js +29 -0
  325. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.js.map +1 -0
  326. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.d.ts +39 -0
  327. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.d.ts.map +1 -0
  328. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.js +31 -0
  329. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.js.map +1 -0
  330. package/dist/symmio-contracts/account-layer/query/predict-next-virtual-account.js +6 -6
  331. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/index.d.ts +2 -0
  332. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/index.d.ts.map +1 -0
  333. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.d.ts +19 -0
  334. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.d.ts.map +1 -0
  335. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js +10 -0
  336. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js.map +1 -0
  337. package/dist/symmio-contracts/account-layer/schedule-timelock-op/index.d.ts +3 -0
  338. package/dist/symmio-contracts/account-layer/schedule-timelock-op/index.d.ts.map +1 -0
  339. package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.d.ts +9 -0
  340. package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.d.ts.map +1 -0
  341. package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.js +13 -0
  342. package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.js.map +1 -0
  343. package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.d.ts +12 -0
  344. package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.d.ts.map +1 -0
  345. package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.js +10 -0
  346. package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.js.map +1 -0
  347. package/dist/symmio-contracts/account-layer/setup-timelocks/index.d.ts +3 -0
  348. package/dist/symmio-contracts/account-layer/setup-timelocks/index.d.ts.map +1 -0
  349. package/dist/symmio-contracts/account-layer/setup-timelocks/query.d.ts +9 -0
  350. package/dist/symmio-contracts/account-layer/setup-timelocks/query.d.ts.map +1 -0
  351. package/dist/symmio-contracts/account-layer/setup-timelocks/query.js +13 -0
  352. package/dist/symmio-contracts/account-layer/setup-timelocks/query.js.map +1 -0
  353. package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.d.ts +13 -0
  354. package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.d.ts.map +1 -0
  355. package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.js +18 -0
  356. package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.js.map +1 -0
  357. package/dist/symmio-contracts/account-layer/timelock-selector.d.ts +4 -0
  358. package/dist/symmio-contracts/account-layer/timelock-selector.d.ts.map +1 -0
  359. package/dist/symmio-contracts/account-layer/timelock-selector.js +9 -0
  360. package/dist/symmio-contracts/account-layer/timelock-selector.js.map +1 -0
  361. package/dist/symmio-contracts/account-layer/timelock-test.d.ts +7 -0
  362. package/dist/symmio-contracts/account-layer/timelock-test.d.ts.map +1 -0
  363. package/dist/symmio-contracts/account-layer/timelock-types.d.ts +66 -0
  364. package/dist/symmio-contracts/account-layer/timelock-types.d.ts.map +1 -0
  365. package/dist/symmio-contracts/account-layer/types.d.ts +32 -2
  366. package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
  367. package/dist/symmio-contracts/account-layer/types.js.map +1 -1
  368. package/dist/symmio-contracts/account-layer/write-timelock.d.ts +10 -0
  369. package/dist/symmio-contracts/account-layer/write-timelock.d.ts.map +1 -0
  370. package/dist/symmio-contracts/account-layer/write-timelock.js +51 -0
  371. package/dist/symmio-contracts/account-layer/write-timelock.js.map +1 -0
  372. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +4 -1
  373. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts.map +1 -1
  374. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +42 -38
  375. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
  376. package/dist/symmio-contracts/instant-layer/actions/grant-delegations.d.ts +75 -0
  377. package/dist/symmio-contracts/instant-layer/actions/grant-delegations.d.ts.map +1 -0
  378. package/dist/symmio-contracts/instant-layer/actions/grant-delegations.js +46 -0
  379. package/dist/symmio-contracts/instant-layer/actions/grant-delegations.js.map +1 -0
  380. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.d.ts +32 -0
  381. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.d.ts.map +1 -0
  382. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.js +18 -0
  383. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.js.map +1 -0
  384. package/dist/symmio-contracts/instant-layer/grant-delegations-input.d.ts +33 -0
  385. package/dist/symmio-contracts/instant-layer/grant-delegations-input.d.ts.map +1 -0
  386. package/dist/symmio-contracts/instant-layer/grant-delegations-input.js +18 -0
  387. package/dist/symmio-contracts/instant-layer/grant-delegations-input.js.map +1 -0
  388. package/dist/symmio-contracts/instant-layer/index.d.ts +4 -0
  389. package/dist/symmio-contracts/instant-layer/index.d.ts.map +1 -1
  390. package/dist/symmio-contracts/instant-layer/query/grant-delegations.d.ts +22 -0
  391. package/dist/symmio-contracts/instant-layer/query/grant-delegations.d.ts.map +1 -0
  392. package/dist/symmio-contracts/instant-layer/query/grant-delegations.js +12 -0
  393. package/dist/symmio-contracts/instant-layer/query/grant-delegations.js.map +1 -0
  394. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.d.ts +19 -0
  395. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.d.ts.map +1 -0
  396. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.js +12 -0
  397. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.js.map +1 -0
  398. package/dist/symmio-contracts/symmio/actions/allocate.d.ts +3 -0
  399. package/dist/symmio-contracts/symmio/actions/allocate.d.ts.map +1 -1
  400. package/dist/symmio-contracts/symmio/actions/allocate.js +22 -16
  401. package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
  402. package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.d.ts +74 -0
  403. package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.d.ts.map +1 -0
  404. package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.js +36 -0
  405. package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.js.map +1 -0
  406. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts +3 -0
  407. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts.map +1 -1
  408. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js +32 -29
  409. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js.map +1 -1
  410. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +3 -0
  411. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts.map +1 -1
  412. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +37 -28
  413. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
  414. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +3 -0
  415. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
  416. package/dist/symmio-contracts/symmio/actions/deallocate.js +30 -20
  417. package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
  418. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +5 -0
  419. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts.map +1 -1
  420. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +31 -18
  421. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
  422. package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +4 -0
  423. package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -1
  424. package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +30 -25
  425. package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -1
  426. package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +4 -0
  427. package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -1
  428. package/dist/symmio-contracts/symmio/actions/withdraw.js +12 -8
  429. package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
  430. package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.d.ts +48 -0
  431. package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.d.ts.map +1 -0
  432. package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.js +33 -0
  433. package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.js.map +1 -0
  434. package/dist/symmio-contracts/symmio/execute-account-calls/index.d.ts +3 -0
  435. package/dist/symmio-contracts/symmio/execute-account-calls/index.d.ts.map +1 -0
  436. package/dist/symmio-contracts/symmio/execute-account-calls/query.d.ts +23 -0
  437. package/dist/symmio-contracts/symmio/execute-account-calls/query.d.ts.map +1 -0
  438. package/dist/symmio-contracts/symmio/execute-account-calls/query.js +12 -0
  439. package/dist/symmio-contracts/symmio/execute-account-calls/query.js.map +1 -0
  440. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.d.ts +22 -0
  441. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.d.ts.map +1 -0
  442. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.js +14 -0
  443. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.js.map +1 -0
  444. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/index.d.ts +3 -0
  445. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/index.d.ts.map +1 -0
  446. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.d.ts +34 -0
  447. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.d.ts.map +1 -0
  448. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.js +21 -0
  449. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.js.map +1 -0
  450. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.d.ts +34 -0
  451. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.d.ts.map +1 -0
  452. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.js +35 -0
  453. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.js.map +1 -0
  454. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/index.d.ts +3 -0
  455. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/index.d.ts.map +1 -0
  456. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.d.ts +15 -0
  457. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.d.ts.map +1 -0
  458. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.js +20 -0
  459. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.js.map +1 -0
  460. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.d.ts +22 -0
  461. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.d.ts.map +1 -0
  462. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.js +30 -0
  463. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.js.map +1 -0
  464. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.d.ts +30 -0
  465. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.d.ts.map +1 -0
  466. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.js +15 -0
  467. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.js.map +1 -0
  468. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/index.d.ts +3 -0
  469. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/index.d.ts.map +1 -0
  470. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.d.ts +38 -0
  471. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.d.ts.map +1 -0
  472. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.js +24 -0
  473. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.js.map +1 -0
  474. package/dist/symmio-contracts/symmio/index.d.ts +6 -0
  475. package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
  476. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts.map +1 -1
  477. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +35 -34
  478. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
  479. package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.d.ts +18 -0
  480. package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.d.ts.map +1 -0
  481. package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.js +14 -0
  482. package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.js.map +1 -0
  483. package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.d.ts +18 -0
  484. package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.d.ts.map +1 -0
  485. package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.js +12 -0
  486. package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.js.map +1 -0
  487. package/dist/symmio-subgraph/executeSubgraphRequest.js +3 -3
  488. package/dist/timelock/approval.d.ts +142 -0
  489. package/dist/timelock/approval.d.ts.map +1 -0
  490. package/dist/timelock/approval.js +176 -0
  491. package/dist/timelock/approval.js.map +1 -0
  492. package/dist/timelock/attempt-outcome.d.ts +37 -0
  493. package/dist/timelock/attempt-outcome.d.ts.map +1 -0
  494. package/dist/timelock/attempt-outcome.js +70 -0
  495. package/dist/timelock/attempt-outcome.js.map +1 -0
  496. package/dist/timelock/confirm-write.d.ts +5 -0
  497. package/dist/timelock/confirm-write.d.ts.map +1 -0
  498. package/dist/timelock/confirm-write.js +18 -0
  499. package/dist/timelock/confirm-write.js.map +1 -0
  500. package/dist/timelock/early-withdraw/early-withdraw.d.ts +60 -0
  501. package/dist/timelock/early-withdraw/early-withdraw.d.ts.map +1 -0
  502. package/dist/timelock/early-withdraw/early-withdraw.js +94 -0
  503. package/dist/timelock/early-withdraw/early-withdraw.js.map +1 -0
  504. package/dist/timelock/early-withdraw/index.d.ts +2 -0
  505. package/dist/timelock/early-withdraw/index.d.ts.map +1 -0
  506. package/dist/timelock/errors.d.ts +23 -0
  507. package/dist/timelock/errors.d.ts.map +1 -0
  508. package/dist/timelock/errors.js +29 -0
  509. package/dist/timelock/errors.js.map +1 -0
  510. package/dist/timelock/execute-protected-batch.d.ts +31 -0
  511. package/dist/timelock/execute-protected-batch.d.ts.map +1 -0
  512. package/dist/timelock/execute-protected-batch.js +148 -0
  513. package/dist/timelock/execute-protected-batch.js.map +1 -0
  514. package/dist/timelock/execute-protected-call.d.ts +68 -0
  515. package/dist/timelock/execute-protected-call.d.ts.map +1 -0
  516. package/dist/timelock/execute-protected-call.js +146 -0
  517. package/dist/timelock/execute-protected-call.js.map +1 -0
  518. package/dist/timelock/execute-protected-function.d.ts +51 -0
  519. package/dist/timelock/execute-protected-function.d.ts.map +1 -0
  520. package/dist/timelock/execute-protected-function.js +37 -0
  521. package/dist/timelock/execute-protected-function.js.map +1 -0
  522. package/dist/timelock/get-timelock-policy/get-timelock-policy.d.ts +38 -0
  523. package/dist/timelock/get-timelock-policy/get-timelock-policy.d.ts.map +1 -0
  524. package/dist/timelock/get-timelock-policy/get-timelock-policy.js +49 -0
  525. package/dist/timelock/get-timelock-policy/get-timelock-policy.js.map +1 -0
  526. package/dist/timelock/get-timelock-policy/index.d.ts +3 -0
  527. package/dist/timelock/get-timelock-policy/index.d.ts.map +1 -0
  528. package/dist/timelock/get-timelock-policy/query.d.ts +13 -0
  529. package/dist/timelock/get-timelock-policy/query.d.ts.map +1 -0
  530. package/dist/timelock/get-timelock-policy/query.js +21 -0
  531. package/dist/timelock/get-timelock-policy/query.js.map +1 -0
  532. package/dist/timelock/index.d.ts +14 -0
  533. package/dist/timelock/index.d.ts.map +1 -0
  534. package/dist/timelock/normalize-timelock-revert.d.ts +3 -0
  535. package/dist/timelock/normalize-timelock-revert.d.ts.map +1 -0
  536. package/dist/timelock/normalize-timelock-revert.js +11 -0
  537. package/dist/timelock/normalize-timelock-revert.js.map +1 -0
  538. package/dist/timelock/policy-change.d.ts +72 -0
  539. package/dist/timelock/policy-change.d.ts.map +1 -0
  540. package/dist/timelock/policy-change.js +63 -0
  541. package/dist/timelock/policy-change.js.map +1 -0
  542. package/dist/timelock/policy.d.ts +19 -0
  543. package/dist/timelock/policy.d.ts.map +1 -0
  544. package/dist/timelock/policy.js +59 -0
  545. package/dist/timelock/policy.js.map +1 -0
  546. package/dist/timelock/protected-call-preflight.d.ts +10 -0
  547. package/dist/timelock/protected-call-preflight.d.ts.map +1 -0
  548. package/dist/timelock/protected-call-preflight.js +17 -0
  549. package/dist/timelock/protected-call-preflight.js.map +1 -0
  550. package/dist/timelock/root-account.d.ts +14 -0
  551. package/dist/timelock/root-account.d.ts.map +1 -0
  552. package/dist/timelock/root-account.js +9 -0
  553. package/dist/timelock/root-account.js.map +1 -0
  554. package/dist/timelock/scheduled-call-match.d.ts +4 -0
  555. package/dist/timelock/scheduled-call-match.d.ts.map +1 -0
  556. package/dist/timelock/scheduled-call-match.js +43 -0
  557. package/dist/timelock/scheduled-call-match.js.map +1 -0
  558. package/dist/timelock/setup-timelock-policy/index.d.ts +2 -0
  559. package/dist/timelock/setup-timelock-policy/index.d.ts.map +1 -0
  560. package/dist/timelock/setup-timelock-policy/setup-timelock-policy.d.ts +46 -0
  561. package/dist/timelock/setup-timelock-policy/setup-timelock-policy.d.ts.map +1 -0
  562. package/dist/timelock/setup-timelock-policy/setup-timelock-policy.js +58 -0
  563. package/dist/timelock/setup-timelock-policy/setup-timelock-policy.js.map +1 -0
  564. package/dist/timelock/support.d.ts +4 -0
  565. package/dist/timelock/support.d.ts.map +1 -0
  566. package/dist/timelock/support.js +9 -0
  567. package/dist/timelock/support.js.map +1 -0
  568. package/dist/transactions/execute-contract-write.d.ts +9 -0
  569. package/dist/transactions/execute-contract-write.d.ts.map +1 -0
  570. package/dist/transactions/execute-contract-write.js +35 -0
  571. package/dist/transactions/execute-contract-write.js.map +1 -0
  572. package/dist/transactions/execute-write.d.ts +32 -0
  573. package/dist/transactions/execute-write.d.ts.map +1 -0
  574. package/dist/transactions/execute-write.js +23 -0
  575. package/dist/transactions/execute-write.js.map +1 -0
  576. package/package.json +1 -1
@@ -1,27 +1,40 @@
1
1
  import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
2
- import { callAsSubAccount as t } from "../internal/call-as-sub-account.js";
3
- import { encodeFunctionData as n } from "viem";
2
+ import { executeProtectedCall as t } from "../../../timelock/execute-protected-call.js";
3
+ import { callAsSubAccount as n } from "../internal/call-as-sub-account.js";
4
+ import { encodeFunctionData as r } from "viem";
4
5
  //#region src/symmio-contracts/symmio/actions/initiate-withdraw.ts
5
- async function r(r, i) {
6
- let { chainId: a, account: o, parts: s, speedUp: c = !1, providerData: l = "0x" } = i;
7
- return t(r, {
6
+ function i(t) {
7
+ return r({
8
+ abi: e,
9
+ functionName: "initiateWithdraw",
10
+ args: [
11
+ t.parts,
12
+ t.speedUp ?? !1,
13
+ t.providerData ?? "0x"
14
+ ]
15
+ });
16
+ }
17
+ async function a(e, r) {
18
+ let { chainId: a, account: o, parts: s, speedUp: c = !1, providerData: l = "0x" } = r, u = i({
19
+ parts: s,
20
+ speedUp: c,
21
+ providerData: l
22
+ });
23
+ return r.timelock ? t(e, {
24
+ ...r,
25
+ callData: u,
26
+ target: "core",
27
+ timelock: r.timelock
28
+ }) : n(e, {
8
29
  account: o,
9
- data: n({
10
- abi: e,
11
- functionName: "initiateWithdraw",
12
- args: [
13
- s,
14
- c,
15
- l
16
- ]
17
- }),
30
+ data: u,
18
31
  chainId: a,
19
- from: i.from,
20
- simulateBeforeWrite: i.simulateBeforeWrite,
21
- gasless: i.gasless
32
+ from: r.from,
33
+ simulateBeforeWrite: r.simulateBeforeWrite,
34
+ gasless: r.gasless
22
35
  });
23
36
  }
24
37
  //#endregion
25
- export { r as initiateWithdraw };
38
+ export { i as encodeInitiateWithdrawCall, a as initiateWithdraw };
26
39
 
27
40
  //# sourceMappingURL=initiate-withdraw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initiate-withdraw.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/initiate-withdraw.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash, type Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\nimport type { WithdrawReceiverPart } from \"../types\";\n\n/**\n * Parameters for {@link initiateWithdraw}.\n */\nexport type InitiateWithdrawParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /**\n * The subaccount initiating the withdrawal. The call is routed through the\n * AccountLayer `_call` proxy so the core sees this subaccount as the caller;\n * the connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * The receiver parts the withdrawal is split into. A plain same-chain\n * withdrawal is a single part with both provider fields set to the zero\n * address — see `createClassicWithdrawPart`.\n */\n parts: readonly WithdrawReceiverPart[];\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n }\n>;\n\n/** Return type of {@link initiateWithdraw}: the submitted transaction hash. */\nexport type InitiateWithdrawReturnType = Hash;\n\n/**\n * Open a withdraw request for a subaccount.\n *\n * Encodes the SYMMIO core `initiateWithdraw(parts, speedUp, data)` call and routes\n * it through `AccountLayer._call(account, …)` so the core attributes the request\n * to `account`. The request matures after the cooldown (tied to the subaccount's\n * last deallocation) and is then completed with {@link finalizeWithdrawRequest}.\n *\n * Dry-runs the call with {@link simulateInitiateWithdraw} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @remarks\n * The full input surface is exposed: provider fields on each part plus `speedUp`\n * and `providerData` enable express/virtual/cross-chain withdrawals where\n * providers are available. For a standard same-chain withdrawal, pass a single\n * classic part and leave `speedUp`/`providerData` at their defaults.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, receiver parts, optional speed-up / provider data, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt; the\n * created `requestId` is available from the receipt's events or via\n * `getLastWithdrawRequestId`.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * const hash = await initiateWithdraw(config, { account: \"0xsub…\", parts: [part] });\n * ```\n */\nexport async function initiateWithdraw(\n config: Config,\n parameters: InitiateWithdrawParameters,\n): Promise<InitiateWithdrawReturnType> {\n const { chainId, account, parts, speedUp = false, providerData = \"0x\" } = parameters;\n\n const data = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"initiateWithdraw\",\n args: [parts, speedUp, providerData],\n });\n\n return callAsSubAccount(config, {\n account,\n data,\n chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n });\n}\n"],"mappings":";;;;AA0EA,eAAsB,EACpB,GACA,GACqC;CACrC,IAAM,EAAE,YAAS,YAAS,UAAO,aAAU,IAAO,kBAAe,SAAS;CAQ1E,OAAO,EAAiB,GAAQ;EAC9B;EACA,MARW,EAAmB;GAC9B,KAAK;GACL,cAAc;GACd,MAAM;IAAC;IAAO;IAAS;GAAY;EACrC,CAIE;EACA;EACA,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC,SAAS,EAAW;CACtB,CAAC;AACH"}
1
+ {"version":3,"file":"initiate-withdraw.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/initiate-withdraw.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash, type Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { executeProtectedCall, type TimelockAuthorization } from \"../../../timelock/execute-protected-call\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\nimport type { WithdrawReceiverPart } from \"../types\";\n\n/**\n * Parameters for {@link initiateWithdraw}.\n */\nexport type InitiateWithdrawParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Optional authorization for a timelocked selector. */\n timelock?: TimelockAuthorization;\n /**\n * The subaccount initiating the withdrawal. The call is routed through the\n * AccountLayer `_call` proxy so the core sees this subaccount as the caller;\n * the connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * The receiver parts the withdrawal is split into. A plain same-chain\n * withdrawal is a single part with both provider fields set to the zero\n * address — see `createClassicWithdrawPart`.\n */\n parts: readonly WithdrawReceiverPart[];\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n }\n>;\n\n/** Return type of {@link initiateWithdraw}: the submitted transaction hash. */\nexport type InitiateWithdrawReturnType = Hash;\n\n/** Encode the canonical raw Core calldata bound by a timelock approval or schedule. */\nexport function encodeInitiateWithdrawCall(\n parameters: Pick<InitiateWithdrawParameters, \"parts\" | \"speedUp\" | \"providerData\">,\n): Hex {\n return encodeFunctionData({\n abi: symmioAbi,\n functionName: \"initiateWithdraw\",\n args: [parameters.parts, parameters.speedUp ?? false, parameters.providerData ?? \"0x\"],\n });\n}\n\n/**\n * Open a withdraw request for a subaccount.\n *\n * Encodes the SYMMIO core `initiateWithdraw(parts, speedUp, data)` call and routes\n * it through `AccountLayer._call(account, …)` so the core attributes the request\n * to `account`. The request matures after the cooldown (tied to the subaccount's\n * last deallocation) and is then completed with {@link finalizeWithdrawRequest}.\n *\n * Dry-runs the call with {@link simulateInitiateWithdraw} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @remarks\n * The full input surface is exposed: provider fields on each part plus `speedUp`\n * and `providerData` enable express/virtual/cross-chain withdrawals where\n * providers are available. For a standard same-chain withdrawal, pass a single\n * classic part and leave `speedUp`/`providerData` at their defaults.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, receiver parts, optional speed-up / provider data, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt; the\n * created `requestId` is available from the receipt's events or via\n * `getLastWithdrawRequestId`.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * const hash = await initiateWithdraw(config, { account: \"0xsub…\", parts: [part] });\n * ```\n */\nexport async function initiateWithdraw(\n config: Config,\n parameters: InitiateWithdrawParameters,\n): Promise<InitiateWithdrawReturnType> {\n const { chainId, account, parts, speedUp = false, providerData = \"0x\" } = parameters;\n\n const data = encodeInitiateWithdrawCall({ parts, speedUp, providerData });\n\n if (parameters.timelock)\n return executeProtectedCall(config, {\n ...parameters,\n callData: data,\n target: \"core\",\n timelock: parameters.timelock,\n });\n\n return callAsSubAccount(config, {\n account,\n data,\n chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n });\n}\n"],"mappings":";;;;;AA+CA,SAAgB,EACd,GACK;CACL,OAAO,EAAmB;EACxB,KAAK;EACL,cAAc;EACd,MAAM;GAAC,EAAW;GAAO,EAAW,WAAW;GAAO,EAAW,gBAAgB;EAAI;CACvF,CAAC;AACH;AAiCA,eAAsB,EACpB,GACA,GACqC;CACrC,IAAM,EAAE,YAAS,YAAS,UAAO,aAAU,IAAO,kBAAe,SAAS,GAEpE,IAAO,EAA2B;EAAE;EAAO;EAAS;CAAa,CAAC;CAUxE,OARI,EAAW,WACN,EAAqB,GAAQ;EAClC,GAAG;EACH,UAAU;EACV,QAAQ;EACR,UAAU,EAAW;CACvB,CAAC,IAEI,EAAiB,GAAQ;EAC9B;EACA;EACA;EACA,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC,SAAS,EAAW;CACtB,CAAC;AACH"}
@@ -1,11 +1,15 @@
1
1
  import { Address, Hash, Hex } from 'viem';
2
2
  import { Config } from '../../../core/config/index.js';
3
3
  import { Compute, GaslessWriteParameter, WriteContractParameter } from '../../../shared/types/properties.js';
4
+ import { TimelockBatchAuthorization } from '../../../timelock/execute-protected-batch.js';
5
+ import { TimelockAuthorization } from '../../../timelock/execute-protected-call.js';
4
6
  import { SingleUpnlSig, SubAccountIsolationType } from '../../account-layer/types.js';
5
7
  /**
6
8
  * Parameters for {@link withdrawAuto}.
7
9
  */
8
10
  export type WithdrawAutoParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
11
+ /** Optional authorization for the selected withdrawal route. */
12
+ timelock?: TimelockAuthorization | TimelockBatchAuthorization;
9
13
  /**
10
14
  * The subaccount to withdraw from. The action routes the call through the
11
15
  * AccountLayer `_call` proxy so the core attributes it to this subaccount; the
@@ -1 +1 @@
1
- {"version":3,"file":"withdraw-auto.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/withdraw-auto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAG/G,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAIxF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,sBAAsB,GACpB,qBAAqB,GAAG;IACtB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CACJ,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,sBAAsB,GACjC,OAAO,CAAC,sBAAsB,CAAC,CAgCjC"}
1
+ {"version":3,"file":"withdraw-auto.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/withdraw-auto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE/G,OAAO,EAA6B,KAAK,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvH,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAIxF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,qBAAqB,GAAG,0BAA0B,CAAC;IAC9D;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CACJ,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,sBAAsB,GACjC,OAAO,CAAC,sBAAsB,CAAC,CAuCjC"}
@@ -1,33 +1,38 @@
1
1
  import { getSubAccount as e } from "../../account-layer/actions/get-sub-account.js";
2
- import { withdraw as t } from "./withdraw.js";
3
- import { collateralToCore18 as n } from "../../../shared/utils/core-units.js";
4
- import { createClassicWithdrawPart as r } from "../parts.js";
2
+ import { withGaslessAttemptStart as t } from "../../../gasless/dispatch/attempt-start.js";
3
+ import { assertTimelockAuthorizationUnused as n } from "../../../timelock/execute-protected-call.js";
4
+ import { assertTimelockBatchUnused as r } from "../../../timelock/execute-protected-batch.js";
5
+ import { withdraw as i } from "./withdraw.js";
6
+ import { collateralToCore18 as a } from "../../../shared/utils/core-units.js";
7
+ import { createClassicWithdrawPart as o } from "../parts.js";
5
8
  //#region src/symmio-contracts/symmio/actions/withdraw-auto.ts
6
- async function i(i, a) {
7
- let o = a.chainId ?? i.defaultChainId, s = a.isolationType ?? (await e(i, {
8
- account: a.account,
9
- chainId: o
10
- })).isolationType, { addresses: c } = i.getChainConfig(o), l = r({
9
+ async function s(s, c) {
10
+ c.timelock && ("calls" in c.timelock ? r(c.timelock) : n(c.timelock));
11
+ let l = c.chainId ?? s.defaultChainId, u = t(c.gasless), d = c.isolationType ?? (await e(s, {
12
+ account: c.account,
13
+ chainId: l
14
+ })).isolationType, { addresses: f } = s.getChainConfig(l), p = o({
11
15
  id: 0n,
12
- amount: a.amount,
13
- receiver: a.receiver,
14
- chainId: BigInt(o)
15
- }), u = n(a.amount, c.collateralDecimals);
16
- return t(i, {
17
- account: a.account,
18
- isolationType: s,
19
- parts: [l],
20
- amount: u,
21
- speedUp: a.speedUp,
22
- providerData: a.providerData,
23
- upnlSig: a.upnlSig,
24
- chainId: o,
25
- from: a.from,
26
- simulateBeforeWrite: a.simulateBeforeWrite,
27
- gasless: a.gasless
16
+ amount: c.amount,
17
+ receiver: c.receiver,
18
+ chainId: BigInt(l)
19
+ }), m = a(c.amount, f.collateralDecimals);
20
+ return i(s, {
21
+ account: c.account,
22
+ isolationType: d,
23
+ parts: [p],
24
+ amount: m,
25
+ speedUp: c.speedUp,
26
+ providerData: c.providerData,
27
+ upnlSig: c.upnlSig,
28
+ chainId: l,
29
+ from: c.from,
30
+ simulateBeforeWrite: c.simulateBeforeWrite,
31
+ gasless: u,
32
+ ...c.timelock ? { timelock: c.timelock } : {}
28
33
  });
29
34
  }
30
35
  //#endregion
31
- export { i as withdrawAuto };
36
+ export { s as withdrawAuto };
32
37
 
33
38
  //# sourceMappingURL=withdraw-auto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withdraw-auto.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/withdraw-auto.ts"],"sourcesContent":["import type { Address, Hash, Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { collateralToCore18 } from \"../../../shared/utils/core-units\";\nimport { getSubAccount } from \"../../account-layer/actions/get-sub-account\";\nimport type { SingleUpnlSig, SubAccountIsolationType } from \"../../account-layer/types\";\nimport { createClassicWithdrawPart } from \"../parts\";\nimport { withdraw } from \"./withdraw\";\n\n/**\n * Parameters for {@link withdrawAuto}.\n */\nexport type WithdrawAutoParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /**\n * The subaccount to withdraw from. The action routes the call through the\n * AccountLayer `_call` proxy so the core attributes it to this subaccount; the\n * connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * Amount to withdraw, in the **collateral token's decimals** (e.g. 6 for a\n * USDC-collateralized chain). The action builds the withdraw part from this\n * amount as-is and, on the `CUSTOM` (cross-margin) path, scales it to the\n * 18-decimal amount the `deallocate` leg needs.\n */\n amount: bigint;\n /** Destination EVM address the freed collateral is withdrawn to. */\n receiver: Address;\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n /**\n * A fresh Muon uPnL (`uPnl_A`) attestation for `account`, used only by the\n * `CUSTOM` (deallocate) path. Omit it to have the action fetch a fresh one;\n * pass one only to reuse a signature you already fetched. Ignored on the\n * `MARKET` / `MARKET_DIRECTION` path.\n */\n upnlSig?: SingleUpnlSig;\n /**\n * The subaccount's isolation type. Pass it to **skip the `getSubAccount` read**\n * — the React layer already holds it (cached via `useSubAccount`), so passing it\n * avoids a redundant RPC. Omit it and the action fetches the subaccount to\n * resolve it.\n */\n isolationType?: SubAccountIsolationType;\n }\n>;\n\n/** Return type of {@link withdrawAuto}: the submitted transaction hash. */\nexport type WithdrawAutoReturnType = Hash;\n\n/**\n * Withdraw from a subaccount from a **minimal, collateral-decimals input** — the\n * high-level entry point that does all the plumbing so callers pass only\n * `{ account, amount, receiver }` and never touch isolation, parts, or scaling.\n *\n * The action resolves the subaccount's {@link SubAccountIsolationType} — from the\n * passed `isolationType`, or by reading the subaccount when it is omitted — builds\n * the classic same-chain withdraw part from `amount` (in the collateral token's\n * decimals), scales that amount to 18 decimals for the deallocate leg, and hands\n * off to {@link withdraw} — which dispatches on the resolved isolation:\n *\n * | `isolationType` | Balance | What runs |\n * | ----------------------------------- | --------- | ------------------------------------- |\n * | `CUSTOM` (cross-margin) | allocated | deallocate + initiate in one atomic tx |\n * | `MARKET` / `MARKET_DIRECTION` (VA) | available | initiate the withdraw request only |\n *\n * @remarks\n * Account-layer balances are `1e18`-scaled regardless of the collateral token's\n * decimals, so the `CUSTOM` deallocate leg needs the 18-decimal amount; this action\n * derives it with {@link collateralToCore18} (`amount * 10 ** (18 - collateralDecimals)`).\n * On the `CUSTOM` path it also fetches a fresh Muon `upnlSig` for the deallocate\n * leg unless one is passed. Reach for {@link withdraw} directly when you already\n * hold the subaccount's `isolationType` and want to skip the extra read, or need\n * custom (multi-part / cross-chain) withdraw parts.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, `amount` (collateral decimals), `receiver`,\n * optional speed-up / provider data, optional Muon `upnlSig`, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws {SymmError} `COLLATERAL_DECIMALS_UNSUPPORTED` when the chain's\n * `collateralDecimals` is not an integer from 0 to 18.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * // amount in the collateral token's decimals (6-dec USDC → 1 USDC):\n * const hash = await withdrawAuto(config, {\n * account: \"0xsub…\",\n * amount: 1_000000n,\n * receiver: \"0xabc…\",\n * });\n * ```\n */\nexport async function withdrawAuto(\n config: Config,\n parameters: WithdrawAutoParameters,\n): Promise<WithdrawAutoReturnType> {\n const chainId = parameters.chainId ?? config.defaultChainId;\n\n // Use the caller-supplied isolation type when present (the React layer reads it\n // from cache); otherwise fetch the subaccount to resolve it.\n const isolationType =\n parameters.isolationType ?? (await getSubAccount(config, { account: parameters.account, chainId })).isolationType;\n const { addresses } = config.getChainConfig(chainId);\n\n const part = createClassicWithdrawPart({\n id: 0n,\n amount: parameters.amount,\n receiver: parameters.receiver,\n chainId: BigInt(chainId),\n });\n\n /** Account-layer balances are 1e18-scaled whatever the collateral's decimals; the deallocate leg needs that scale. */\n const amount18 = collateralToCore18(parameters.amount, addresses.collateralDecimals);\n\n return withdraw(config, {\n account: parameters.account,\n isolationType,\n parts: [part],\n amount: amount18,\n speedUp: parameters.speedUp,\n providerData: parameters.providerData,\n upnlSig: parameters.upnlSig,\n chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n });\n}\n"],"mappings":";;;;;AA0GA,eAAsB,EACpB,GACA,GACiC;CACjC,IAAM,IAAU,EAAW,WAAW,EAAO,gBAIvC,IACJ,EAAW,kBAAkB,MAAM,EAAc,GAAQ;EAAE,SAAS,EAAW;EAAS;CAAQ,CAAC,GAAG,eAChG,EAAE,iBAAc,EAAO,eAAe,CAAO,GAE7C,IAAO,EAA0B;EACrC,IAAI;EACJ,QAAQ,EAAW;EACnB,UAAU,EAAW;EACrB,SAAS,OAAO,CAAO;CACzB,CAAC,GAGK,IAAW,EAAmB,EAAW,QAAQ,EAAU,kBAAkB;CAEnF,OAAO,EAAS,GAAQ;EACtB,SAAS,EAAW;EACpB;EACA,OAAO,CAAC,CAAI;EACZ,QAAQ;EACR,SAAS,EAAW;EACpB,cAAc,EAAW;EACzB,SAAS,EAAW;EACpB;EACA,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC,SAAS,EAAW;CACtB,CAAC;AACH"}
1
+ {"version":3,"file":"withdraw-auto.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/withdraw-auto.ts"],"sourcesContent":["import type { Address, Hash, Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { withGaslessAttemptStart } from \"../../../gasless/dispatch/attempt-start\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { collateralToCore18 } from \"../../../shared/utils/core-units\";\nimport { assertTimelockBatchUnused, type TimelockBatchAuthorization } from \"../../../timelock/execute-protected-batch\";\nimport {\n assertTimelockAuthorizationUnused,\n type TimelockAuthorization,\n} from \"../../../timelock/execute-protected-call\";\nimport { getSubAccount } from \"../../account-layer/actions/get-sub-account\";\nimport type { SingleUpnlSig, SubAccountIsolationType } from \"../../account-layer/types\";\nimport { createClassicWithdrawPart } from \"../parts\";\nimport { withdraw } from \"./withdraw\";\n\n/**\n * Parameters for {@link withdrawAuto}.\n */\nexport type WithdrawAutoParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Optional authorization for the selected withdrawal route. */\n timelock?: TimelockAuthorization | TimelockBatchAuthorization;\n /**\n * The subaccount to withdraw from. The action routes the call through the\n * AccountLayer `_call` proxy so the core attributes it to this subaccount; the\n * connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * Amount to withdraw, in the **collateral token's decimals** (e.g. 6 for a\n * USDC-collateralized chain). The action builds the withdraw part from this\n * amount as-is and, on the `CUSTOM` (cross-margin) path, scales it to the\n * 18-decimal amount the `deallocate` leg needs.\n */\n amount: bigint;\n /** Destination EVM address the freed collateral is withdrawn to. */\n receiver: Address;\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n /**\n * A fresh Muon uPnL (`uPnl_A`) attestation for `account`, used only by the\n * `CUSTOM` (deallocate) path. Omit it to have the action fetch a fresh one;\n * pass one only to reuse a signature you already fetched. Ignored on the\n * `MARKET` / `MARKET_DIRECTION` path.\n */\n upnlSig?: SingleUpnlSig;\n /**\n * The subaccount's isolation type. Pass it to **skip the `getSubAccount` read**\n * — the React layer already holds it (cached via `useSubAccount`), so passing it\n * avoids a redundant RPC. Omit it and the action fetches the subaccount to\n * resolve it.\n */\n isolationType?: SubAccountIsolationType;\n }\n>;\n\n/** Return type of {@link withdrawAuto}: the submitted transaction hash. */\nexport type WithdrawAutoReturnType = Hash;\n\n/**\n * Withdraw from a subaccount from a **minimal, collateral-decimals input** — the\n * high-level entry point that does all the plumbing so callers pass only\n * `{ account, amount, receiver }` and never touch isolation, parts, or scaling.\n *\n * The action resolves the subaccount's {@link SubAccountIsolationType} — from the\n * passed `isolationType`, or by reading the subaccount when it is omitted — builds\n * the classic same-chain withdraw part from `amount` (in the collateral token's\n * decimals), scales that amount to 18 decimals for the deallocate leg, and hands\n * off to {@link withdraw} — which dispatches on the resolved isolation:\n *\n * | `isolationType` | Balance | What runs |\n * | ----------------------------------- | --------- | ------------------------------------- |\n * | `CUSTOM` (cross-margin) | allocated | deallocate + initiate in one atomic tx |\n * | `MARKET` / `MARKET_DIRECTION` (VA) | available | initiate the withdraw request only |\n *\n * @remarks\n * Account-layer balances are `1e18`-scaled regardless of the collateral token's\n * decimals, so the `CUSTOM` deallocate leg needs the 18-decimal amount; this action\n * derives it with {@link collateralToCore18} (`amount * 10 ** (18 - collateralDecimals)`).\n * On the `CUSTOM` path it also fetches a fresh Muon `upnlSig` for the deallocate\n * leg unless one is passed. Reach for {@link withdraw} directly when you already\n * hold the subaccount's `isolationType` and want to skip the extra read, or need\n * custom (multi-part / cross-chain) withdraw parts.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, `amount` (collateral decimals), `receiver`,\n * optional speed-up / provider data, optional Muon `upnlSig`, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws {SymmError} `COLLATERAL_DECIMALS_UNSUPPORTED` when the chain's\n * `collateralDecimals` is not an integer from 0 to 18.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * // amount in the collateral token's decimals (6-dec USDC → 1 USDC):\n * const hash = await withdrawAuto(config, {\n * account: \"0xsub…\",\n * amount: 1_000000n,\n * receiver: \"0xabc…\",\n * });\n * ```\n */\nexport async function withdrawAuto(\n config: Config,\n parameters: WithdrawAutoParameters,\n): Promise<WithdrawAutoReturnType> {\n if (parameters.timelock) {\n if (\"calls\" in parameters.timelock) assertTimelockBatchUnused(parameters.timelock);\n else assertTimelockAuthorizationUnused(parameters.timelock);\n }\n const chainId = parameters.chainId ?? config.defaultChainId;\n /** The reads below, and the Muon fetch inside `withdraw`, count against the gasless signature lifetime. */\n const gasless = withGaslessAttemptStart(parameters.gasless);\n\n // Use the caller-supplied isolation type when present (the React layer reads it\n // from cache); otherwise fetch the subaccount to resolve it.\n const isolationType =\n parameters.isolationType ?? (await getSubAccount(config, { account: parameters.account, chainId })).isolationType;\n const { addresses } = config.getChainConfig(chainId);\n\n const part = createClassicWithdrawPart({\n id: 0n,\n amount: parameters.amount,\n receiver: parameters.receiver,\n chainId: BigInt(chainId),\n });\n\n /** Account-layer balances are 1e18-scaled whatever the collateral's decimals; the deallocate leg needs that scale. */\n const amount18 = collateralToCore18(parameters.amount, addresses.collateralDecimals);\n\n return withdraw(config, {\n account: parameters.account,\n isolationType,\n parts: [part],\n amount: amount18,\n speedUp: parameters.speedUp,\n providerData: parameters.providerData,\n upnlSig: parameters.upnlSig,\n chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless,\n ...(parameters.timelock ? { timelock: parameters.timelock } : {}),\n });\n}\n"],"mappings":";;;;;;;;AAkHA,eAAsB,EACpB,GACA,GACiC;CACjC,AAAI,EAAW,aACT,WAAW,EAAW,WAAU,EAA0B,EAAW,QAAQ,IAC5E,EAAkC,EAAW,QAAQ;CAE5D,IAAM,IAAU,EAAW,WAAW,EAAO,gBAEvC,IAAU,EAAwB,EAAW,OAAO,GAIpD,IACJ,EAAW,kBAAkB,MAAM,EAAc,GAAQ;EAAE,SAAS,EAAW;EAAS;CAAQ,CAAC,GAAG,eAChG,EAAE,iBAAc,EAAO,eAAe,CAAO,GAE7C,IAAO,EAA0B;EACrC,IAAI;EACJ,QAAQ,EAAW;EACnB,UAAU,EAAW;EACrB,SAAS,OAAO,CAAO;CACzB,CAAC,GAGK,IAAW,EAAmB,EAAW,QAAQ,EAAU,kBAAkB;CAEnF,OAAO,EAAS,GAAQ;EACtB,SAAS,EAAW;EACpB;EACA,OAAO,CAAC,CAAI;EACZ,QAAQ;EACR,SAAS,EAAW;EACpB,cAAc,EAAW;EACzB,SAAS,EAAW;EACpB;EACA,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC;EACA,GAAI,EAAW,WAAW,EAAE,UAAU,EAAW,SAAS,IAAI,CAAC;CACjE,CAAC;AACH"}
@@ -1,12 +1,16 @@
1
1
  import { Address, Hash, Hex } from 'viem';
2
2
  import { Config } from '../../../core/config/index.js';
3
3
  import { Compute, GaslessWriteParameter, WriteContractParameter } from '../../../shared/types/properties.js';
4
+ import { TimelockBatchAuthorization } from '../../../timelock/execute-protected-batch.js';
5
+ import { TimelockAuthorization } from '../../../timelock/execute-protected-call.js';
4
6
  import { SubAccountIsolationType, SingleUpnlSig } from '../../account-layer/types.js';
5
7
  import { WithdrawReceiverPart } from '../types.js';
6
8
  /**
7
9
  * Parameters for {@link withdraw}.
8
10
  */
9
11
  export type WithdrawParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
12
+ /** Authorization for the single withdrawal call or the atomic CUSTOM batch. */
13
+ timelock?: TimelockAuthorization | TimelockBatchAuthorization;
10
14
  /**
11
15
  * The subaccount to withdraw from. Both underlying actions route the call
12
16
  * through the AccountLayer `_call` proxy so the core attributes it to this
@@ -1 +1 @@
1
- {"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAAE,uBAAuB,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIrD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,sBAAsB,GACpB,qBAAqB,GAAG;IACtB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;OAIG;IACH,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CACJ,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAiC1G"}
1
+ {"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIrD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,qBAAqB,GAAG,0BAA0B,CAAC;IAC9D;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;OAIG;IACH,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CACJ,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA+C1G"}
@@ -1,12 +1,13 @@
1
1
  import { SymmError as e } from "../../../shared/errors/symm-error.js";
2
- import { SubAccountIsolationType as t } from "../../account-layer/types.js";
3
- import { deallocateAndInitiateWithdraw as n } from "./deallocate-and-initiate-withdraw.js";
4
- import { initiateWithdraw as r } from "./initiate-withdraw.js";
2
+ import { initiateWithdraw as t } from "./initiate-withdraw.js";
3
+ import { SubAccountIsolationType as n } from "../../account-layer/types.js";
4
+ import { deallocateAndInitiateWithdraw as r } from "./deallocate-and-initiate-withdraw.js";
5
5
  //#region src/symmio-contracts/symmio/actions/withdraw.ts
6
6
  async function i(i, a) {
7
- if (a.isolationType === t.CUSTOM) {
7
+ if (a.isolationType === n.CUSTOM) {
8
+ if (a.timelock && !("calls" in a.timelock)) throw new e("validation", "TIMELOCK_BATCH_REQUIRED", "CUSTOM withdrawal needs per-call batch authorizations.");
8
9
  if (a.amount === void 0) throw new e("validation", "WITHDRAW_AMOUNT_REQUIRED", "A CUSTOM (cross-margin) subaccount must supply `amount` (18-decimals) — the deallocate leg needs it.");
9
- return n(i, {
10
+ return r(i, {
10
11
  account: a.account,
11
12
  amount: a.amount,
12
13
  parts: a.parts,
@@ -16,10 +17,12 @@ async function i(i, a) {
16
17
  chainId: a.chainId,
17
18
  from: a.from,
18
19
  simulateBeforeWrite: a.simulateBeforeWrite,
19
- gasless: a.gasless
20
+ gasless: a.gasless,
21
+ ...a.timelock ? { timelock: a.timelock } : {}
20
22
  });
21
23
  }
22
- return r(i, {
24
+ if (a.timelock && "calls" in a.timelock) throw new e("validation", "TIMELOCK_SINGLE_CALL_REQUIRED", "This withdrawal needs a single-call authorization.");
25
+ return t(i, {
23
26
  account: a.account,
24
27
  parts: a.parts,
25
28
  speedUp: a.speedUp,
@@ -27,7 +30,8 @@ async function i(i, a) {
27
30
  chainId: a.chainId,
28
31
  from: a.from,
29
32
  simulateBeforeWrite: a.simulateBeforeWrite,
30
- gasless: a.gasless
33
+ gasless: a.gasless,
34
+ ...a.timelock ? { timelock: a.timelock } : {}
31
35
  });
32
36
  }
33
37
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"withdraw.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/withdraw.ts"],"sourcesContent":["import type { Address, Hash, Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { SubAccountIsolationType, type SingleUpnlSig } from \"../../account-layer/types\";\nimport type { WithdrawReceiverPart } from \"../types\";\nimport { deallocateAndInitiateWithdraw } from \"./deallocate-and-initiate-withdraw\";\nimport { initiateWithdraw } from \"./initiate-withdraw\";\n\n/**\n * Parameters for {@link withdraw}.\n */\nexport type WithdrawParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /**\n * The subaccount to withdraw from. Both underlying actions route the call\n * through the AccountLayer `_call` proxy so the core attributes it to this\n * subaccount; the connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * The subaccount's isolation strategy, which selects the withdraw path:\n * `CUSTOM` (cross-margin) deallocates then initiates; `MARKET` /\n * `MARKET_DIRECTION` (VA / lowcap) initiate only. Read it from the\n * subaccount detail (`getSubAccount` → `isolationType`).\n */\n isolationType: SubAccountIsolationType;\n /**\n * The receiver parts the withdrawal is split into. A plain same-chain\n * withdrawal is a single part with both provider fields set to the zero\n * address — see `createClassicWithdrawPart`.\n */\n parts: readonly WithdrawReceiverPart[];\n /**\n * Amount to move from the allocated balance back into the available balance,\n * in **18 decimals** (not the collateral token's decimals). Consumed only by\n * the `deallocate` leg, so it is **required when `isolationType` is `CUSTOM`**\n * and ignored otherwise.\n */\n amount?: bigint;\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n /**\n * A fresh Muon uPnL (`uPnl_A`) attestation for `account`, used only by the\n * `CUSTOM` (deallocate) path. Omit it to have the action fetch a fresh one;\n * pass one only to reuse a signature you already fetched. Ignored on the\n * `MARKET` / `MARKET_DIRECTION` path.\n */\n upnlSig?: SingleUpnlSig;\n }\n>;\n\n/** Return type of {@link withdraw}: the submitted transaction hash. */\nexport type WithdrawReturnType = Hash;\n\n/**\n * Withdraw from a subaccount, dispatching on its isolation strategy so callers\n * do not have to branch on where the collateral currently sits.\n *\n * The subaccount's {@link SubAccountIsolationType} determines which balance the\n * funds are in and therefore which underlying action runs:\n *\n * | `isolationType` | Balance | Action |\n * | ----------------------------------- | --------- | ------------------------------------ |\n * | `CUSTOM` (cross-margin) | allocated | {@link deallocateAndInitiateWithdraw} |\n * | `MARKET` / `MARKET_DIRECTION` (VA) | available | {@link initiateWithdraw} |\n *\n * `CUSTOM` funds sit in the **allocated** balance, so they must first be\n * deallocated into the available balance; this path batches the `deallocate` and\n * `initiateWithdraw` legs into one atomic transaction and therefore **requires**\n * `amount` (the 18-decimal deallocate amount). The VA paths (`MARKET` /\n * `MARKET_DIRECTION`) already hold their funds in the **available** balance, so\n * they only initiate the withdraw request and ignore `amount`.\n *\n * @remarks\n * Both underlying actions route through the AccountLayer `_call` proxy and dry-run\n * before writing unless `simulateBeforeWrite` is `false`. The `CUSTOM` path also\n * fetches a fresh Muon `upnlSig` for its `deallocate` leg when one is not passed —\n * see {@link deallocateAndInitiateWithdraw}. Reach for the underlying actions\n * directly when you already know the subaccount's isolation and want to skip the\n * dispatch.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, its `isolationType`, receiver parts, optional\n * speed-up / provider data, optional Muon `upnlSig`, optional chain id, and\n * `amount` (18 decimals) — required for `CUSTOM`, ignored otherwise.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} `validation` / `WITHDRAW_AMOUNT_REQUIRED` when\n * `isolationType` is `CUSTOM` but `amount` is omitted; also the config/wallet\n * errors the underlying actions throw.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const { isolationType } = await getSubAccount(config, { account: \"0xsub…\" });\n * const part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * const hash = await withdraw(config, {\n * account: \"0xsub…\",\n * isolationType,\n * parts: [part],\n * // required only when isolationType === SubAccountIsolationType.CUSTOM:\n * amount: 1_000000000000000000n,\n * });\n * ```\n */\nexport async function withdraw(config: Config, parameters: WithdrawParameters): Promise<WithdrawReturnType> {\n if (parameters.isolationType === SubAccountIsolationType.CUSTOM) {\n if (parameters.amount === undefined) {\n throw new SymmError(\n \"validation\",\n \"WITHDRAW_AMOUNT_REQUIRED\",\n \"A CUSTOM (cross-margin) subaccount must supply `amount` (18-decimals) — the deallocate leg needs it.\",\n );\n }\n return deallocateAndInitiateWithdraw(config, {\n account: parameters.account,\n amount: parameters.amount,\n parts: parameters.parts,\n speedUp: parameters.speedUp,\n providerData: parameters.providerData,\n upnlSig: parameters.upnlSig,\n chainId: parameters.chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n });\n }\n\n return initiateWithdraw(config, {\n account: parameters.account,\n parts: parameters.parts,\n speedUp: parameters.speedUp,\n providerData: parameters.providerData,\n chainId: parameters.chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n });\n}\n"],"mappings":";;;;;AAoHA,eAAsB,EAAS,GAAgB,GAA6D;CAC1G,IAAI,EAAW,kBAAkB,EAAwB,QAAQ;EAC/D,IAAI,EAAW,WAAW,KAAA,GACxB,MAAM,IAAI,EACR,cACA,4BACA,sGACF;EAEF,OAAO,EAA8B,GAAQ;GAC3C,SAAS,EAAW;GACpB,QAAQ,EAAW;GACnB,OAAO,EAAW;GAClB,SAAS,EAAW;GACpB,cAAc,EAAW;GACzB,SAAS,EAAW;GACpB,SAAS,EAAW;GACpB,MAAM,EAAW;GACjB,qBAAqB,EAAW;GAChC,SAAS,EAAW;EACtB,CAAC;CACH;CAEA,OAAO,EAAiB,GAAQ;EAC9B,SAAS,EAAW;EACpB,OAAO,EAAW;EAClB,SAAS,EAAW;EACpB,cAAc,EAAW;EACzB,SAAS,EAAW;EACpB,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC,SAAS,EAAW;CACtB,CAAC;AACH"}
1
+ {"version":3,"file":"withdraw.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/withdraw.ts"],"sourcesContent":["import type { Address, Hash, Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport type { TimelockBatchAuthorization } from \"../../../timelock/execute-protected-batch\";\nimport type { TimelockAuthorization } from \"../../../timelock/execute-protected-call\";\nimport { SubAccountIsolationType, type SingleUpnlSig } from \"../../account-layer/types\";\nimport type { WithdrawReceiverPart } from \"../types\";\nimport { deallocateAndInitiateWithdraw } from \"./deallocate-and-initiate-withdraw\";\nimport { initiateWithdraw } from \"./initiate-withdraw\";\n\n/**\n * Parameters for {@link withdraw}.\n */\nexport type WithdrawParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Authorization for the single withdrawal call or the atomic CUSTOM batch. */\n timelock?: TimelockAuthorization | TimelockBatchAuthorization;\n /**\n * The subaccount to withdraw from. Both underlying actions route the call\n * through the AccountLayer `_call` proxy so the core attributes it to this\n * subaccount; the connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * The subaccount's isolation strategy, which selects the withdraw path:\n * `CUSTOM` (cross-margin) deallocates then initiates; `MARKET` /\n * `MARKET_DIRECTION` (VA / lowcap) initiate only. Read it from the\n * subaccount detail (`getSubAccount` → `isolationType`).\n */\n isolationType: SubAccountIsolationType;\n /**\n * The receiver parts the withdrawal is split into. A plain same-chain\n * withdrawal is a single part with both provider fields set to the zero\n * address — see `createClassicWithdrawPart`.\n */\n parts: readonly WithdrawReceiverPart[];\n /**\n * Amount to move from the allocated balance back into the available balance,\n * in **18 decimals** (not the collateral token's decimals). Consumed only by\n * the `deallocate` leg, so it is **required when `isolationType` is `CUSTOM`**\n * and ignored otherwise.\n */\n amount?: bigint;\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n /**\n * A fresh Muon uPnL (`uPnl_A`) attestation for `account`, used only by the\n * `CUSTOM` (deallocate) path. Omit it to have the action fetch a fresh one;\n * pass one only to reuse a signature you already fetched. Ignored on the\n * `MARKET` / `MARKET_DIRECTION` path.\n */\n upnlSig?: SingleUpnlSig;\n }\n>;\n\n/** Return type of {@link withdraw}: the submitted transaction hash. */\nexport type WithdrawReturnType = Hash;\n\n/**\n * Withdraw from a subaccount, dispatching on its isolation strategy so callers\n * do not have to branch on where the collateral currently sits.\n *\n * The subaccount's {@link SubAccountIsolationType} determines which balance the\n * funds are in and therefore which underlying action runs:\n *\n * | `isolationType` | Balance | Action |\n * | ----------------------------------- | --------- | ------------------------------------ |\n * | `CUSTOM` (cross-margin) | allocated | {@link deallocateAndInitiateWithdraw} |\n * | `MARKET` / `MARKET_DIRECTION` (VA) | available | {@link initiateWithdraw} |\n *\n * `CUSTOM` funds sit in the **allocated** balance, so they must first be\n * deallocated into the available balance; this path batches the `deallocate` and\n * `initiateWithdraw` legs into one atomic transaction and therefore **requires**\n * `amount` (the 18-decimal deallocate amount). The VA paths (`MARKET` /\n * `MARKET_DIRECTION`) already hold their funds in the **available** balance, so\n * they only initiate the withdraw request and ignore `amount`.\n *\n * @remarks\n * Both underlying actions route through the AccountLayer `_call` proxy and dry-run\n * before writing unless `simulateBeforeWrite` is `false`. The `CUSTOM` path also\n * fetches a fresh Muon `upnlSig` for its `deallocate` leg when one is not passed —\n * see {@link deallocateAndInitiateWithdraw}. Reach for the underlying actions\n * directly when you already know the subaccount's isolation and want to skip the\n * dispatch.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, its `isolationType`, receiver parts, optional\n * speed-up / provider data, optional Muon `upnlSig`, optional chain id, and\n * `amount` (18 decimals) — required for `CUSTOM`, ignored otherwise.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} `validation` / `WITHDRAW_AMOUNT_REQUIRED` when\n * `isolationType` is `CUSTOM` but `amount` is omitted; also the config/wallet\n * errors the underlying actions throw.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const { isolationType } = await getSubAccount(config, { account: \"0xsub…\" });\n * const part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * const hash = await withdraw(config, {\n * account: \"0xsub…\",\n * isolationType,\n * parts: [part],\n * // required only when isolationType === SubAccountIsolationType.CUSTOM:\n * amount: 1_000000000000000000n,\n * });\n * ```\n */\nexport async function withdraw(config: Config, parameters: WithdrawParameters): Promise<WithdrawReturnType> {\n if (parameters.isolationType === SubAccountIsolationType.CUSTOM) {\n if (parameters.timelock && !(\"calls\" in parameters.timelock))\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_BATCH_REQUIRED\",\n \"CUSTOM withdrawal needs per-call batch authorizations.\",\n );\n if (parameters.amount === undefined) {\n throw new SymmError(\n \"validation\",\n \"WITHDRAW_AMOUNT_REQUIRED\",\n \"A CUSTOM (cross-margin) subaccount must supply `amount` (18-decimals) — the deallocate leg needs it.\",\n );\n }\n return deallocateAndInitiateWithdraw(config, {\n account: parameters.account,\n amount: parameters.amount,\n parts: parameters.parts,\n speedUp: parameters.speedUp,\n providerData: parameters.providerData,\n upnlSig: parameters.upnlSig,\n chainId: parameters.chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n ...(parameters.timelock ? { timelock: parameters.timelock } : {}),\n });\n }\n\n if (parameters.timelock && \"calls\" in parameters.timelock)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_SINGLE_CALL_REQUIRED\",\n \"This withdrawal needs a single-call authorization.\",\n );\n return initiateWithdraw(config, {\n account: parameters.account,\n parts: parameters.parts,\n speedUp: parameters.speedUp,\n providerData: parameters.providerData,\n chainId: parameters.chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n ...(parameters.timelock ? { timelock: parameters.timelock } : {}),\n });\n}\n"],"mappings":";;;;;AAwHA,eAAsB,EAAS,GAAgB,GAA6D;CAC1G,IAAI,EAAW,kBAAkB,EAAwB,QAAQ;EAC/D,IAAI,EAAW,YAAY,EAAE,WAAW,EAAW,WACjD,MAAM,IAAI,EACR,cACA,2BACA,wDACF;EACF,IAAI,EAAW,WAAW,KAAA,GACxB,MAAM,IAAI,EACR,cACA,4BACA,sGACF;EAEF,OAAO,EAA8B,GAAQ;GAC3C,SAAS,EAAW;GACpB,QAAQ,EAAW;GACnB,OAAO,EAAW;GAClB,SAAS,EAAW;GACpB,cAAc,EAAW;GACzB,SAAS,EAAW;GACpB,SAAS,EAAW;GACpB,MAAM,EAAW;GACjB,qBAAqB,EAAW;GAChC,SAAS,EAAW;GACpB,GAAI,EAAW,WAAW,EAAE,UAAU,EAAW,SAAS,IAAI,CAAC;EACjE,CAAC;CACH;CAEA,IAAI,EAAW,YAAY,WAAW,EAAW,UAC/C,MAAM,IAAI,EACR,cACA,iCACA,oDACF;CACF,OAAO,EAAiB,GAAQ;EAC9B,SAAS,EAAW;EACpB,OAAO,EAAW;EAClB,SAAS,EAAW;EACpB,cAAc,EAAW;EACzB,SAAS,EAAW;EACpB,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC,SAAS,EAAW;EACpB,GAAI,EAAW,WAAW,EAAE,UAAU,EAAW,SAAS,IAAI,CAAC;CACjE,CAAC;AACH"}
@@ -0,0 +1,48 @@
1
+ import { Address, Hash } from 'viem';
2
+ import { Config } from '../../../core/config/index.js';
3
+ import { Compute, GaslessWriteParameter, WriteContractParameter } from '../../../shared/types/properties.js';
4
+ import { TimelockBatchAuthorization } from '../../../timelock/execute-protected-batch.js';
5
+ /** A named SYMMIO core write, encoded and executed as a subaccount. */
6
+ export interface AccountContractCall {
7
+ /** Name of a payable or nonpayable function in the SDK's SYMMIO ABI. */
8
+ functionName: string;
9
+ /** Contract arguments in order; amounts retain the named function's units. */
10
+ args?: readonly unknown[];
11
+ }
12
+ /** Parameters for {@link executeAccountCalls}. */
13
+ export type ExecuteAccountCallsParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
14
+ /** Subaccount whose owner or delegated gasless signer authorizes the calls. */
15
+ account: Address;
16
+ /** Nonempty ordered list of core writes. Each call executes as the same subaccount. */
17
+ calls: readonly AccountContractCall[];
18
+ /** Optional per-call authorizations for an atomic protected Core batch. */
19
+ timelock?: TimelockBatchAuthorization;
20
+ }>;
21
+ /** Transaction hash returned by {@link executeAccountCalls}; wait for its receipt before refreshing reads. */
22
+ export type ExecuteAccountCallsReturnType = Hash;
23
+ /**
24
+ * Execute named SYMMIO core writes atomically as one subaccount.
25
+ *
26
+ * Wallet execution uses one AccountLayer `_call(account, callDatas)` transaction,
27
+ * simulated by default. Gasless execution uses the existing dispatcher and its
28
+ * relayable-selector restrictions. This action never invents a wallet fallback.
29
+ * Arguments are encoded before any wallet resolution; the SDK does not infer
30
+ * request IDs or feed a call's return value into a later call.
31
+ *
32
+ * @param config - The SDK config (must have a `getWalletClient` resolver).
33
+ * @param parameters - Subaccount, ordered calls, optional chain id, signer and execution overrides.
34
+ * @returns The submitted transaction hash. The caller waits on the receipt.
35
+ * @throws {SymmError} for empty calls, unknown or read-only functions, an unsupported chain, no available wallet, or unsupported execution.
36
+ * @throws Viem's encoding and write errors (`ContractFunctionExecutionError`, ...).
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const hash = await executeAccountCalls(config, {
41
+ * account,
42
+ * calls: [{ functionName: "allocate", args: [amount18] }],
43
+ * gasless: false,
44
+ * });
45
+ * ```
46
+ */
47
+ export declare function executeAccountCalls(config: Config, parameters: ExecuteAccountCallsParameters): Promise<ExecuteAccountCallsReturnType>;
48
+ //# sourceMappingURL=execute-account-calls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-account-calls.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/execute-account-calls/execute-account-calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAA6B,KAAK,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAIvH,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAC3B;AAED,kDAAkD;AAClD,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACtC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,0BAA0B,CAAC;CACvC,CACJ,CAAC;AAEF,8GAA8G;AAC9G,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,6BAA6B,GACxC,OAAO,CAAC,6BAA6B,CAAC,CAkBxC"}
@@ -0,0 +1,33 @@
1
+ import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
2
+ import { SymmError as t } from "../../../shared/errors/symm-error.js";
3
+ import { callAsSubAccount as n } from "../internal/call-as-sub-account.js";
4
+ import { executeProtectedCoreBatch as r } from "../../../timelock/execute-protected-batch.js";
5
+ import { encodeFunctionData as i } from "viem";
6
+ //#region src/symmio-contracts/symmio/execute-account-calls/execute-account-calls.ts
7
+ async function a(a, s) {
8
+ let { calls: c, ...l } = s;
9
+ if (c.length === 0) throw new t("validation", "EMPTY_ACCOUNT_CALLS", "executeAccountCalls requires at least one core write.");
10
+ let u = c.map((n) => {
11
+ if (!o(n.functionName)) throw new t("validation", "INVALID_ACCOUNT_CALL", `Unknown SYMMIO core write: ${n.functionName}.`);
12
+ return i({
13
+ abi: e,
14
+ functionName: n.functionName,
15
+ args: n.args
16
+ });
17
+ });
18
+ return l.timelock ? r(a, {
19
+ ...l,
20
+ callDatas: u,
21
+ timelock: l.timelock
22
+ }) : n(a, {
23
+ ...l,
24
+ data: u
25
+ });
26
+ }
27
+ function o(t) {
28
+ return e.some((e) => e.type === "function" && e.name === t && ["nonpayable", "payable"].includes(e.stateMutability));
29
+ }
30
+ //#endregion
31
+ export { a as executeAccountCalls };
32
+
33
+ //# sourceMappingURL=execute-account-calls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-account-calls.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/execute-account-calls/execute-account-calls.ts"],"sourcesContent":["import { encodeFunctionData, type Abi, type Address, type Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { executeProtectedCoreBatch, type TimelockBatchAuthorization } from \"../../../timelock/execute-protected-batch\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\n\n/** A named SYMMIO core write, encoded and executed as a subaccount. */\nexport interface AccountContractCall {\n /** Name of a payable or nonpayable function in the SDK's SYMMIO ABI. */\n functionName: string;\n /** Contract arguments in order; amounts retain the named function's units. */\n args?: readonly unknown[];\n}\n\n/** Parameters for {@link executeAccountCalls}. */\nexport type ExecuteAccountCallsParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Subaccount whose owner or delegated gasless signer authorizes the calls. */\n account: Address;\n /** Nonempty ordered list of core writes. Each call executes as the same subaccount. */\n calls: readonly AccountContractCall[];\n /** Optional per-call authorizations for an atomic protected Core batch. */\n timelock?: TimelockBatchAuthorization;\n }\n>;\n\n/** Transaction hash returned by {@link executeAccountCalls}; wait for its receipt before refreshing reads. */\nexport type ExecuteAccountCallsReturnType = Hash;\n\n/**\n * Execute named SYMMIO core writes atomically as one subaccount.\n *\n * Wallet execution uses one AccountLayer `_call(account, callDatas)` transaction,\n * simulated by default. Gasless execution uses the existing dispatcher and its\n * relayable-selector restrictions. This action never invents a wallet fallback.\n * Arguments are encoded before any wallet resolution; the SDK does not infer\n * request IDs or feed a call's return value into a later call.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, ordered calls, optional chain id, signer and execution overrides.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} for empty calls, unknown or read-only functions, an unsupported chain, no available wallet, or unsupported execution.\n * @throws Viem's encoding and write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await executeAccountCalls(config, {\n * account,\n * calls: [{ functionName: \"allocate\", args: [amount18] }],\n * gasless: false,\n * });\n * ```\n */\nexport async function executeAccountCalls(\n config: Config,\n parameters: ExecuteAccountCallsParameters,\n): Promise<ExecuteAccountCallsReturnType> {\n const { calls, ...execution } = parameters;\n\n if (calls.length === 0) {\n throw new SymmError(\"validation\", \"EMPTY_ACCOUNT_CALLS\", \"executeAccountCalls requires at least one core write.\");\n }\n\n const data = calls.map((call) => {\n if (!isCoreWrite(call.functionName)) {\n throw new SymmError(\"validation\", \"INVALID_ACCOUNT_CALL\", `Unknown SYMMIO core write: ${call.functionName}.`);\n }\n return encodeFunctionData({ abi: symmioAbi as Abi, functionName: call.functionName, args: call.args });\n });\n\n if (execution.timelock)\n return executeProtectedCoreBatch(config, { ...execution, callDatas: data, timelock: execution.timelock });\n\n return callAsSubAccount(config, { ...execution, data });\n}\n\n/** Whether `functionName` is a payable or nonpayable function in the SYMMIO core ABI. */\nfunction isCoreWrite(functionName: string) {\n return symmioAbi.some(\n (item) =>\n item.type === \"function\" &&\n item.name === functionName &&\n [\"nonpayable\", \"payable\"].includes(item.stateMutability),\n );\n}\n"],"mappings":";;;;;;AAwDA,eAAsB,EACpB,GACA,GACwC;CACxC,IAAM,EAAE,UAAO,GAAG,MAAc;CAEhC,IAAI,EAAM,WAAW,GACnB,MAAM,IAAI,EAAU,cAAc,uBAAuB,uDAAuD;CAGlH,IAAM,IAAO,EAAM,KAAK,MAAS;EAC/B,IAAI,CAAC,EAAY,EAAK,YAAY,GAChC,MAAM,IAAI,EAAU,cAAc,wBAAwB,8BAA8B,EAAK,aAAa,EAAE;EAE9G,OAAO,EAAmB;GAAE,KAAK;GAAkB,cAAc,EAAK;GAAc,MAAM,EAAK;EAAK,CAAC;CACvG,CAAC;CAKD,OAHI,EAAU,WACL,EAA0B,GAAQ;EAAE,GAAG;EAAW,WAAW;EAAM,UAAU,EAAU;CAAS,CAAC,IAEnG,EAAiB,GAAQ;EAAE,GAAG;EAAW;CAAK,CAAC;AACxD;AAGA,SAAS,EAAY,GAAsB;CACzC,OAAO,EAAU,MACd,MACC,EAAK,SAAS,cACd,EAAK,SAAS,KACd,CAAC,cAAc,SAAS,EAAE,SAAS,EAAK,eAAe,CAC3D;AACF"}
@@ -0,0 +1,3 @@
1
+ export * from './execute-account-calls.js';
2
+ export * from './query.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/execute-account-calls/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { ExecuteAccountCallsParameters } from './execute-account-calls.js';
3
+ /**
4
+ * Build TanStack Mutation options for {@link executeAccountCalls}.
5
+ *
6
+ * The returned `mutationFn` takes the action's parameters and forwards every
7
+ * execution parameter to `executeAccountCalls(config, …)`. Framework layers
8
+ * compose `onSuccess` invalidation (refresh the reads the calls affect after the
9
+ * receipt confirms) and error normalization on top.
10
+ *
11
+ * @param config - The SDK config (must have a `getWalletClient` resolver).
12
+ * @returns Options to pass to `useMutation`.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * useMutation(executeAccountCallsMutationOptions(config));
17
+ * ```
18
+ */
19
+ export declare function executeAccountCallsMutationOptions(config: Config): {
20
+ mutationKey: readonly ["executeAccountCalls"];
21
+ mutationFn: (variables: ExecuteAccountCallsParameters) => Promise<`0x${string}`>;
22
+ };
23
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/execute-account-calls/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAuB,KAAK,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAElG;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,MAAM;;4BAGrC,6BAA6B;EAExD"}
@@ -0,0 +1,12 @@
1
+ import { executeAccountCalls as e } from "./execute-account-calls.js";
2
+ //#region src/symmio-contracts/symmio/execute-account-calls/query.ts
3
+ function t(t) {
4
+ return {
5
+ mutationKey: ["executeAccountCalls"],
6
+ mutationFn: (n) => e(t, n)
7
+ };
8
+ }
9
+ //#endregion
10
+ export { t as executeAccountCallsMutationOptions };
11
+
12
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/execute-account-calls/query.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport { executeAccountCalls, type ExecuteAccountCallsParameters } from \"./execute-account-calls\";\n\n/**\n * Build TanStack Mutation options for {@link executeAccountCalls}.\n *\n * The returned `mutationFn` takes the action's parameters and forwards every\n * execution parameter to `executeAccountCalls(config, …)`. Framework layers\n * compose `onSuccess` invalidation (refresh the reads the calls affect after the\n * receipt confirms) and error normalization on top.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(executeAccountCallsMutationOptions(config));\n * ```\n */\nexport function executeAccountCallsMutationOptions(config: Config) {\n return {\n mutationKey: [\"executeAccountCalls\"] as const,\n mutationFn: (variables: ExecuteAccountCallsParameters) => executeAccountCalls(config, variables),\n };\n}\n"],"mappings":";;AAmBA,SAAgB,EAAmC,GAAgB;CACjE,OAAO;EACL,aAAa,CAAC,qBAAqB;EACnC,aAAa,MAA6C,EAAoB,GAAQ,CAAS;CACjG;AACF"}
@@ -0,0 +1,22 @@
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { ChainIdParameter, Compute } from '../../../shared/types/properties.js';
3
+ /** Parameters for {@link getDeallocateDebounceTime}. */
4
+ export type GetDeallocateDebounceTimeParameters = Compute<ChainIdParameter>;
5
+ /** Protocol deallocation debounce duration in seconds. */
6
+ export type GetDeallocateDebounceTimeReturnType = bigint;
7
+ /**
8
+ * Read the protocol's configured deallocation debounce duration.
9
+ *
10
+ * @param config - SDK configuration.
11
+ * @param parameters - Optional chain ID.
12
+ * @returns Raw duration in seconds; zero is a valid configured value.
13
+ * @throws {SymmError} when the chain is not supported.
14
+ * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const duration = await getDeallocateDebounceTime(config);
19
+ * ```
20
+ */
21
+ export declare function getDeallocateDebounceTime(config: Config, parameters?: GetDeallocateDebounceTimeParameters): Promise<GetDeallocateDebounceTimeReturnType>;
22
+ //# sourceMappingURL=get-deallocate-debounce-time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-deallocate-debounce-time.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAGlF,wDAAwD;AACxD,MAAM,MAAM,mCAAmC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE5E,0DAA0D;AAC1D,MAAM,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,mCAAwC,GACnD,OAAO,CAAC,mCAAmC,CAAC,CAW9C"}
@@ -0,0 +1,14 @@
1
+ import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
2
+ //#region src/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.ts
3
+ async function t(t, n = {}) {
4
+ let { chainId: r } = n, { addresses: i } = t.getChainConfig(r);
5
+ return t.getClient({ chainId: r }).readContract({
6
+ address: i.symmioAddress,
7
+ abi: e,
8
+ functionName: "getDeallocateDebounceTime"
9
+ });
10
+ }
11
+ //#endregion
12
+ export { t as getDeallocateDebounceTime };
13
+
14
+ //# sourceMappingURL=get-deallocate-debounce-time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-deallocate-debounce-time.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\n\n/** Parameters for {@link getDeallocateDebounceTime}. */\nexport type GetDeallocateDebounceTimeParameters = Compute<ChainIdParameter>;\n\n/** Protocol deallocation debounce duration in seconds. */\nexport type GetDeallocateDebounceTimeReturnType = bigint;\n\n/**\n * Read the protocol's configured deallocation debounce duration.\n *\n * @param config - SDK configuration.\n * @param parameters - Optional chain ID.\n * @returns Raw duration in seconds; zero is a valid configured value.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const duration = await getDeallocateDebounceTime(config);\n * ```\n */\nexport async function getDeallocateDebounceTime(\n config: Config,\n parameters: GetDeallocateDebounceTimeParameters = {},\n): Promise<GetDeallocateDebounceTimeReturnType> {\n const { chainId } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: addresses.symmioAddress,\n abi: symmioAbi,\n functionName: \"getDeallocateDebounceTime\",\n });\n}\n"],"mappings":";;AAwBA,eAAsB,EACpB,GACA,IAAkD,CAAC,GACL;CAC9C,IAAM,EAAE,eAAY,GAEd,EAAE,iBAAc,EAAO,eAAe,CAAO;CAGnD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;CAChB,CAAC;AACH"}
@@ -0,0 +1,3 @@
1
+ export * from './get-deallocate-debounce-time.js';
2
+ export * from './query.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/get-deallocate-debounce-time/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,SAAS,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { Compute, ConfigKeyParameter } from '../../../shared/types/properties.js';
3
+ import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query.js';
4
+ import { GetDeallocateDebounceTimeParameters, GetDeallocateDebounceTimeReturnType } from './get-deallocate-debounce-time.js';
5
+ /** Query data returned by {@link getDeallocateDebounceTimeQueryOptions}. */
6
+ export type GetDeallocateDebounceTimeData = GetDeallocateDebounceTimeReturnType;
7
+ /**
8
+ * Build the query key for {@link getDeallocateDebounceTime}.
9
+ *
10
+ * @param options - Action parameters and optional deployment cache scope.
11
+ * @returns A stable query key.
12
+ */
13
+ export declare function getDeallocateDebounceTimeQueryKey(options?: Compute<GetDeallocateDebounceTimeParameters & ConfigKeyParameter>): readonly ["getDeallocateDebounceTime", Record<string, unknown>];
14
+ /** Key returned by {@link getDeallocateDebounceTimeQueryKey}. */
15
+ export type GetDeallocateDebounceTimeQueryKey = ReturnType<typeof getDeallocateDebounceTimeQueryKey>;
16
+ /** Action parameters and query overrides for {@link getDeallocateDebounceTimeQueryOptions}. */
17
+ export type GetDeallocateDebounceTimeOptions = Compute<GetDeallocateDebounceTimeParameters & QueryParameter<GetDeallocateDebounceTimeData, Error, GetDeallocateDebounceTimeData, GetDeallocateDebounceTimeQueryKey>>;
18
+ /** TanStack options returned by {@link getDeallocateDebounceTimeQueryOptions}. */
19
+ export type GetDeallocateDebounceTimeQueryOptions = SymmioQueryOptions<GetDeallocateDebounceTimeData, Error, GetDeallocateDebounceTimeData, GetDeallocateDebounceTimeQueryKey>;
20
+ /**
21
+ * Build deployment-scoped TanStack query options for {@link getDeallocateDebounceTime}.
22
+ * An unsupported chain surfaces a {@link SymmError} from the query function.
23
+ *
24
+ * @param config - SDK configuration.
25
+ * @param options - Action parameters and optional TanStack overrides.
26
+ * @returns Query options with the SDK-owned function and key.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * useQuery(getDeallocateDebounceTimeQueryOptions(config));
31
+ * ```
32
+ */
33
+ export declare function getDeallocateDebounceTimeQueryOptions(config: Config, options?: GetDeallocateDebounceTimeOptions): GetDeallocateDebounceTimeQueryOptions;
34
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/get-deallocate-debounce-time/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtF,OAAO,EAEL,KAAK,mCAAmC,EACxC,KAAK,mCAAmC,EACzC,MAAM,gCAAgC,CAAC;AAExC,4EAA4E;AAC5E,MAAM,MAAM,6BAA6B,GAAG,mCAAmC,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,OAAO,CAAC,mCAAmC,GAAG,kBAAkB,CAAM,mEAGhF;AAED,iEAAiE;AACjE,MAAM,MAAM,iCAAiC,GAAG,UAAU,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAErG,+FAA+F;AAC/F,MAAM,MAAM,gCAAgC,GAAG,OAAO,CACpD,mCAAmC,GACjC,cAAc,CACZ,6BAA6B,EAC7B,KAAK,EACL,6BAA6B,EAC7B,iCAAiC,CAClC,CACJ,CAAC;AAEF,kFAAkF;AAClF,MAAM,MAAM,qCAAqC,GAAG,kBAAkB,CACpE,6BAA6B,EAC7B,KAAK,EACL,6BAA6B,EAC7B,iCAAiC,CAClC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,gCAAqC,GAC7C,qCAAqC,CAOvC"}