@symmio/trading-core 4.2.1 → 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 (586) 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.d.ts +3 -1
  137. package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -1
  138. package/dist/solvers/estimated-price/get-estimated-price.js +6 -6
  139. package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -1
  140. package/dist/solvers/estimated-price/to-estimated-price.d.ts +2 -1
  141. package/dist/solvers/estimated-price/to-estimated-price.d.ts.map +1 -1
  142. package/dist/solvers/estimated-price/to-estimated-price.js +4 -1
  143. package/dist/solvers/estimated-price/to-estimated-price.js.map +1 -1
  144. package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -1
  145. package/dist/solvers/force-close/force-close-auto.js +70 -69
  146. package/dist/solvers/force-close/force-close-auto.js.map +1 -1
  147. package/dist/solvers/get-error-message/get-error-message.js +4 -4
  148. package/dist/solvers/get-party-a-upnl/get-party-a-upnl.js +4 -4
  149. package/dist/solvers/get-solver-balance-info/get-solver-balance-info.js +4 -4
  150. package/dist/solvers/get-solver-info/get-solver-info.d.ts +5 -2
  151. package/dist/solvers/get-solver-info/get-solver-info.d.ts.map +1 -1
  152. package/dist/solvers/get-solver-info/get-solver-info.js +14 -12
  153. package/dist/solvers/get-solver-info/get-solver-info.js.map +1 -1
  154. package/dist/solvers/get-solver-info/parse-timelock-info.d.ts +5 -0
  155. package/dist/solvers/get-solver-info/parse-timelock-info.d.ts.map +1 -0
  156. package/dist/solvers/get-solver-info/parse-timelock-info.js +27 -0
  157. package/dist/solvers/get-solver-info/parse-timelock-info.js.map +1 -0
  158. package/dist/solvers/get-solver-open-interest/get-solver-open-interest.js +4 -4
  159. package/dist/solvers/get-solver-price-range/get-solver-price-range.js +4 -4
  160. package/dist/solvers/get-solver-readiness/get-solver-readiness.js +4 -4
  161. package/dist/solvers/instant-open/get-instant-opens/adapters/enigma-instant-opens.js +17 -17
  162. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts +8 -7
  163. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts.map +1 -1
  164. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +43 -39
  165. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js.map +1 -1
  166. package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.d.ts +16 -0
  167. package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.d.ts.map +1 -0
  168. package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.js +92 -0
  169. package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.js.map +1 -0
  170. package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +1 -1
  171. package/dist/solvers/instant-open/instant-open/index.d.ts +2 -0
  172. package/dist/solvers/instant-open/instant-open/index.d.ts.map +1 -1
  173. package/dist/solvers/instant-open/instant-open/instant-open.d.ts +22 -6
  174. package/dist/solvers/instant-open/instant-open/instant-open.d.ts.map +1 -1
  175. package/dist/solvers/instant-open/instant-open/instant-open.js +35 -27
  176. package/dist/solvers/instant-open/instant-open/instant-open.js.map +1 -1
  177. package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.d.ts +12 -0
  178. package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.d.ts.map +1 -0
  179. package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.js +49 -0
  180. package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.js.map +1 -0
  181. package/dist/solvers/instant-open/instant-open/prepared/types.d.ts +20 -0
  182. package/dist/solvers/instant-open/instant-open/prepared/types.d.ts.map +1 -0
  183. package/dist/solvers/instant-open/instant-open/types.d.ts +5 -4
  184. package/dist/solvers/instant-open/instant-open/types.d.ts.map +1 -1
  185. package/dist/solvers/instant-open/shared/hedger-api.d.ts.map +1 -1
  186. package/dist/solvers/instant-open/shared/hedger-api.js +38 -26
  187. package/dist/solvers/instant-open/shared/hedger-api.js.map +1 -1
  188. package/dist/solvers/markets/adapters/enigma-markets.js +34 -34
  189. package/dist/solvers/notional-cap/get-notional-cap-page.js +4 -4
  190. package/dist/solvers/revenue/get-solver-revenue.js +10 -10
  191. package/dist/solvers/revenue-records/get-revenue-records.js +11 -11
  192. package/dist/solvers/symbols/get-symbols.js +13 -13
  193. package/dist/solvers/trade-volume/get-trade-volume.js +10 -10
  194. package/dist/solvers/types/generated/enigma-solver.d.ts +1 -0
  195. package/dist/solvers/types/generated/enigma-solver.d.ts.map +1 -1
  196. package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
  197. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts +46 -0
  198. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts.map +1 -1
  199. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js +53 -0
  200. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -1
  201. package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +3 -0
  202. package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts.map +1 -1
  203. package/dist/symmio-contracts/account-layer/actions/add-margin.js +41 -27
  204. package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
  205. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +23 -9
  206. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts.map +1 -1
  207. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +15 -36
  208. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
  209. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +3 -0
  210. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts.map +1 -1
  211. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +40 -26
  212. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
  213. package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +1 -1
  214. package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts.map +1 -1
  215. package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +18 -37
  216. package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
  217. package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.d.ts +46 -0
  218. package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.d.ts.map +1 -0
  219. package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.js +20 -0
  220. package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.js.map +1 -0
  221. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.d.ts +31 -0
  222. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
  223. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.js +15 -0
  224. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.js.map +1 -0
  225. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.d.ts +54 -0
  226. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.d.ts.map +1 -0
  227. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.js +26 -0
  228. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.js.map +1 -0
  229. package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +3 -0
  230. package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts.map +1 -1
  231. package/dist/symmio-contracts/account-layer/actions/remove-margin.js +50 -32
  232. package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
  233. package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.d.ts +12 -0
  234. package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.d.ts.map +1 -0
  235. package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.js +10 -0
  236. package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.js.map +1 -0
  237. package/dist/symmio-contracts/account-layer/cancel-timelock-op/index.d.ts +3 -0
  238. package/dist/symmio-contracts/account-layer/cancel-timelock-op/index.d.ts.map +1 -0
  239. package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.d.ts +9 -0
  240. package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.d.ts.map +1 -0
  241. package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.js +13 -0
  242. package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.js.map +1 -0
  243. package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.d.ts +12 -0
  244. package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.d.ts.map +1 -0
  245. package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.js +10 -0
  246. package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.js.map +1 -0
  247. package/dist/symmio-contracts/account-layer/clear-timelocks/index.d.ts +3 -0
  248. package/dist/symmio-contracts/account-layer/clear-timelocks/index.d.ts.map +1 -0
  249. package/dist/symmio-contracts/account-layer/clear-timelocks/query.d.ts +9 -0
  250. package/dist/symmio-contracts/account-layer/clear-timelocks/query.d.ts.map +1 -0
  251. package/dist/symmio-contracts/account-layer/clear-timelocks/query.js +13 -0
  252. package/dist/symmio-contracts/account-layer/clear-timelocks/query.js.map +1 -0
  253. package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.d.ts +12 -0
  254. package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.d.ts.map +1 -0
  255. package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js +9 -0
  256. package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js.map +1 -0
  257. package/dist/symmio-contracts/account-layer/execute-timelock-op/index.d.ts +3 -0
  258. package/dist/symmio-contracts/account-layer/execute-timelock-op/index.d.ts.map +1 -0
  259. package/dist/symmio-contracts/account-layer/execute-timelock-op/query.d.ts +9 -0
  260. package/dist/symmio-contracts/account-layer/execute-timelock-op/query.d.ts.map +1 -0
  261. package/dist/symmio-contracts/account-layer/execute-timelock-op/query.js +13 -0
  262. package/dist/symmio-contracts/account-layer/execute-timelock-op/query.js.map +1 -0
  263. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.d.ts +12 -0
  264. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.d.ts.map +1 -0
  265. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.js +16 -0
  266. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.js.map +1 -0
  267. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/index.d.ts +2 -0
  268. package/dist/symmio-contracts/account-layer/get-min-timelock-delay/index.d.ts.map +1 -0
  269. package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.d.ts +12 -0
  270. package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.d.ts.map +1 -0
  271. package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js +22 -0
  272. package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js.map +1 -0
  273. package/dist/symmio-contracts/account-layer/get-selector-timelock/index.d.ts +3 -0
  274. package/dist/symmio-contracts/account-layer/get-selector-timelock/index.d.ts.map +1 -0
  275. package/dist/symmio-contracts/account-layer/get-selector-timelock/query.d.ts +22 -0
  276. package/dist/symmio-contracts/account-layer/get-selector-timelock/query.d.ts.map +1 -0
  277. package/dist/symmio-contracts/account-layer/get-selector-timelock/query.js +21 -0
  278. package/dist/symmio-contracts/account-layer/get-selector-timelock/query.js.map +1 -0
  279. package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.d.ts +12 -0
  280. package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.d.ts.map +1 -0
  281. package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.js +22 -0
  282. package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.js.map +1 -0
  283. package/dist/symmio-contracts/account-layer/get-timelock-schedule/index.d.ts +2 -0
  284. package/dist/symmio-contracts/account-layer/get-timelock-schedule/index.d.ts.map +1 -0
  285. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.d.ts +13 -0
  286. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.d.ts.map +1 -0
  287. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.js +17 -0
  288. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.js.map +1 -0
  289. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/index.d.ts +2 -0
  290. package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/index.d.ts.map +1 -0
  291. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.d.ts +12 -0
  292. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.d.ts.map +1 -0
  293. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.js +67 -0
  294. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.js.map +1 -0
  295. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/index.d.ts +3 -0
  296. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/index.d.ts.map +1 -0
  297. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.d.ts +21 -0
  298. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.d.ts.map +1 -0
  299. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.js +21 -0
  300. package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.js.map +1 -0
  301. package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.d.ts +15 -0
  302. package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.d.ts.map +1 -0
  303. package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.js +17 -0
  304. package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.js.map +1 -0
  305. package/dist/symmio-contracts/account-layer/hash-timelock-approval/index.d.ts +2 -0
  306. package/dist/symmio-contracts/account-layer/hash-timelock-approval/index.d.ts.map +1 -0
  307. package/dist/symmio-contracts/account-layer/hook-metadata.d.ts +47 -0
  308. package/dist/symmio-contracts/account-layer/hook-metadata.d.ts.map +1 -0
  309. package/dist/symmio-contracts/account-layer/hook-metadata.js +30 -0
  310. package/dist/symmio-contracts/account-layer/hook-metadata.js.map +1 -0
  311. package/dist/symmio-contracts/account-layer/index.d.ts +21 -0
  312. package/dist/symmio-contracts/account-layer/index.d.ts.map +1 -1
  313. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/index.d.ts +2 -0
  314. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/index.d.ts.map +1 -0
  315. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.d.ts +14 -0
  316. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.d.ts.map +1 -0
  317. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.js +17 -0
  318. package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.js.map +1 -0
  319. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.js +6 -6
  320. package/dist/symmio-contracts/account-layer/query/get-account-balance-info.js +6 -6
  321. package/dist/symmio-contracts/account-layer/query/get-account-balance-of.js +6 -6
  322. package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.d.ts +43 -0
  323. package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.d.ts.map +1 -0
  324. package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.js +31 -0
  325. package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.js.map +1 -0
  326. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.js +6 -6
  327. package/dist/symmio-contracts/account-layer/query/get-sub-account-virtual-nonce.js +6 -6
  328. package/dist/symmio-contracts/account-layer/query/get-sub-accounts-count-of-user.js +6 -6
  329. package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts-addresses.js +6 -6
  330. package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts.js +6 -6
  331. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-addresses-of-sub-account.js +6 -6
  332. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.d.ts +39 -0
  333. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
  334. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.js +29 -0
  335. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.js.map +1 -0
  336. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.d.ts +39 -0
  337. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.d.ts.map +1 -0
  338. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.js +31 -0
  339. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.js.map +1 -0
  340. package/dist/symmio-contracts/account-layer/query/predict-next-virtual-account.js +6 -6
  341. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/index.d.ts +2 -0
  342. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/index.d.ts.map +1 -0
  343. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.d.ts +19 -0
  344. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.d.ts.map +1 -0
  345. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js +10 -0
  346. package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js.map +1 -0
  347. package/dist/symmio-contracts/account-layer/schedule-timelock-op/index.d.ts +3 -0
  348. package/dist/symmio-contracts/account-layer/schedule-timelock-op/index.d.ts.map +1 -0
  349. package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.d.ts +9 -0
  350. package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.d.ts.map +1 -0
  351. package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.js +13 -0
  352. package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.js.map +1 -0
  353. package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.d.ts +12 -0
  354. package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.d.ts.map +1 -0
  355. package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.js +10 -0
  356. package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.js.map +1 -0
  357. package/dist/symmio-contracts/account-layer/setup-timelocks/index.d.ts +3 -0
  358. package/dist/symmio-contracts/account-layer/setup-timelocks/index.d.ts.map +1 -0
  359. package/dist/symmio-contracts/account-layer/setup-timelocks/query.d.ts +9 -0
  360. package/dist/symmio-contracts/account-layer/setup-timelocks/query.d.ts.map +1 -0
  361. package/dist/symmio-contracts/account-layer/setup-timelocks/query.js +13 -0
  362. package/dist/symmio-contracts/account-layer/setup-timelocks/query.js.map +1 -0
  363. package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.d.ts +13 -0
  364. package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.d.ts.map +1 -0
  365. package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.js +18 -0
  366. package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.js.map +1 -0
  367. package/dist/symmio-contracts/account-layer/timelock-selector.d.ts +4 -0
  368. package/dist/symmio-contracts/account-layer/timelock-selector.d.ts.map +1 -0
  369. package/dist/symmio-contracts/account-layer/timelock-selector.js +9 -0
  370. package/dist/symmio-contracts/account-layer/timelock-selector.js.map +1 -0
  371. package/dist/symmio-contracts/account-layer/timelock-test.d.ts +7 -0
  372. package/dist/symmio-contracts/account-layer/timelock-test.d.ts.map +1 -0
  373. package/dist/symmio-contracts/account-layer/timelock-types.d.ts +66 -0
  374. package/dist/symmio-contracts/account-layer/timelock-types.d.ts.map +1 -0
  375. package/dist/symmio-contracts/account-layer/types.d.ts +32 -2
  376. package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
  377. package/dist/symmio-contracts/account-layer/types.js.map +1 -1
  378. package/dist/symmio-contracts/account-layer/write-timelock.d.ts +10 -0
  379. package/dist/symmio-contracts/account-layer/write-timelock.d.ts.map +1 -0
  380. package/dist/symmio-contracts/account-layer/write-timelock.js +51 -0
  381. package/dist/symmio-contracts/account-layer/write-timelock.js.map +1 -0
  382. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +4 -1
  383. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts.map +1 -1
  384. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +42 -38
  385. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
  386. package/dist/symmio-contracts/instant-layer/actions/grant-delegations.d.ts +75 -0
  387. package/dist/symmio-contracts/instant-layer/actions/grant-delegations.d.ts.map +1 -0
  388. package/dist/symmio-contracts/instant-layer/actions/grant-delegations.js +46 -0
  389. package/dist/symmio-contracts/instant-layer/actions/grant-delegations.js.map +1 -0
  390. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.d.ts +32 -0
  391. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.d.ts.map +1 -0
  392. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.js +18 -0
  393. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.js.map +1 -0
  394. package/dist/symmio-contracts/instant-layer/grant-delegations-input.d.ts +33 -0
  395. package/dist/symmio-contracts/instant-layer/grant-delegations-input.d.ts.map +1 -0
  396. package/dist/symmio-contracts/instant-layer/grant-delegations-input.js +18 -0
  397. package/dist/symmio-contracts/instant-layer/grant-delegations-input.js.map +1 -0
  398. package/dist/symmio-contracts/instant-layer/index.d.ts +4 -0
  399. package/dist/symmio-contracts/instant-layer/index.d.ts.map +1 -1
  400. package/dist/symmio-contracts/instant-layer/query/grant-delegations.d.ts +22 -0
  401. package/dist/symmio-contracts/instant-layer/query/grant-delegations.d.ts.map +1 -0
  402. package/dist/symmio-contracts/instant-layer/query/grant-delegations.js +12 -0
  403. package/dist/symmio-contracts/instant-layer/query/grant-delegations.js.map +1 -0
  404. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.d.ts +19 -0
  405. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.d.ts.map +1 -0
  406. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.js +12 -0
  407. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.js.map +1 -0
  408. package/dist/symmio-contracts/symmio/actions/allocate.d.ts +3 -0
  409. package/dist/symmio-contracts/symmio/actions/allocate.d.ts.map +1 -1
  410. package/dist/symmio-contracts/symmio/actions/allocate.js +22 -16
  411. package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
  412. package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.d.ts +74 -0
  413. package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.d.ts.map +1 -0
  414. package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.js +36 -0
  415. package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.js.map +1 -0
  416. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts +3 -0
  417. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts.map +1 -1
  418. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js +32 -29
  419. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js.map +1 -1
  420. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +3 -0
  421. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts.map +1 -1
  422. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +37 -28
  423. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
  424. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +3 -0
  425. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
  426. package/dist/symmio-contracts/symmio/actions/deallocate.js +30 -20
  427. package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
  428. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +5 -0
  429. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts.map +1 -1
  430. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +31 -18
  431. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
  432. package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +4 -0
  433. package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -1
  434. package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +30 -25
  435. package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -1
  436. package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +4 -0
  437. package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -1
  438. package/dist/symmio-contracts/symmio/actions/withdraw.js +12 -8
  439. package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
  440. package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.d.ts +48 -0
  441. package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.d.ts.map +1 -0
  442. package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.js +33 -0
  443. package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.js.map +1 -0
  444. package/dist/symmio-contracts/symmio/execute-account-calls/index.d.ts +3 -0
  445. package/dist/symmio-contracts/symmio/execute-account-calls/index.d.ts.map +1 -0
  446. package/dist/symmio-contracts/symmio/execute-account-calls/query.d.ts +23 -0
  447. package/dist/symmio-contracts/symmio/execute-account-calls/query.d.ts.map +1 -0
  448. package/dist/symmio-contracts/symmio/execute-account-calls/query.js +12 -0
  449. package/dist/symmio-contracts/symmio/execute-account-calls/query.js.map +1 -0
  450. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.d.ts +22 -0
  451. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.d.ts.map +1 -0
  452. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.js +14 -0
  453. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.js.map +1 -0
  454. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/index.d.ts +3 -0
  455. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/index.d.ts.map +1 -0
  456. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.d.ts +34 -0
  457. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.d.ts.map +1 -0
  458. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.js +21 -0
  459. package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.js.map +1 -0
  460. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.d.ts +34 -0
  461. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.d.ts.map +1 -0
  462. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.js +35 -0
  463. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.js.map +1 -0
  464. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/index.d.ts +3 -0
  465. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/index.d.ts.map +1 -0
  466. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.d.ts +15 -0
  467. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.d.ts.map +1 -0
  468. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.js +20 -0
  469. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.js.map +1 -0
  470. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.d.ts +22 -0
  471. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.d.ts.map +1 -0
  472. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.js +30 -0
  473. package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.js.map +1 -0
  474. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.d.ts +30 -0
  475. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.d.ts.map +1 -0
  476. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.js +15 -0
  477. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.js.map +1 -0
  478. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/index.d.ts +3 -0
  479. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/index.d.ts.map +1 -0
  480. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.d.ts +38 -0
  481. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.d.ts.map +1 -0
  482. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.js +24 -0
  483. package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.js.map +1 -0
  484. package/dist/symmio-contracts/symmio/index.d.ts +6 -0
  485. package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
  486. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts.map +1 -1
  487. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +35 -34
  488. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
  489. package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.d.ts +18 -0
  490. package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.d.ts.map +1 -0
  491. package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.js +14 -0
  492. package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.js.map +1 -0
  493. package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.d.ts +18 -0
  494. package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.d.ts.map +1 -0
  495. package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.js +12 -0
  496. package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.js.map +1 -0
  497. package/dist/symmio-subgraph/executeSubgraphRequest.js +3 -3
  498. package/dist/timelock/approval.d.ts +142 -0
  499. package/dist/timelock/approval.d.ts.map +1 -0
  500. package/dist/timelock/approval.js +176 -0
  501. package/dist/timelock/approval.js.map +1 -0
  502. package/dist/timelock/attempt-outcome.d.ts +37 -0
  503. package/dist/timelock/attempt-outcome.d.ts.map +1 -0
  504. package/dist/timelock/attempt-outcome.js +70 -0
  505. package/dist/timelock/attempt-outcome.js.map +1 -0
  506. package/dist/timelock/confirm-write.d.ts +5 -0
  507. package/dist/timelock/confirm-write.d.ts.map +1 -0
  508. package/dist/timelock/confirm-write.js +18 -0
  509. package/dist/timelock/confirm-write.js.map +1 -0
  510. package/dist/timelock/early-withdraw/early-withdraw.d.ts +60 -0
  511. package/dist/timelock/early-withdraw/early-withdraw.d.ts.map +1 -0
  512. package/dist/timelock/early-withdraw/early-withdraw.js +94 -0
  513. package/dist/timelock/early-withdraw/early-withdraw.js.map +1 -0
  514. package/dist/timelock/early-withdraw/index.d.ts +2 -0
  515. package/dist/timelock/early-withdraw/index.d.ts.map +1 -0
  516. package/dist/timelock/errors.d.ts +23 -0
  517. package/dist/timelock/errors.d.ts.map +1 -0
  518. package/dist/timelock/errors.js +29 -0
  519. package/dist/timelock/errors.js.map +1 -0
  520. package/dist/timelock/execute-protected-batch.d.ts +31 -0
  521. package/dist/timelock/execute-protected-batch.d.ts.map +1 -0
  522. package/dist/timelock/execute-protected-batch.js +148 -0
  523. package/dist/timelock/execute-protected-batch.js.map +1 -0
  524. package/dist/timelock/execute-protected-call.d.ts +68 -0
  525. package/dist/timelock/execute-protected-call.d.ts.map +1 -0
  526. package/dist/timelock/execute-protected-call.js +146 -0
  527. package/dist/timelock/execute-protected-call.js.map +1 -0
  528. package/dist/timelock/execute-protected-function.d.ts +51 -0
  529. package/dist/timelock/execute-protected-function.d.ts.map +1 -0
  530. package/dist/timelock/execute-protected-function.js +37 -0
  531. package/dist/timelock/execute-protected-function.js.map +1 -0
  532. package/dist/timelock/get-timelock-policy/get-timelock-policy.d.ts +38 -0
  533. package/dist/timelock/get-timelock-policy/get-timelock-policy.d.ts.map +1 -0
  534. package/dist/timelock/get-timelock-policy/get-timelock-policy.js +49 -0
  535. package/dist/timelock/get-timelock-policy/get-timelock-policy.js.map +1 -0
  536. package/dist/timelock/get-timelock-policy/index.d.ts +3 -0
  537. package/dist/timelock/get-timelock-policy/index.d.ts.map +1 -0
  538. package/dist/timelock/get-timelock-policy/query.d.ts +13 -0
  539. package/dist/timelock/get-timelock-policy/query.d.ts.map +1 -0
  540. package/dist/timelock/get-timelock-policy/query.js +21 -0
  541. package/dist/timelock/get-timelock-policy/query.js.map +1 -0
  542. package/dist/timelock/index.d.ts +14 -0
  543. package/dist/timelock/index.d.ts.map +1 -0
  544. package/dist/timelock/normalize-timelock-revert.d.ts +3 -0
  545. package/dist/timelock/normalize-timelock-revert.d.ts.map +1 -0
  546. package/dist/timelock/normalize-timelock-revert.js +11 -0
  547. package/dist/timelock/normalize-timelock-revert.js.map +1 -0
  548. package/dist/timelock/policy-change.d.ts +72 -0
  549. package/dist/timelock/policy-change.d.ts.map +1 -0
  550. package/dist/timelock/policy-change.js +63 -0
  551. package/dist/timelock/policy-change.js.map +1 -0
  552. package/dist/timelock/policy.d.ts +19 -0
  553. package/dist/timelock/policy.d.ts.map +1 -0
  554. package/dist/timelock/policy.js +59 -0
  555. package/dist/timelock/policy.js.map +1 -0
  556. package/dist/timelock/protected-call-preflight.d.ts +10 -0
  557. package/dist/timelock/protected-call-preflight.d.ts.map +1 -0
  558. package/dist/timelock/protected-call-preflight.js +17 -0
  559. package/dist/timelock/protected-call-preflight.js.map +1 -0
  560. package/dist/timelock/root-account.d.ts +14 -0
  561. package/dist/timelock/root-account.d.ts.map +1 -0
  562. package/dist/timelock/root-account.js +9 -0
  563. package/dist/timelock/root-account.js.map +1 -0
  564. package/dist/timelock/scheduled-call-match.d.ts +4 -0
  565. package/dist/timelock/scheduled-call-match.d.ts.map +1 -0
  566. package/dist/timelock/scheduled-call-match.js +43 -0
  567. package/dist/timelock/scheduled-call-match.js.map +1 -0
  568. package/dist/timelock/setup-timelock-policy/index.d.ts +2 -0
  569. package/dist/timelock/setup-timelock-policy/index.d.ts.map +1 -0
  570. package/dist/timelock/setup-timelock-policy/setup-timelock-policy.d.ts +46 -0
  571. package/dist/timelock/setup-timelock-policy/setup-timelock-policy.d.ts.map +1 -0
  572. package/dist/timelock/setup-timelock-policy/setup-timelock-policy.js +58 -0
  573. package/dist/timelock/setup-timelock-policy/setup-timelock-policy.js.map +1 -0
  574. package/dist/timelock/support.d.ts +4 -0
  575. package/dist/timelock/support.d.ts.map +1 -0
  576. package/dist/timelock/support.js +9 -0
  577. package/dist/timelock/support.js.map +1 -0
  578. package/dist/transactions/execute-contract-write.d.ts +9 -0
  579. package/dist/transactions/execute-contract-write.d.ts.map +1 -0
  580. package/dist/transactions/execute-contract-write.js +35 -0
  581. package/dist/transactions/execute-contract-write.js.map +1 -0
  582. package/dist/transactions/execute-write.d.ts +32 -0
  583. package/dist/transactions/execute-write.d.ts.map +1 -0
  584. package/dist/transactions/execute-write.js +23 -0
  585. package/dist/transactions/execute-write.js.map +1 -0
  586. package/package.json +1 -1
@@ -0,0 +1,94 @@
1
+ import { symmioAbi as e } from "../../symmio-contracts/abi/v0.8.6/symmio.js";
2
+ import { SymmError as t } from "../../shared/errors/symm-error.js";
3
+ import { createHttpTimelockApprovalProvider as n, encodeTimelockedCoreCall as r, requestTimelockApproval as i } from "../approval.js";
4
+ import { getSubAccount as a } from "../../symmio-contracts/account-layer/actions/get-sub-account.js";
5
+ import { executeTimelockOp as o } from "../../symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js";
6
+ import { assertCoreTimelockWrapperUnprotected as s } from "../protected-call-preflight.js";
7
+ import { encodeInitiateWithdrawCall as c } from "../../symmio-contracts/symmio/actions/initiate-withdraw.js";
8
+ import { getTimelockPolicy as l } from "../get-timelock-policy/get-timelock-policy.js";
9
+ import { encodeFunctionData as u, isAddressEqual as d, sliceHex as f } from "viem";
10
+ //#region src/timelock/early-withdraw/early-withdraw.ts
11
+ var p = class extends Error {
12
+ hash;
13
+ approval;
14
+ callData;
15
+ constructor(e, t, n, r) {
16
+ super("Approval was issued but withdrawal submission did not complete. Reconcile before retrying.", { cause: n }), this.approval = e, this.callData = t, this.hash = r;
17
+ }
18
+ };
19
+ function m(t) {
20
+ switch (t.method) {
21
+ case "withdraw": return u({
22
+ abi: e,
23
+ functionName: "withdraw",
24
+ args: [t.amount]
25
+ });
26
+ case "withdrawTo": return u({
27
+ abi: e,
28
+ functionName: "withdrawTo",
29
+ args: [t.recipient, t.amount]
30
+ });
31
+ case "initiateWithdraw": return c(t);
32
+ }
33
+ }
34
+ async function h(e, c) {
35
+ let u = m(c.withdrawal), h = await l(e, {
36
+ ...c,
37
+ selectors: [f(u, 0, 4)]
38
+ });
39
+ if (!h.ready) throw new t("validation", "TIMELOCK_POLICY_REQUIRED", "Configure the withdrawal selector and wait for provider indexing before requesting approval.");
40
+ await s(e, {
41
+ account: c.account,
42
+ rootAccount: h.rootAccount,
43
+ chainId: c.chainId,
44
+ callData: u
45
+ });
46
+ let g = (await a(e, {
47
+ chainId: c.chainId,
48
+ account: h.rootAccount
49
+ })).owner, _ = await e.getWalletClient({
50
+ chainId: c.chainId,
51
+ from: c.from ?? g
52
+ });
53
+ if (!d(_.account.address, g)) throw new t("validation", "TIMELOCK_OWNER_REQUIRED", "The owner wallet must execute the early withdrawal.");
54
+ if (_.chain?.id !== e.getChainConfig(c.chainId).chainId) throw new t("validation", "TIMELOCK_WALLET_CHAIN_MISMATCH", "Switch the execution wallet to the selected chain.");
55
+ let v = c.provider ?? n({ baseUrl: e.getSolver(c).url }), y = await i(e, {
56
+ chainId: c.chainId,
57
+ account: c.account,
58
+ rootAccount: h.rootAccount,
59
+ capability: h.capability,
60
+ callData: u,
61
+ deadline: c.deadline,
62
+ from: c.approvalSigner ?? g,
63
+ provider: v,
64
+ signal: c.signal
65
+ });
66
+ try {
67
+ return await c.onApproval?.(y), {
68
+ hash: await o(e, {
69
+ ...c,
70
+ from: g,
71
+ gasless: c.gasless,
72
+ account: h.rootAccount,
73
+ approvals: [y.signedApproval],
74
+ innerCallData: r(c.account, u)
75
+ }),
76
+ rootAccount: h.rootAccount,
77
+ callData: u,
78
+ approval: y
79
+ };
80
+ } catch (e) {
81
+ throw new p(y, u, e);
82
+ }
83
+ }
84
+ function g(e) {
85
+ return {
86
+ mutationKey: ["earlyWithdraw"],
87
+ retry: !1,
88
+ mutationFn: (t) => h(e, t)
89
+ };
90
+ }
91
+ //#endregion
92
+ export { p as EarlyWithdrawExecutionError, h as earlyWithdraw, g as earlyWithdrawMutationOptions };
93
+
94
+ //# sourceMappingURL=early-withdraw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"early-withdraw.js","names":[],"sources":["../../../src/timelock/early-withdraw/early-withdraw.ts"],"sourcesContent":["import { encodeFunctionData, isAddressEqual, sliceHex, type Address, type Hash, type Hex } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport { symmioAbi } from \"../../symmio-contracts/abi/v0.8.6/symmio\";\nimport { getSubAccount } from \"../../symmio-contracts/account-layer/actions/get-sub-account\";\nimport { executeTimelockOp } from \"../../symmio-contracts/account-layer/execute-timelock-op\";\nimport type { TimelockWriteParameters } from \"../../symmio-contracts/account-layer/timelock-types\";\nimport {\n encodeInitiateWithdrawCall,\n type InitiateWithdrawParameters,\n} from \"../../symmio-contracts/symmio/actions/initiate-withdraw\";\nimport {\n createHttpTimelockApprovalProvider,\n encodeTimelockedCoreCall,\n requestTimelockApproval,\n type TimelockApprovalProvider,\n type ValidatedTimelockApproval,\n} from \"../approval\";\nimport { getTimelockPolicy, type GetTimelockPolicyParameters } from \"../get-timelock-policy/get-timelock-policy\";\nimport { assertCoreTimelockWrapperUnprotected } from \"../protected-call-preflight\";\n\n/** Exact Core withdrawal variants. Amounts retain the deployed contract's raw units. */\nexport type EarlyWithdrawalCall =\n | { method: \"withdraw\"; amount: bigint }\n | { method: \"withdrawTo\"; recipient: Address; amount: bigint }\n | ({ method: \"initiateWithdraw\" } & Pick<InitiateWithdrawParameters, \"parts\" | \"speedUp\" | \"providerData\">);\n\n/** Early-withdrawal inputs. Public approval signing and transaction execution have distinct wallet identities. */\nexport type EarlyWithdrawParameters = Omit<GetTimelockPolicyParameters, \"selectors\"> &\n TimelockWriteParameters & {\n withdrawal: EarlyWithdrawalCall;\n provider?: TimelockApprovalProvider;\n /** Optional delegated approval signer. `from` continues to select the execution wallet. */\n approvalSigner?: Address;\n /** Request expiry in Unix seconds, at most one hour ahead. */\n deadline: bigint;\n signal?: AbortSignal;\n /** Persist the one issued approval before execution. A persistence failure stops submission. */\n onApproval?: (approval: ValidatedTimelockApproval) => void | Promise<void>;\n };\n\n/** Submitted transaction, not proof of withdrawal completion. Retain the approval for recovery. */\nexport interface EarlyWithdrawResult {\n hash: Hash;\n rootAccount: Address;\n callData: Hex;\n approval: ValidatedTimelockApproval;\n}\n\n/** Failure after issuance. Reuse/reconcile this approval; never automatically request another. */\nexport class EarlyWithdrawExecutionError extends Error {\n /** Present when submission returned a hash but receipt confirmation subsequently failed. */\n readonly hash?: Hash;\n readonly approval: ValidatedTimelockApproval;\n readonly callData: Hex;\n constructor(approval: ValidatedTimelockApproval, callData: Hex, cause: unknown, hash?: Hash) {\n super(\"Approval was issued but withdrawal submission did not complete. Reconcile before retrying.\", { cause });\n this.approval = approval;\n this.callData = callData;\n this.hash = hash;\n }\n}\n\nfunction encodeWithdrawal(withdrawal: EarlyWithdrawalCall): Hex {\n switch (withdrawal.method) {\n case \"withdraw\":\n return encodeFunctionData({ abi: symmioAbi, functionName: \"withdraw\", args: [withdrawal.amount] });\n case \"withdrawTo\":\n return encodeFunctionData({\n abi: symmioAbi,\n functionName: \"withdrawTo\",\n args: [withdrawal.recipient, withdrawal.amount],\n });\n case \"initiateWithdraw\":\n return encodeInitiateWithdrawCall(withdrawal);\n }\n}\n\n/**\n * Request one approval and submit one Core withdrawal, retaining the original account inside `_call`.\n * @param config - Provider-neutral SDK config.\n * @param parameters - Raw-unit withdrawal, deployment/provider, signer and normal write controls.\n * @returns Transaction hash and issued approval. Confirm the receipt; Core cooldown/finalization still apply.\n * @remarks Omitted `gasless` inherits the SDK execution policy; explicit `false` selects wallet submission.\n * @example const submitted = await earlyWithdraw(config, { account, withdrawal: { method: \"withdraw\", amount }, deadline });\n */\nexport async function earlyWithdraw(config: Config, parameters: EarlyWithdrawParameters): Promise<EarlyWithdrawResult> {\n const callData = encodeWithdrawal(parameters.withdrawal);\n const policy = await getTimelockPolicy(config, { ...parameters, selectors: [sliceHex(callData, 0, 4)] });\n if (!policy.ready)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_POLICY_REQUIRED\",\n \"Configure the withdrawal selector and wait for provider indexing before requesting approval.\",\n );\n await assertCoreTimelockWrapperUnprotected(config, {\n account: parameters.account,\n rootAccount: policy.rootAccount,\n chainId: parameters.chainId,\n callData,\n });\n // Verify the wallet route before spending an approval slot. Relay authorization\n // remains in the existing shared dispatcher; no automatic delayed fallback.\n const owner = (await getSubAccount(config, { chainId: parameters.chainId, account: policy.rootAccount })).owner;\n const wallet = await config.getWalletClient({ chainId: parameters.chainId, from: parameters.from ?? owner });\n if (!isAddressEqual(wallet.account.address, owner))\n throw new SymmError(\"validation\", \"TIMELOCK_OWNER_REQUIRED\", \"The owner wallet must execute the early withdrawal.\");\n if (wallet.chain?.id !== config.getChainConfig(parameters.chainId).chainId)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_WALLET_CHAIN_MISMATCH\",\n \"Switch the execution wallet to the selected chain.\",\n );\n const provider =\n parameters.provider ?? createHttpTimelockApprovalProvider({ baseUrl: config.getSolver(parameters).url });\n const approval = await requestTimelockApproval(config, {\n chainId: parameters.chainId,\n account: parameters.account,\n rootAccount: policy.rootAccount,\n capability: policy.capability,\n callData,\n deadline: parameters.deadline,\n from: parameters.approvalSigner ?? owner,\n provider,\n signal: parameters.signal,\n });\n try {\n await parameters.onApproval?.(approval);\n const hash = await executeTimelockOp(config, {\n ...parameters,\n from: owner,\n // Preserve the caller's option, including undefined, for the shared execution policy.\n gasless: parameters.gasless,\n account: policy.rootAccount,\n approvals: [approval.signedApproval],\n innerCallData: encodeTimelockedCoreCall(parameters.account, callData),\n });\n return { hash, rootAccount: policy.rootAccount, callData, approval };\n } catch (error) {\n throw new EarlyWithdrawExecutionError(approval, callData, error);\n }\n}\n\n/** One approval attempt only; even a global mutation retry default cannot repeat issuance. */\nexport function earlyWithdrawMutationOptions(config: Config) {\n return {\n mutationKey: [\"earlyWithdraw\"] as const,\n retry: false as const,\n mutationFn: (parameters: EarlyWithdrawParameters) => earlyWithdraw(config, parameters),\n };\n}\n"],"mappings":";;;;;;;;;;AAkDA,IAAa,IAAb,cAAiD,MAAM;CAErD;CACA;CACA;CACA,YAAY,GAAqC,GAAe,GAAgB,GAAa;EAI3F,AAHA,MAAM,8FAA8F,EAAE,SAAM,CAAC,GAC7G,KAAK,WAAW,GAChB,KAAK,WAAW,GAChB,KAAK,OAAO;CACd;AACF;AAEA,SAAS,EAAiB,GAAsC;CAC9D,QAAQ,EAAW,QAAnB;EACE,KAAK,YACH,OAAO,EAAmB;GAAE,KAAK;GAAW,cAAc;GAAY,MAAM,CAAC,EAAW,MAAM;EAAE,CAAC;EACnG,KAAK,cACH,OAAO,EAAmB;GACxB,KAAK;GACL,cAAc;GACd,MAAM,CAAC,EAAW,WAAW,EAAW,MAAM;EAChD,CAAC;EACH,KAAK,oBACH,OAAO,EAA2B,CAAU;CAChD;AACF;AAUA,eAAsB,EAAc,GAAgB,GAAmE;CACrH,IAAM,IAAW,EAAiB,EAAW,UAAU,GACjD,IAAS,MAAM,EAAkB,GAAQ;EAAE,GAAG;EAAY,WAAW,CAAC,EAAS,GAAU,GAAG,CAAC,CAAC;CAAE,CAAC;CACvG,IAAI,CAAC,EAAO,OACV,MAAM,IAAI,EACR,cACA,4BACA,8FACF;CACF,MAAM,EAAqC,GAAQ;EACjD,SAAS,EAAW;EACpB,aAAa,EAAO;EACpB,SAAS,EAAW;EACpB;CACF,CAAC;CAGD,IAAM,KAAS,MAAM,EAAc,GAAQ;EAAE,SAAS,EAAW;EAAS,SAAS,EAAO;CAAY,CAAC,GAAG,OACpG,IAAS,MAAM,EAAO,gBAAgB;EAAE,SAAS,EAAW;EAAS,MAAM,EAAW,QAAQ;CAAM,CAAC;CAC3G,IAAI,CAAC,EAAe,EAAO,QAAQ,SAAS,CAAK,GAC/C,MAAM,IAAI,EAAU,cAAc,2BAA2B,qDAAqD;CACpH,IAAI,EAAO,OAAO,OAAO,EAAO,eAAe,EAAW,OAAO,EAAE,SACjE,MAAM,IAAI,EACR,cACA,kCACA,oDACF;CACF,IAAM,IACJ,EAAW,YAAY,EAAmC,EAAE,SAAS,EAAO,UAAU,CAAU,EAAE,IAAI,CAAC,GACnG,IAAW,MAAM,EAAwB,GAAQ;EACrD,SAAS,EAAW;EACpB,SAAS,EAAW;EACpB,aAAa,EAAO;EACpB,YAAY,EAAO;EACnB;EACA,UAAU,EAAW;EACrB,MAAM,EAAW,kBAAkB;EACnC;EACA,QAAQ,EAAW;CACrB,CAAC;CACD,IAAI;EAWF,OAVA,MAAM,EAAW,aAAa,CAAQ,GAU/B;GAAE,MAAA,MATU,EAAkB,GAAQ;IAC3C,GAAG;IACH,MAAM;IAEN,SAAS,EAAW;IACpB,SAAS,EAAO;IAChB,WAAW,CAAC,EAAS,cAAc;IACnC,eAAe,EAAyB,EAAW,SAAS,CAAQ;GACtE,CAAC;GACc,aAAa,EAAO;GAAa;GAAU;EAAS;CACrE,SAAS,GAAO;EACd,MAAM,IAAI,EAA4B,GAAU,GAAU,CAAK;CACjE;AACF;AAGA,SAAgB,EAA6B,GAAgB;CAC3D,OAAO;EACL,aAAa,CAAC,eAAe;EAC7B,OAAO;EACP,aAAa,MAAwC,EAAc,GAAQ,CAAU;CACvF;AACF"}
@@ -0,0 +1,2 @@
1
+ export * from './early-withdraw.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/timelock/early-withdraw/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Hex } from 'viem';
2
+ import { SymmApiError } from '../shared/errors/symm-error.js';
3
+ /** Documented approval and instant-open error codes; unknown codes remain available verbatim. */
4
+ export type TimelockErrorCode = 3700 | 3701 | 3702 | 3703 | 3704 | 3705 | 3706 | 3707 | 3708 | 3709 | 3710 | 3711 | 3712 | 3713;
5
+ /** Normalized solver failure fields. `firstMissingSelector` is diagnostic only, not a recovery decision. */
6
+ export interface TimelockErrorDetails {
7
+ code: number | null;
8
+ knownCode?: TimelockErrorCode;
9
+ errorCategory: string;
10
+ errorMessage: string;
11
+ errorDetail?: string;
12
+ firstMissingSelector?: Hex;
13
+ }
14
+ /** Parse a solver error body (including asynchronous `error_code` bodies), never infer success from a missing/zero code. */
15
+ export declare function parseTimelockErrorDetails(value: unknown): TimelockErrorDetails;
16
+ /** Typed solver rejection retaining the complete wire body and HTTP diagnostics. No retry or fallback is implied. */
17
+ export declare class TimelockSolverError extends SymmApiError {
18
+ readonly name: string;
19
+ /** Typed code/category/message/detail, also preserved verbatim in `responseData`. */
20
+ readonly details: TimelockErrorDetails;
21
+ constructor(options: ConstructorParameters<typeof SymmApiError>[0]);
22
+ }
23
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/timelock/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,iGAAiG;AACjG,MAAM,MAAM,iBAAiB,GACzB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAET,4GAA4G;AAC5G,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,GAAG,CAAC;CAC5B;AAED,4HAA4H;AAC5H,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAe9E;AAED,qHAAqH;AACrH,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,SAAkB,IAAI,EAAE,MAAM,CAAyB;IACvD,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;gBAE3B,OAAO,EAAE,qBAAqB,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;CASnE"}
@@ -0,0 +1,29 @@
1
+ import { SymmApiError as e } from "../shared/errors/symm-error.js";
2
+ //#region src/timelock/errors.ts
3
+ function t(e) {
4
+ let t = typeof e == "object" && e ? e : {}, n = t.code ?? t.error_code, r = typeof n == "number" && Number.isSafeInteger(n) ? n : null, i = r !== null && r >= 3700 && r <= 3713 ? r : void 0, a = typeof t.error_detail == "string" ? t.error_detail : void 0;
5
+ return {
6
+ code: r,
7
+ knownCode: i,
8
+ errorCategory: typeof t.error_category == "string" ? t.error_category : "unknown",
9
+ errorMessage: typeof t.error_message == "string" ? t.error_message : "The solver request failed.",
10
+ errorDetail: a,
11
+ firstMissingSelector: r === 3711 ? a?.match(/\b0x[\da-fA-F]{8}\b/)?.[0] : void 0
12
+ };
13
+ }
14
+ var n = class extends e {
15
+ name = "TimelockSolverError";
16
+ details;
17
+ constructor(e) {
18
+ let n = t(e.responseData);
19
+ super({
20
+ ...e,
21
+ code: n.code === null ? e.code : String(n.code),
22
+ message: n.errorMessage
23
+ }), this.details = n;
24
+ }
25
+ };
26
+ //#endregion
27
+ export { n as TimelockSolverError, t as parseTimelockErrorDetails };
28
+
29
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","names":[],"sources":["../../src/timelock/errors.ts"],"sourcesContent":["import type { Hex } from \"viem\";\nimport { SymmApiError } from \"../shared/errors/symm-error\";\n\n/** Documented approval and instant-open error codes; unknown codes remain available verbatim. */\nexport type TimelockErrorCode =\n | 3700\n | 3701\n | 3702\n | 3703\n | 3704\n | 3705\n | 3706\n | 3707\n | 3708\n | 3709\n | 3710\n | 3711\n | 3712\n | 3713;\n\n/** Normalized solver failure fields. `firstMissingSelector` is diagnostic only, not a recovery decision. */\nexport interface TimelockErrorDetails {\n code: number | null;\n knownCode?: TimelockErrorCode;\n errorCategory: string;\n errorMessage: string;\n errorDetail?: string;\n firstMissingSelector?: Hex;\n}\n\n/** Parse a solver error body (including asynchronous `error_code` bodies), never infer success from a missing/zero code. */\nexport function parseTimelockErrorDetails(value: unknown): TimelockErrorDetails {\n const body = typeof value === \"object\" && value !== null ? (value as Record<string, unknown>) : {};\n const rawCode = body.code ?? body.error_code;\n const code = typeof rawCode === \"number\" && Number.isSafeInteger(rawCode) ? rawCode : null;\n const knownCode = code !== null && code >= 3700 && code <= 3713 ? (code as TimelockErrorCode) : undefined;\n const errorDetail = typeof body.error_detail === \"string\" ? body.error_detail : undefined;\n return {\n code,\n knownCode,\n errorCategory: typeof body.error_category === \"string\" ? body.error_category : \"unknown\",\n errorMessage: typeof body.error_message === \"string\" ? body.error_message : \"The solver request failed.\",\n errorDetail,\n firstMissingSelector:\n code === 3711 ? (errorDetail?.match(/\\b0x[\\da-fA-F]{8}\\b/)?.[0] as Hex | undefined) : undefined,\n };\n}\n\n/** Typed solver rejection retaining the complete wire body and HTTP diagnostics. No retry or fallback is implied. */\nexport class TimelockSolverError extends SymmApiError {\n override readonly name: string = \"TimelockSolverError\";\n /** Typed code/category/message/detail, also preserved verbatim in `responseData`. */\n readonly details: TimelockErrorDetails;\n\n constructor(options: ConstructorParameters<typeof SymmApiError>[0]) {\n const details = parseTimelockErrorDetails(options.responseData);\n super({\n ...options,\n code: details.code === null ? options.code : String(details.code),\n message: details.errorMessage,\n });\n this.details = details;\n }\n}\n"],"mappings":";;AA+BA,SAAgB,EAA0B,GAAsC;CAC9E,IAAM,IAAO,OAAO,KAAU,YAAY,IAAkB,IAAoC,CAAC,GAC3F,IAAU,EAAK,QAAQ,EAAK,YAC5B,IAAO,OAAO,KAAY,YAAY,OAAO,cAAc,CAAO,IAAI,IAAU,MAChF,IAAY,MAAS,QAAQ,KAAQ,QAAQ,KAAQ,OAAQ,IAA6B,KAAA,GAC1F,IAAc,OAAO,EAAK,gBAAiB,WAAW,EAAK,eAAe,KAAA;CAChF,OAAO;EACL;EACA;EACA,eAAe,OAAO,EAAK,kBAAmB,WAAW,EAAK,iBAAiB;EAC/E,cAAc,OAAO,EAAK,iBAAkB,WAAW,EAAK,gBAAgB;EAC5E;EACA,sBACE,MAAS,OAAQ,GAAa,MAAM,qBAAqB,IAAI,KAAyB,KAAA;CAC1F;AACF;AAGA,IAAa,IAAb,cAAyC,EAAa;CACpD,OAAiC;CAEjC;CAEA,YAAY,GAAwD;EAClE,IAAM,IAAU,EAA0B,EAAQ,YAAY;EAM9D,AALA,MAAM;GACJ,GAAG;GACH,MAAM,EAAQ,SAAS,OAAO,EAAQ,OAAO,OAAO,EAAQ,IAAI;GAChE,SAAS,EAAQ;EACnB,CAAC,GACD,KAAK,UAAU;CACjB;AACF"}
@@ -0,0 +1,31 @@
1
+ import { Address, Hash, Hex } from 'viem';
2
+ import { Config } from '../core/config/index.js';
3
+ import { GaslessWriteParameter, WriteContractParameter } from '../shared/types/properties.js';
4
+ import { SignedTimelockApproval } from '../symmio-contracts/account-layer/types.js';
5
+ import { TimelockAuthorization } from './execute-protected-call.js';
6
+ /** Exact per-call authorizations for an atomic batch. Use a fresh object for each attempt. */
7
+ export interface TimelockBatchAuthorization {
8
+ calls: readonly (TimelockAuthorization | undefined)[];
9
+ }
10
+ /** A partially authorized or submitted batch, retained for reconciliation. */
11
+ export declare class TimelockBatchExecutionError extends Error {
12
+ readonly approvals: readonly SignedTimelockApproval[];
13
+ readonly callDatas: readonly Hex[];
14
+ readonly hash?: Hash | undefined;
15
+ constructor(approvals: readonly SignedTimelockApproval[], callDatas: readonly Hex[], cause: unknown, hash?: Hash | undefined);
16
+ }
17
+ /** Reject re-entry before fetching any short-lived inputs. @internal */
18
+ export declare function assertTimelockBatchUnused(timelock: TimelockBatchAuthorization): void;
19
+ /** Return a submitted batch's approvals, calldata and transaction hash for receipt recovery. */
20
+ export declare function getTimelockBatchRecovery(authorization: TimelockBatchAuthorization): {
21
+ approvals: readonly SignedTimelockApproval[];
22
+ callDatas: readonly Hex[];
23
+ hash: Hash;
24
+ } | undefined;
25
+ /** @internal Authorize each protected Core call and submit one atomic AccountLayer batch. */
26
+ export declare function executeProtectedCoreBatch(config: Config, parameters: WriteContractParameter & GaslessWriteParameter & {
27
+ account: Address;
28
+ callDatas: readonly Hex[];
29
+ timelock: TimelockBatchAuthorization;
30
+ }): Promise<Hash>;
31
+ //# sourceMappingURL=execute-protected-batch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-protected-batch.d.ts","sourceRoot":"","sources":["../../src/timelock/execute-protected-batch.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,GAAG,EACT,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMhG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,EAML,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,8FAA8F;AAC9F,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,SAAS,CAAC,qBAAqB,GAAG,SAAS,CAAC,EAAE,CAAC;CACvD;AAED,8EAA8E;AAC9E,qBAAa,2BAA4B,SAAQ,KAAK;IAElD,QAAQ,CAAC,SAAS,EAAE,SAAS,sBAAsB,EAAE;IACrD,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,EAAE;IAElC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI;gBAHX,SAAS,EAAE,SAAS,sBAAsB,EAAE,EAC5C,SAAS,EAAE,SAAS,GAAG,EAAE,EAClC,KAAK,EAAE,OAAO,EACL,IAAI,CAAC,EAAE,IAAI,YAAA;CAIvB;AAQD,wEAAwE;AACxE,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,0BAA0B,GAAG,IAAI,CAgBpF;AAED,gGAAgG;AAChG,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,0BAA0B,GACxC;IAAE,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAAC,SAAS,EAAE,SAAS,GAAG,EAAE,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG,SAAS,CAKrG;AAED,6FAA6F;AAC7F,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,sBAAsB,GAChC,qBAAqB,GAAG;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,GAAG,EAAE,CAAC;IAC1B,QAAQ,EAAE,0BAA0B,CAAC;CACtC,GACF,OAAO,CAAC,IAAI,CAAC,CAuJf"}
@@ -0,0 +1,148 @@
1
+ import { accountLayerAbi as e } from "../symmio-contracts/abi/v0.8.6/account-layer.js";
2
+ import { SymmError as t } from "../shared/errors/symm-error.js";
3
+ import { requestTimelockApproval as n } from "./approval.js";
4
+ import { getSubAccount as r } from "../symmio-contracts/account-layer/actions/get-sub-account.js";
5
+ import { getGaslessAttemptStart as i, withGaslessAttemptStart as a } from "../gasless/dispatch/attempt-start.js";
6
+ import { resolveTimelockRootAccount as o } from "../symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js";
7
+ import { executeTimelockOp as s } from "../symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js";
8
+ import { getSelectorTimelock as c } from "../symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js";
9
+ import { assertProtectedGaslessDelegation as l, assertTimelockAuthorizationUnused as u, failTimelockAuthorization as d, reserveTimelockAuthorization as f, submitTimelockAuthorization as p } from "./execute-protected-call.js";
10
+ import { encodeFunctionData as m, isAddressEqual as h, keccak256 as g, sliceHex as _, zeroAddress as v } from "viem";
11
+ //#region src/timelock/execute-protected-batch.ts
12
+ var y = class extends Error {
13
+ approvals;
14
+ callDatas;
15
+ hash;
16
+ constructor(e, t, n, r) {
17
+ super("The protected batch did not complete; reconcile its approvals and transaction before retrying.", { cause: n }), this.approvals = e, this.callDatas = t, this.hash = r;
18
+ }
19
+ }, b = /* @__PURE__ */ new WeakMap();
20
+ function x(e) {
21
+ let n = b.get(e);
22
+ if (n?.status === "failed") throw n.error;
23
+ if (n?.status === "submitted") throw new y(n.approvals, n.callDatas, /* @__PURE__ */ Error("Transaction already submitted; reconcile its receipt."), n.hash);
24
+ if (n) throw new t("validation", "TIMELOCK_REQUEST_IN_PROGRESS", "This batch authorization is already being processed.");
25
+ }
26
+ function S(e) {
27
+ let t = b.get(e);
28
+ return t?.status === "submitted" ? {
29
+ approvals: t.approvals,
30
+ callDatas: t.callDatas,
31
+ hash: t.hash
32
+ } : void 0;
33
+ }
34
+ async function C(S, C) {
35
+ let { account: w, chainId: T, timelock: E } = C, D = a(C.gasless), O = [...C.callDatas], k = [...E.calls];
36
+ if (x(E), O.length !== k.length || O.length === 0) throw new t("validation", "TIMELOCK_BATCH_MISMATCH", "Provide one authorization entry for each batch call.");
37
+ let A = await o(S, {
38
+ account: w,
39
+ chainId: T
40
+ }), j = (await r(S, {
41
+ account: A,
42
+ chainId: T
43
+ })).owner, M = await S.getWalletClient({
44
+ chainId: T,
45
+ from: C.from ?? j
46
+ }), N = !h(M.account.address, j);
47
+ if (N) {
48
+ let e = typeof C.gasless == "boolean" ? { enabled: C.gasless } : C.gasless;
49
+ if (e?.enabled !== !0 || e.fallback === "wallet") throw new t("validation", "TIMELOCK_OWNER_REQUIRED", "A delegated signer requires explicit gasless execution without wallet fallback.");
50
+ }
51
+ if (M.chain?.id !== S.getChainConfig(T).chainId) throw new t("validation", "TIMELOCK_WALLET_CHAIN_MISMATCH", "Switch the execution wallet to the selected chain.");
52
+ let P = await Promise.all(O.map((e) => c(S, {
53
+ account: A,
54
+ chainId: T,
55
+ selector: _(e, 0, 4)
56
+ }))), F = m({
57
+ abi: e,
58
+ functionName: "_call",
59
+ args: [w, O]
60
+ });
61
+ if (N && await l(S, {
62
+ chainId: T,
63
+ root: A,
64
+ signer: M.account.address,
65
+ selector: _(F, 0, 4),
66
+ gasless: C.gasless
67
+ }), !h((await c(S, {
68
+ account: A,
69
+ chainId: T,
70
+ selector: _(F, 0, 4)
71
+ })).unlocker, v)) throw new t("validation", "TIMELOCK_BATCH_OUTER_UNSUPPORTED", "The outer _call selector is timelocked; authorize it separately before requesting batch approvals.");
72
+ for (let e = 0; e < O.length; e++) {
73
+ let n = P[e], r = k[e];
74
+ if (h(n.unlocker, v)) {
75
+ if (r) throw new t("validation", "TIMELOCK_BATCH_MISMATCH", "Do not provide an approval for an unlocked call.");
76
+ continue;
77
+ }
78
+ if (!r) throw new t("validation", "TIMELOCK_APPROVAL_REQUIRED", "Every locked batch call requires its own authorization.");
79
+ if ("approval" in r) {
80
+ let i = r.approval.approval;
81
+ if (!h(i.account, A) || !h(i.unlocker, n.unlocker) || i.callDataHash.toLowerCase() !== g(O[e]).toLowerCase()) throw new t("validation", "TIMELOCK_APPROVAL_MISMATCH", "The approval does not match its batch call.");
82
+ } else if (!h(r.capability.unlocker, n.unlocker)) throw new t("validation", "TIMELOCK_UNLOCKER_MISMATCH", "The configured selector unlocker does not match the approval provider.");
83
+ }
84
+ if (b.has(E)) throw new t("validation", "TIMELOCK_REQUEST_IN_PROGRESS", "This batch authorization is already being processed.");
85
+ let I = k.filter((e) => e !== void 0);
86
+ if (new Set(I).size !== I.length) throw new t("validation", "TIMELOCK_BATCH_MISMATCH", "Use a distinct authorization object for each batch call.");
87
+ for (let e of I) u(e);
88
+ for (let e of I) f(e);
89
+ b.set(E, { status: "pending" });
90
+ let L = [];
91
+ try {
92
+ for (let e = 0; e < O.length; e++) {
93
+ let t = k[e];
94
+ if (t) if ("approval" in t) L.push(t.approval);
95
+ else {
96
+ let r = await n(S, {
97
+ chainId: T,
98
+ account: w,
99
+ rootAccount: A,
100
+ callData: O[e],
101
+ capability: t.capability,
102
+ provider: t.provider,
103
+ deadline: t.deadline,
104
+ from: t.approvalSigner ?? j,
105
+ signal: t.signal
106
+ });
107
+ L.push(r.signedApproval), await t.onApproval?.(r);
108
+ }
109
+ }
110
+ let e = await s(S, {
111
+ account: A,
112
+ chainId: T,
113
+ from: C.from ?? j,
114
+ gasless: N ? a({
115
+ ...D,
116
+ enabled: !0,
117
+ fallback: "error"
118
+ }, i(D)) : D,
119
+ simulateBeforeWrite: C.simulateBeforeWrite,
120
+ approvals: L,
121
+ innerCallData: F
122
+ });
123
+ b.set(E, {
124
+ status: "submitted",
125
+ approvals: L,
126
+ callDatas: O,
127
+ hash: e
128
+ });
129
+ let t = 0;
130
+ for (let n = 0; n < k.length; n++) {
131
+ let r = k[n];
132
+ r && p(r, L[t++], O[n], e);
133
+ }
134
+ return e;
135
+ } catch (e) {
136
+ let t = L.length ? new y(L, O, e) : e;
137
+ b.set(E, {
138
+ status: "failed",
139
+ error: t
140
+ });
141
+ for (let e of I) d(e, t);
142
+ throw t;
143
+ }
144
+ }
145
+ //#endregion
146
+ export { y as TimelockBatchExecutionError, x as assertTimelockBatchUnused, C as executeProtectedCoreBatch, S as getTimelockBatchRecovery };
147
+
148
+ //# sourceMappingURL=execute-protected-batch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-protected-batch.js","names":[],"sources":["../../src/timelock/execute-protected-batch.ts"],"sourcesContent":["import {\n encodeFunctionData,\n isAddressEqual,\n keccak256,\n sliceHex,\n zeroAddress,\n type Address,\n type Hash,\n type Hex,\n} from \"viem\";\nimport type { Config } from \"../core/config\";\nimport { getGaslessAttemptStart, withGaslessAttemptStart } from \"../gasless/dispatch/attempt-start\";\nimport { SymmError } from \"../shared/errors/symm-error\";\nimport type { GaslessWriteParameter, WriteContractParameter } from \"../shared/types/properties\";\nimport { accountLayerAbi } from \"../symmio-contracts/abi/v0.8.6/account-layer\";\nimport { getSubAccount } from \"../symmio-contracts/account-layer/actions/get-sub-account\";\nimport { executeTimelockOp } from \"../symmio-contracts/account-layer/execute-timelock-op\";\nimport { getSelectorTimelock } from \"../symmio-contracts/account-layer/get-selector-timelock\";\nimport { resolveTimelockRootAccount } from \"../symmio-contracts/account-layer/resolve-timelock-root-account\";\nimport type { SignedTimelockApproval } from \"../symmio-contracts/account-layer/types\";\nimport { requestTimelockApproval } from \"./approval\";\nimport {\n assertProtectedGaslessDelegation,\n assertTimelockAuthorizationUnused,\n failTimelockAuthorization,\n reserveTimelockAuthorization,\n submitTimelockAuthorization,\n type TimelockAuthorization,\n} from \"./execute-protected-call\";\n\n/** Exact per-call authorizations for an atomic batch. Use a fresh object for each attempt. */\nexport interface TimelockBatchAuthorization {\n calls: readonly (TimelockAuthorization | undefined)[];\n}\n\n/** A partially authorized or submitted batch, retained for reconciliation. */\nexport class TimelockBatchExecutionError extends Error {\n constructor(\n readonly approvals: readonly SignedTimelockApproval[],\n readonly callDatas: readonly Hex[],\n cause: unknown,\n readonly hash?: Hash,\n ) {\n super(\"The protected batch did not complete; reconcile its approvals and transaction before retrying.\", { cause });\n }\n}\n\ntype BatchAttempt =\n | { status: \"pending\" }\n | { status: \"failed\"; error: unknown }\n | { status: \"submitted\"; approvals: readonly SignedTimelockApproval[]; callDatas: readonly Hex[]; hash: Hash };\nconst batchAttempts = new WeakMap<TimelockBatchAuthorization, BatchAttempt>();\n\n/** Reject re-entry before fetching any short-lived inputs. @internal */\nexport function assertTimelockBatchUnused(timelock: TimelockBatchAuthorization): void {\n const previous = batchAttempts.get(timelock);\n if (previous?.status === \"failed\") throw previous.error;\n if (previous?.status === \"submitted\")\n throw new TimelockBatchExecutionError(\n previous.approvals,\n previous.callDatas,\n new Error(\"Transaction already submitted; reconcile its receipt.\"),\n previous.hash,\n );\n if (previous)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_REQUEST_IN_PROGRESS\",\n \"This batch authorization is already being processed.\",\n );\n}\n\n/** Return a submitted batch's approvals, calldata and transaction hash for receipt recovery. */\nexport function getTimelockBatchRecovery(\n authorization: TimelockBatchAuthorization,\n): { approvals: readonly SignedTimelockApproval[]; callDatas: readonly Hex[]; hash: Hash } | undefined {\n const attempt = batchAttempts.get(authorization);\n return attempt?.status === \"submitted\"\n ? { approvals: attempt.approvals, callDatas: attempt.callDatas, hash: attempt.hash }\n : undefined;\n}\n\n/** @internal Authorize each protected Core call and submit one atomic AccountLayer batch. */\nexport async function executeProtectedCoreBatch(\n config: Config,\n parameters: WriteContractParameter &\n GaslessWriteParameter & {\n account: Address;\n callDatas: readonly Hex[];\n timelock: TimelockBatchAuthorization;\n },\n): Promise<Hash> {\n const { account, chainId, timelock } = parameters;\n const gasless = withGaslessAttemptStart(parameters.gasless);\n const callDatas = [...parameters.callDatas];\n const authorizations = [...timelock.calls];\n assertTimelockBatchUnused(timelock);\n if (callDatas.length !== authorizations.length || callDatas.length === 0)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_BATCH_MISMATCH\",\n \"Provide one authorization entry for each batch call.\",\n );\n const root = await resolveTimelockRootAccount(config, { account, chainId });\n const owner = (await getSubAccount(config, { account: root, chainId })).owner;\n const wallet = await config.getWalletClient({ chainId, from: parameters.from ?? owner });\n const delegated = !isAddressEqual(wallet.account.address, owner);\n if (delegated) {\n const gasless = typeof parameters.gasless === \"boolean\" ? { enabled: parameters.gasless } : parameters.gasless;\n if (gasless?.enabled !== true || gasless.fallback === \"wallet\")\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_OWNER_REQUIRED\",\n \"A delegated signer requires explicit gasless execution without wallet fallback.\",\n );\n }\n if (wallet.chain?.id !== config.getChainConfig(chainId).chainId)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_WALLET_CHAIN_MISMATCH\",\n \"Switch the execution wallet to the selected chain.\",\n );\n const policies = await Promise.all(\n callDatas.map((data) => getSelectorTimelock(config, { account: root, chainId, selector: sliceHex(data, 0, 4) })),\n );\n const innerCallData = encodeFunctionData({ abi: accountLayerAbi, functionName: \"_call\", args: [account, callDatas] });\n if (delegated)\n await assertProtectedGaslessDelegation(config, {\n chainId,\n root,\n signer: wallet.account.address,\n selector: sliceHex(innerCallData, 0, 4),\n gasless: parameters.gasless,\n });\n const outerPolicy = await getSelectorTimelock(config, {\n account: root,\n chainId,\n selector: sliceHex(innerCallData, 0, 4),\n });\n if (!isAddressEqual(outerPolicy.unlocker, zeroAddress))\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_BATCH_OUTER_UNSUPPORTED\",\n \"The outer _call selector is timelocked; authorize it separately before requesting batch approvals.\",\n );\n for (let i = 0; i < callDatas.length; i++) {\n const policy = policies[i]!;\n const authorization = authorizations[i];\n if (isAddressEqual(policy.unlocker, zeroAddress)) {\n if (authorization)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_BATCH_MISMATCH\",\n \"Do not provide an approval for an unlocked call.\",\n );\n continue;\n }\n if (!authorization)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_APPROVAL_REQUIRED\",\n \"Every locked batch call requires its own authorization.\",\n );\n if (\"approval\" in authorization) {\n const approval = authorization.approval.approval;\n if (\n !isAddressEqual(approval.account, root) ||\n !isAddressEqual(approval.unlocker, policy.unlocker) ||\n approval.callDataHash.toLowerCase() !== keccak256(callDatas[i]!).toLowerCase()\n )\n throw new SymmError(\"validation\", \"TIMELOCK_APPROVAL_MISMATCH\", \"The approval does not match its batch call.\");\n } else if (!isAddressEqual(authorization.capability.unlocker, policy.unlocker)) {\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_UNLOCKER_MISMATCH\",\n \"The configured selector unlocker does not match the approval provider.\",\n );\n }\n }\n if (batchAttempts.has(timelock))\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_REQUEST_IN_PROGRESS\",\n \"This batch authorization is already being processed.\",\n );\n const present = authorizations.filter((item): item is TimelockAuthorization => item !== undefined);\n if (new Set(present).size !== present.length)\n throw new SymmError(\n \"validation\",\n \"TIMELOCK_BATCH_MISMATCH\",\n \"Use a distinct authorization object for each batch call.\",\n );\n for (const authorization of present) assertTimelockAuthorizationUnused(authorization);\n for (const authorization of present) reserveTimelockAuthorization(authorization);\n batchAttempts.set(timelock, { status: \"pending\" });\n const approvals: SignedTimelockApproval[] = [];\n try {\n for (let i = 0; i < callDatas.length; i++) {\n const authorization = authorizations[i];\n if (!authorization) continue;\n if (\"approval\" in authorization) {\n approvals.push(authorization.approval);\n } else {\n const issued = await requestTimelockApproval(config, {\n chainId,\n account,\n rootAccount: root,\n callData: callDatas[i]!,\n capability: authorization.capability,\n provider: authorization.provider,\n deadline: authorization.deadline,\n from: authorization.approvalSigner ?? owner,\n signal: authorization.signal,\n });\n approvals.push(issued.signedApproval);\n await authorization.onApproval?.(issued);\n }\n }\n const hash = await executeTimelockOp(config, {\n account: root,\n chainId,\n from: parameters.from ?? owner,\n gasless: delegated\n ? withGaslessAttemptStart({ ...gasless, enabled: true, fallback: \"error\" }, getGaslessAttemptStart(gasless))\n : gasless,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n approvals,\n innerCallData,\n });\n batchAttempts.set(timelock, { status: \"submitted\", approvals, callDatas, hash });\n let approvalIndex = 0;\n for (let i = 0; i < authorizations.length; i++) {\n const authorization = authorizations[i];\n if (authorization) submitTimelockAuthorization(authorization, approvals[approvalIndex++]!, callDatas[i]!, hash);\n }\n return hash;\n } catch (error) {\n const failure = approvals.length ? new TimelockBatchExecutionError(approvals, callDatas, error) : error;\n batchAttempts.set(timelock, { status: \"failed\", error: failure });\n for (const authorization of present) failTimelockAuthorization(authorization, failure);\n throw failure;\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,68 @@
1
+ import { Address, Hash, Hex } from 'viem';
2
+ import { Config } from '../core/config/index.js';
3
+ import { GaslessWriteParameter, WriteContractParameter } from '../shared/types/properties.js';
4
+ import { SignedTimelockApproval } from '../symmio-contracts/account-layer/types.js';
5
+ import { TimelockApprovalCapability, TimelockApprovalProvider, ValidatedTimelockApproval } from './approval.js';
6
+ /** Optional one-attempt authorization for a protected operation. Create a new object for a deliberate new attempt. */
7
+ export type TimelockAuthorization = {
8
+ approval: SignedTimelockApproval;
9
+ } | {
10
+ capability: TimelockApprovalCapability;
11
+ provider: TimelockApprovalProvider;
12
+ deadline: bigint;
13
+ approvalSigner?: Address;
14
+ signal?: AbortSignal;
15
+ /** Persist the approval before submission. Throwing prevents submission. */
16
+ onApproval?: (approval: ValidatedTimelockApproval) => void | Promise<void>;
17
+ };
18
+ /** An issued approval is retained when its transaction could not be submitted. */
19
+ export declare class TimelockExecutionError extends Error {
20
+ readonly approval: SignedTimelockApproval;
21
+ readonly callData: Hex;
22
+ readonly hash?: Hash;
23
+ constructor(approval: SignedTimelockApproval, callData: Hex, cause: unknown, hash?: Hash);
24
+ }
25
+ /** Return the approval and submitted transaction for a one-attempt authorization, when available. */
26
+ export declare function getTimelockExecutionRecovery(authorization: TimelockAuthorization): {
27
+ approval: SignedTimelockApproval;
28
+ callData: Hex;
29
+ hash: Hash;
30
+ } | undefined;
31
+ /** @internal Check that a caller-owned authorization has not been attempted. */
32
+ export declare function assertTimelockAuthorizationUnused(authorization: TimelockAuthorization): void;
33
+ /** @internal Reserve synchronously after checking all authorizations. */
34
+ export declare function reserveTimelockAuthorization(authorization: TimelockAuthorization): void;
35
+ /** @internal Preserve a failed attempt across automatic retries. */
36
+ export declare function failTimelockAuthorization(authorization: TimelockAuthorization, error: unknown): void;
37
+ /** @internal Record a submitted transaction for receipt reconciliation. */
38
+ export declare function submitTimelockAuthorization(authorization: TimelockAuthorization, approval: SignedTimelockApproval, callData: Hex, hash: Hash): void;
39
+ /** @internal Verify delegated gasless execution before consuming an approval slot. */
40
+ export declare function assertProtectedGaslessDelegation(config: Config, parameters: {
41
+ chainId?: number;
42
+ root: Address;
43
+ signer: Address;
44
+ selector: Hex;
45
+ gasless: GaslessWriteParameter["gasless"];
46
+ }): Promise<void>;
47
+ /** Inputs for a single explicitly authorized Core or AccountLayer operation. */
48
+ export type ExecuteProtectedCallParameters = WriteContractParameter & GaslessWriteParameter & {
49
+ account: Address;
50
+ callData: Hex;
51
+ target: "core" | "account-layer";
52
+ timelock: TimelockAuthorization;
53
+ };
54
+ /**
55
+ * Execute one exact protected call. The caller chooses its provider and raw calldata.
56
+ * Core calls retain the original account inside the AccountLayer wrapper.
57
+ * @param config - SDK configuration and injected clients.
58
+ * @param parameters - Account, raw calldata, target and one-attempt authorization.
59
+ * @returns Submitted transaction hash; wait for the receipt to confirm execution.
60
+ */
61
+ export declare function executeProtectedCall(config: Config, parameters: ExecuteProtectedCallParameters): Promise<Hash>;
62
+ /** TanStack mutation options with automatic retries disabled. */
63
+ export declare function executeProtectedCallMutationOptions(config: Config): {
64
+ mutationKey: readonly ["executeProtectedCall"];
65
+ retry: false;
66
+ mutationFn: (parameters: ExecuteProtectedCallParameters) => Promise<`0x${string}`>;
67
+ };
68
+ //# sourceMappingURL=execute-protected-call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-protected-call.d.ts","sourceRoot":"","sources":["../../src/timelock/execute-protected-call.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,146 @@
1
+ import { SymmError as e } from "../shared/errors/symm-error.js";
2
+ import { encodeTimelockedCoreCall as t, requestTimelockApproval as n } from "./approval.js";
3
+ import { getSubAccount as r } from "../symmio-contracts/account-layer/actions/get-sub-account.js";
4
+ import { getGaslessAttemptStart as i, withGaslessAttemptStart as a } from "../gasless/dispatch/attempt-start.js";
5
+ import { getIsDelegationActive as o } from "../symmio-contracts/instant-layer/actions/get-is-delegation-active.js";
6
+ import { resolveTimelockRootAccount as s } from "../symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js";
7
+ import { executeTimelockOp as c } from "../symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js";
8
+ import { getSelectorTimelock as l } from "../symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js";
9
+ import { assertCoreTimelockWrapperUnprotected as u } from "./protected-call-preflight.js";
10
+ import { isAddressEqual as d, keccak256 as f, sliceHex as p } from "viem";
11
+ //#region src/timelock/execute-protected-call.ts
12
+ var m = class extends Error {
13
+ approval;
14
+ callData;
15
+ hash;
16
+ constructor(e, t, n, r) {
17
+ super("A timelock approval was issued but execution did not complete. Reconcile it before retrying.", { cause: n }), this.approval = e, this.callData = t, this.hash = r;
18
+ }
19
+ }, h = /* @__PURE__ */ new WeakMap();
20
+ function g(e) {
21
+ let t = h.get(e);
22
+ return t?.status === "submitted" ? {
23
+ approval: t.approval,
24
+ callData: t.callData,
25
+ hash: t.hash
26
+ } : void 0;
27
+ }
28
+ function _(t) {
29
+ let n = h.get(t);
30
+ if (n) throw n.status === "failed" ? n.error : n.status === "submitted" ? new m(n.approval, n.callData, /* @__PURE__ */ Error("A transaction has already been submitted; reconcile its receipt."), n.hash) : new e("validation", "TIMELOCK_REQUEST_IN_PROGRESS", "This authorization is already being processed.");
31
+ }
32
+ function v(e) {
33
+ _(e), h.set(e, { status: "pending" });
34
+ }
35
+ function y(e, t) {
36
+ h.set(e, {
37
+ status: "failed",
38
+ error: t
39
+ });
40
+ }
41
+ function b(e, t, n, r) {
42
+ h.set(e, {
43
+ status: "submitted",
44
+ approval: t,
45
+ callData: n,
46
+ hash: r
47
+ });
48
+ }
49
+ async function x(t, n) {
50
+ let r = t.getChainConfig(n.chainId).chainId, i = typeof n.gasless == "object" ? n.gasless.account ?? n.root : n.root;
51
+ if (!d(i, n.root)) throw new e("validation", "TIMELOCK_GASLESS_ACCOUNT_MISMATCH", "A delegated protected operation must execute under its root account.");
52
+ if (!await o(t, {
53
+ chainId: r,
54
+ account: i,
55
+ delegate: n.signer,
56
+ selector: n.selector
57
+ })) throw new e("validation", "GASLESS_SIGNER_NOT_DELEGATED", `The signer lacks delegation for ${n.selector}.`);
58
+ }
59
+ async function S(o, h) {
60
+ let { account: g, chainId: S, callData: C, timelock: w } = h, T = a(h.gasless);
61
+ _(w);
62
+ let E = await s(o, {
63
+ account: g,
64
+ chainId: S
65
+ }), D = await l(o, {
66
+ account: E,
67
+ chainId: S,
68
+ selector: p(C, 0, 4)
69
+ });
70
+ h.target === "core" && await u(o, {
71
+ account: g,
72
+ rootAccount: E,
73
+ chainId: S,
74
+ callData: C
75
+ });
76
+ let O = (await r(o, {
77
+ account: E,
78
+ chainId: S
79
+ })).owner, k = await o.getWalletClient({
80
+ chainId: S,
81
+ from: h.from ?? O
82
+ }), A = !d(k.account.address, O);
83
+ if (A) {
84
+ let t = typeof h.gasless == "boolean" ? { enabled: h.gasless } : h.gasless;
85
+ if (t?.enabled !== !0 || t.fallback === "wallet") throw new e("validation", "TIMELOCK_OWNER_REQUIRED", "A delegated signer requires explicit gasless execution without wallet fallback.");
86
+ }
87
+ if (k.chain?.id !== o.getChainConfig(S).chainId) throw new e("validation", "TIMELOCK_WALLET_CHAIN_MISMATCH", "Switch the execution wallet to the selected chain.");
88
+ A && await x(o, {
89
+ chainId: S,
90
+ root: E,
91
+ signer: k.account.address,
92
+ selector: p(h.target === "core" ? t(g, C) : C, 0, 4),
93
+ gasless: h.gasless
94
+ }), v(w);
95
+ try {
96
+ let r, s;
97
+ if ("approval" in w) {
98
+ if (r = w.approval, !d(r.approval.account, E) || !d(r.approval.unlocker, D.unlocker) || r.approval.callDataHash.toLowerCase() !== f(C).toLowerCase()) throw new e("validation", "TIMELOCK_APPROVAL_MISMATCH", "The approval does not match this account, unlocker, or operation.");
99
+ } else {
100
+ if (!d(D.unlocker, w.capability.unlocker)) throw new e("validation", "TIMELOCK_UNLOCKER_MISMATCH", "The configured selector unlocker does not match the approval provider.");
101
+ s = await n(o, {
102
+ chainId: S,
103
+ account: g,
104
+ rootAccount: E,
105
+ callData: C,
106
+ capability: w.capability,
107
+ provider: w.provider,
108
+ deadline: w.deadline,
109
+ from: w.approvalSigner ?? O,
110
+ signal: w.signal
111
+ }), r = s.signedApproval;
112
+ }
113
+ try {
114
+ s && "onApproval" in w && await w.onApproval?.(s);
115
+ let e = await c(o, {
116
+ account: E,
117
+ chainId: S,
118
+ from: h.from ?? O,
119
+ gasless: A ? a({
120
+ ...T,
121
+ enabled: !0,
122
+ fallback: "error"
123
+ }, i(T)) : T,
124
+ simulateBeforeWrite: h.simulateBeforeWrite,
125
+ approvals: [r],
126
+ innerCallData: h.target === "core" ? t(g, C) : C
127
+ });
128
+ return b(w, r, C, e), e;
129
+ } catch (e) {
130
+ throw new m(r, C, e);
131
+ }
132
+ } catch (e) {
133
+ throw y(w, e), e;
134
+ }
135
+ }
136
+ function C(e) {
137
+ return {
138
+ mutationKey: ["executeProtectedCall"],
139
+ retry: !1,
140
+ mutationFn: (t) => S(e, t)
141
+ };
142
+ }
143
+ //#endregion
144
+ export { m as TimelockExecutionError, x as assertProtectedGaslessDelegation, _ as assertTimelockAuthorizationUnused, S as executeProtectedCall, C as executeProtectedCallMutationOptions, y as failTimelockAuthorization, g as getTimelockExecutionRecovery, v as reserveTimelockAuthorization, b as submitTimelockAuthorization };
145
+
146
+ //# sourceMappingURL=execute-protected-call.js.map