@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
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/chains/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CA4J3D,CAAC"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/chains/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAiK3D,CAAC"}
@@ -4,6 +4,7 @@ var t = {
4
4
  [e.BASE]: {
5
5
  chainId: e.BASE,
6
6
  contractsVersion: "0.8.5",
7
+ timelockSupported: !1,
7
8
  addresses: {
8
9
  symmioAddress: "0x91Cf2D8Ed503EC52768999aA6D8DBeA6e52dbe43",
9
10
  instantLayerAddress: "0x0825435285ac0E5c02c7a7c443F631f3e07fE375",
@@ -35,8 +36,7 @@ var t = {
35
36
  muon: { urls: [
36
37
  "https://muon-oracle1.rasa.capital/v1/",
37
38
  "https://muon-oracle2.rasa.capital/v1/",
38
- "https://muon-oracle3.rasa.capital/v1/",
39
- "https://muon-oracle4.rasa.capital/v1/"
39
+ "https://muon-oracle3.rasa.capital/v1/"
40
40
  ] }
41
41
  },
42
42
  [e.ARBITRUM]: {
@@ -74,7 +74,7 @@ var t = {
74
74
  url: "wss://notification.rasa.capital/ws/v1/subscribe",
75
75
  channel: "Arbitrum_Solver-Low-Cap_Production",
76
76
  protocol: "enigma",
77
- searchUrl: "https://notification.rasa.capital/notification"
77
+ searchUrl: "https://notification.rasa.capital"
78
78
  },
79
79
  capabilities: {
80
80
  groupClose: !0,
@@ -90,8 +90,7 @@ var t = {
90
90
  muon: { urls: [
91
91
  "https://muon-oracle1.rasa.capital/v1/",
92
92
  "https://muon-oracle2.rasa.capital/v1/",
93
- "https://muon-oracle3.rasa.capital/v1/",
94
- "https://muon-oracle4.rasa.capital/v1/"
93
+ "https://muon-oracle3.rasa.capital/v1/"
95
94
  ] },
96
95
  listing: { url: "https://listing85.enigma.bz" },
97
96
  inventory: { url: "https://inventory85.enigma.bz" }
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","names":[],"sources":["../../../src/core/chains/registry.ts"],"sourcesContent":["import { SymmioSupportedChainId } from \"./supported-chains\";\nimport type { SymmioChainConfig } from \"./types\";\n\n/**\n * Built-in SYMMIO deployment configs keyed by chain ID.\n *\n * @internal\n */\nexport const CHAIN_CONFIGS: Record<number, SymmioChainConfig> = {\n [SymmioSupportedChainId.BASE]: {\n chainId: SymmioSupportedChainId.BASE,\n contractsVersion: \"0.8.5\",\n addresses: {\n symmioAddress: \"0x91Cf2D8Ed503EC52768999aA6D8DBeA6e52dbe43\",\n instantLayerAddress: \"0x0825435285ac0E5c02c7a7c443F631f3e07fE375\",\n accountLayerAddress: \"0x56caf00c6C5cB5478570Bb23807B9d1D697863DC\",\n affiliatesAddress: \"0x45Eecd7B4f442388ACD90467E423A5CAAC3a9C3f\",\n collateralAddress: \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\", // USDC on Base\n collateralDecimals: 6,\n },\n // Rasa — Base's real solver. Rasa's API shares Enigma's paths for the\n // shared reads (contract-symbols, funding, locked params, error codes,\n // notional_cap/{id}, instant lists), so those work today; the diverging\n // endpoints (`/instant_trade/open|close` execution, `/estimated-price`,\n // `/notional_cap` list) return 404 until per-kind dispatch is wired into\n // the solver actions.\n // No `tpsl` block: Base COH deployment not confirmed yet — absence marks\n // conditional orders unsupported (add the block when the vendor provides it).\n solvers: {\n rasa: {\n name: \"Rasa\",\n address: \"0x81631953E0C093e72935C1CAA4C7D519B2A0E407\",\n // Staging URL — swap to the production solver URL when published.\n url: \"https://stage-archon.rasa.capital\",\n // Rasa's own position-state stream — real Base data. No `searchUrl`: the\n // rasa protocol serves notification history from the solver's own\n // position-state endpoint (via `searchNotifications`), not a REST service.\n notifications: {\n url: \"wss://stage-archon.rasa.capital/ws/position-state-ws3\",\n protocol: \"rasa\",\n },\n // Majors support LIMIT orders (pending open at a user-set price).\n capabilities: { limitOrder: true },\n },\n },\n defaultSolverId: \"rasa\",\n // Base's own analytics and events subgraphs (Goldsky) — real, production endpoints.\n subgraphs: {\n analytics:\n \"https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/base_analytics/latest/gn\",\n events: \"https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/base_events/latest/gn\",\n },\n // Rasa serves majors and has no mark-price feed of its own — no REST mark\n // price, no mark-price WebSocket, no index price. Binance USD-M Futures is\n // the price source, matching how the reference UI configures this solver.\n //\n // Both URLs are public constants but stay in config on purpose: they are the\n // escape hatch for Binance's regional restrictions, so an integrator whose\n // users are blocked repoints them at their own proxy with no SDK change.\n priceService: {\n type: \"binance\",\n /** USD-M Futures REST root. The client appends `/fapi/v1/…`. */\n url: \"https://fapi.binance.com\",\n /**\n * All-symbols mark-price broadcast, 1 push/sec.\n *\n * The `/market/ws/` prefix is deliberate and was verified against the live\n * endpoint: Binance's *documented* `/ws/<stream>` form (and\n * `/stream?streams=`) connect and then never push a frame, which would ship\n * a feed that reports `open` and silently never ticks.\n */\n wsUrl: \"wss://fstream.binance.com/market/ws/!markPrice@arr@1s\",\n },\n // Muon is deployment-agnostic: one `symmio` app on one shared gateway set\n // serves every SYMMIO deployment, and the per-deployment input is the\n // `symmio` request param (this chain's diamond, from `addresses` above).\n // So these are Base's real gateways, not another chain's stand-in.\n muon: {\n urls: [\n \"https://muon-oracle1.rasa.capital/v1/\",\n \"https://muon-oracle2.rasa.capital/v1/\",\n \"https://muon-oracle3.rasa.capital/v1/\",\n \"https://muon-oracle4.rasa.capital/v1/\",\n ],\n },\n },\n\n [SymmioSupportedChainId.ARBITRUM]: {\n chainId: SymmioSupportedChainId.ARBITRUM,\n contractsVersion: \"0.8.6\",\n /**\n * The production GaslessQ deployment, paired with the InstantLayer below\n * (the GaslessLayer's `instantLayer()` returns it). There is deliberately\n * no `execution` block: writes keep using the connected wallet until a call\n * passes `gasless` or the consumer sets `execution.mode`.\n */\n gasless: {\n url: \"https://gaslessq.symmio.foundation\",\n /** Vendor-assigned instance key. Keep it verbatim: the gateway routes on it. */\n protocolInstance: \"arbitrum-42161-vibe\",\n gaslessLayerAddress: \"0x8347953D80037b8d82827246f37EC7442AD188B4\",\n /**\n * Declared ahead of the gateway's WebSocket rollout. Until the gateway\n * accepts the handshake, a status wait stops dialing after a few failed\n * attempts and polls over HTTP, so streaming starts without an SDK change\n * once operators enable it.\n */\n statusStream: { enabled: true },\n },\n addresses: {\n symmioAddress: \"0x57331027091994FCb9c5Aec48ea92cEf0a93CF6A\",\n instantLayerAddress: \"0xf4e8b150fdc756aca578f5a05811c1998c65c829\",\n accountLayerAddress: \"0x573310d1D6ec18cB21E1aB949414470D9bf5c24E\",\n affiliatesAddress: \"0x58bB5Bdc279321507DfB7AB54B9e7EF3DdA6E24D\",\n collateralAddress: \"0xaf88d065e77c8cC2239327C5EDb3A432268e5831\",\n collateralDecimals: 6,\n },\n subgraphs: {\n analytics:\n \"https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/arbitrum-vibe-mainnet-analytics/latest/gn\",\n events:\n \"https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/arbitrum-vibe-mainnet-events/stage/gn\",\n },\n solvers: {\n enigma: {\n name: \"Enigma\",\n address: \"0x0420b24359d2DCccA53904042aa36A641162445c\",\n url: \"https://solver.enigma.bz/api\",\n tpsl: {\n url: \"https://tpsl.enigma.bz\",\n wsUrl: \"wss://notification.rasa.capital/ws/v1/subscribe\",\n appName: \"Arbitrum_COH_Production\",\n cohWalletAddress: \"0xFC3a98d30AdAA220Ae4150fcaC06Bd200b6E146B\",\n },\n notifications: {\n url: \"wss://notification.rasa.capital/ws/v1/subscribe\",\n channel: \"Arbitrum_Solver-Low-Cap_Production\",\n protocol: \"enigma\",\n searchUrl: \"https://notification.rasa.capital/notification\",\n },\n capabilities: { groupClose: true, listingService: true },\n },\n },\n defaultSolverId: \"enigma\",\n priceService: {\n type: \"enigma\",\n url: \"https://lowcap-price.enigma.bz\",\n wsUrl: \"wss://lowcap-price.enigma.bz/ws\",\n },\n muon: {\n urls: [\n \"https://muon-oracle1.rasa.capital/v1/\",\n \"https://muon-oracle2.rasa.capital/v1/\",\n \"https://muon-oracle3.rasa.capital/v1/\",\n \"https://muon-oracle4.rasa.capital/v1/\",\n ],\n },\n listing: {\n url: \"https://listing85.enigma.bz\",\n },\n inventory: {\n url: \"https://inventory85.enigma.bz\",\n },\n },\n};\n"],"mappings":";;AAQA,IAAa,IAAmD;EAC7D,EAAuB,OAAO;EAC7B,SAAS,EAAuB;EAChC,kBAAkB;EAClB,WAAW;GACT,eAAe;GACf,qBAAqB;GACrB,qBAAqB;GACrB,mBAAmB;GACnB,mBAAmB;GACnB,oBAAoB;EACtB;EASA,SAAS,EACP,MAAM;GACJ,MAAM;GACN,SAAS;GAET,KAAK;GAIL,eAAe;IACb,KAAK;IACL,UAAU;GACZ;GAEA,cAAc,EAAE,YAAY,GAAK;EACnC,EACF;EACA,iBAAiB;EAEjB,WAAW;GACT,WACE;GACF,QAAQ;EACV;EAQA,cAAc;GACZ,MAAM;GAEN,KAAK;GASL,OAAO;EACT;EAKA,MAAM,EACJ,MAAM;GACJ;GACA;GACA;GACA;EACF,EACF;CACF;EAEC,EAAuB,WAAW;EACjC,SAAS,EAAuB;EAChC,kBAAkB;EAOlB,SAAS;GACP,KAAK;GAEL,kBAAkB;GAClB,qBAAqB;GAOrB,cAAc,EAAE,SAAS,GAAK;EAChC;EACA,WAAW;GACT,eAAe;GACf,qBAAqB;GACrB,qBAAqB;GACrB,mBAAmB;GACnB,mBAAmB;GACnB,oBAAoB;EACtB;EACA,WAAW;GACT,WACE;GACF,QACE;EACJ;EACA,SAAS,EACP,QAAQ;GACN,MAAM;GACN,SAAS;GACT,KAAK;GACL,MAAM;IACJ,KAAK;IACL,OAAO;IACP,SAAS;IACT,kBAAkB;GACpB;GACA,eAAe;IACb,KAAK;IACL,SAAS;IACT,UAAU;IACV,WAAW;GACb;GACA,cAAc;IAAE,YAAY;IAAM,gBAAgB;GAAK;EACzD,EACF;EACA,iBAAiB;EACjB,cAAc;GACZ,MAAM;GACN,KAAK;GACL,OAAO;EACT;EACA,MAAM,EACJ,MAAM;GACJ;GACA;GACA;GACA;EACF,EACF;EACA,SAAS,EACP,KAAK,8BACP;EACA,WAAW,EACT,KAAK,gCACP;CACF;AACF"}
1
+ {"version":3,"file":"registry.js","names":[],"sources":["../../../src/core/chains/registry.ts"],"sourcesContent":["import { SymmioSupportedChainId } from \"./supported-chains\";\nimport type { SymmioChainConfig } from \"./types\";\n\n/**\n * Built-in SYMMIO deployment configs keyed by chain ID.\n *\n * @internal\n */\nexport const CHAIN_CONFIGS: Record<number, SymmioChainConfig> = {\n [SymmioSupportedChainId.BASE]: {\n chainId: SymmioSupportedChainId.BASE,\n contractsVersion: \"0.8.5\",\n // Base AccountLayer has no scheduleTimelockOp facet at block 53214315.\n timelockSupported: false,\n addresses: {\n symmioAddress: \"0x91Cf2D8Ed503EC52768999aA6D8DBeA6e52dbe43\",\n instantLayerAddress: \"0x0825435285ac0E5c02c7a7c443F631f3e07fE375\",\n accountLayerAddress: \"0x56caf00c6C5cB5478570Bb23807B9d1D697863DC\",\n affiliatesAddress: \"0x45Eecd7B4f442388ACD90467E423A5CAAC3a9C3f\",\n collateralAddress: \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\", // USDC on Base\n collateralDecimals: 6,\n },\n // Rasa — Base's real solver. Rasa's API shares Enigma's paths for the\n // shared reads (contract-symbols, funding, locked params, error codes,\n // notional_cap/{id}, instant lists), so those work today; the diverging\n // endpoints (`/instant_trade/open|close` execution, `/estimated-price`,\n // `/notional_cap` list) return 404 until per-kind dispatch is wired into\n // the solver actions.\n // No `tpsl` block: Base COH deployment not confirmed yet — absence marks\n // conditional orders unsupported (add the block when the vendor provides it).\n solvers: {\n rasa: {\n name: \"Rasa\",\n address: \"0x81631953E0C093e72935C1CAA4C7D519B2A0E407\",\n // Staging URL — swap to the production solver URL when published.\n url: \"https://stage-archon.rasa.capital\",\n // Rasa's own position-state stream — real Base data. No `searchUrl`: the\n // rasa protocol serves notification history from the solver's own\n // position-state endpoint (via `searchNotifications`), not a REST service.\n notifications: {\n url: \"wss://stage-archon.rasa.capital/ws/position-state-ws3\",\n protocol: \"rasa\",\n },\n // Majors support LIMIT orders (pending open at a user-set price).\n capabilities: { limitOrder: true },\n },\n },\n defaultSolverId: \"rasa\",\n // Base's own analytics and events subgraphs (Goldsky) — real, production endpoints.\n subgraphs: {\n analytics:\n \"https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/base_analytics/latest/gn\",\n events: \"https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/base_events/latest/gn\",\n },\n // Rasa serves majors and has no mark-price feed of its own — no REST mark\n // price, no mark-price WebSocket, no index price. Binance USD-M Futures is\n // the price source, matching how the reference UI configures this solver.\n //\n // Both URLs are public constants but stay in config on purpose: they are the\n // escape hatch for Binance's regional restrictions, so an integrator whose\n // users are blocked repoints them at their own proxy with no SDK change.\n priceService: {\n type: \"binance\",\n /** USD-M Futures REST root. The client appends `/fapi/v1/…`. */\n url: \"https://fapi.binance.com\",\n /**\n * All-symbols mark-price broadcast, 1 push/sec.\n *\n * The `/market/ws/` prefix is deliberate and was verified against the live\n * endpoint: Binance's *documented* `/ws/<stream>` form (and\n * `/stream?streams=`) connect and then never push a frame, which would ship\n * a feed that reports `open` and silently never ticks.\n */\n wsUrl: \"wss://fstream.binance.com/market/ws/!markPrice@arr@1s\",\n },\n // Muon is deployment-agnostic: one `symmio` app on one shared gateway set\n // serves every SYMMIO deployment, and the per-deployment input is the\n // `symmio` request param (this chain's diamond, from `addresses` above).\n // So these are Base's real gateways, not another chain's stand-in.\n muon: {\n urls: [\n \"https://muon-oracle1.rasa.capital/v1/\",\n \"https://muon-oracle2.rasa.capital/v1/\",\n \"https://muon-oracle3.rasa.capital/v1/\",\n ],\n },\n },\n\n [SymmioSupportedChainId.ARBITRUM]: {\n chainId: SymmioSupportedChainId.ARBITRUM,\n contractsVersion: \"0.8.6\",\n /**\n * The production GaslessQ deployment, paired with the InstantLayer below\n * (the GaslessLayer's `instantLayer()` returns it). There is deliberately\n * no `execution` block: writes keep using the connected wallet until a call\n * passes `gasless` or the consumer sets `execution.mode`.\n */\n gasless: {\n url: \"https://gaslessq.symmio.foundation\",\n /** Vendor-assigned instance key. Keep it verbatim: the gateway routes on it. */\n protocolInstance: \"arbitrum-42161-vibe\",\n gaslessLayerAddress: \"0x8347953D80037b8d82827246f37EC7442AD188B4\",\n /**\n * Declared ahead of the gateway's WebSocket rollout. Until the gateway\n * accepts the handshake, a status wait stops dialing after a few failed\n * attempts and polls over HTTP, so streaming starts without an SDK change\n * once operators enable it.\n */\n statusStream: { enabled: true },\n },\n addresses: {\n symmioAddress: \"0x57331027091994FCb9c5Aec48ea92cEf0a93CF6A\",\n instantLayerAddress: \"0xf4e8b150fdc756aca578f5a05811c1998c65c829\",\n accountLayerAddress: \"0x573310d1D6ec18cB21E1aB949414470D9bf5c24E\",\n affiliatesAddress: \"0x58bB5Bdc279321507DfB7AB54B9e7EF3DdA6E24D\",\n collateralAddress: \"0xaf88d065e77c8cC2239327C5EDb3A432268e5831\",\n collateralDecimals: 6,\n },\n subgraphs: {\n analytics:\n \"https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/arbitrum-vibe-mainnet-analytics/latest/gn\",\n events:\n \"https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/arbitrum-vibe-mainnet-events/stage/gn\",\n },\n solvers: {\n enigma: {\n name: \"Enigma\",\n address: \"0x0420b24359d2DCccA53904042aa36A641162445c\",\n url: \"https://solver.enigma.bz/api\",\n tpsl: {\n url: \"https://tpsl.enigma.bz\",\n wsUrl: \"wss://notification.rasa.capital/ws/v1/subscribe\",\n appName: \"Arbitrum_COH_Production\",\n cohWalletAddress: \"0xFC3a98d30AdAA220Ae4150fcaC06Bd200b6E146B\",\n },\n notifications: {\n url: \"wss://notification.rasa.capital/ws/v1/subscribe\",\n channel: \"Arbitrum_Solver-Low-Cap_Production\",\n protocol: \"enigma\",\n /**\n * The host root, not the service's documented `/notification` prefix:\n * Cloudflare answers programmatic requests to that prefix with a 403\n * block page, while the host root serves the same API with CORS headers.\n */\n searchUrl: \"https://notification.rasa.capital\",\n },\n capabilities: { groupClose: true, listingService: true },\n },\n },\n defaultSolverId: \"enigma\",\n priceService: {\n type: \"enigma\",\n url: \"https://lowcap-price.enigma.bz\",\n wsUrl: \"wss://lowcap-price.enigma.bz/ws\",\n },\n muon: {\n urls: [\n \"https://muon-oracle1.rasa.capital/v1/\",\n \"https://muon-oracle2.rasa.capital/v1/\",\n \"https://muon-oracle3.rasa.capital/v1/\",\n ],\n },\n listing: {\n url: \"https://listing85.enigma.bz\",\n },\n inventory: {\n url: \"https://inventory85.enigma.bz\",\n },\n },\n};\n"],"mappings":";;AAQA,IAAa,IAAmD;EAC7D,EAAuB,OAAO;EAC7B,SAAS,EAAuB;EAChC,kBAAkB;EAElB,mBAAmB;EACnB,WAAW;GACT,eAAe;GACf,qBAAqB;GACrB,qBAAqB;GACrB,mBAAmB;GACnB,mBAAmB;GACnB,oBAAoB;EACtB;EASA,SAAS,EACP,MAAM;GACJ,MAAM;GACN,SAAS;GAET,KAAK;GAIL,eAAe;IACb,KAAK;IACL,UAAU;GACZ;GAEA,cAAc,EAAE,YAAY,GAAK;EACnC,EACF;EACA,iBAAiB;EAEjB,WAAW;GACT,WACE;GACF,QAAQ;EACV;EAQA,cAAc;GACZ,MAAM;GAEN,KAAK;GASL,OAAO;EACT;EAKA,MAAM,EACJ,MAAM;GACJ;GACA;GACA;EACF,EACF;CACF;EAEC,EAAuB,WAAW;EACjC,SAAS,EAAuB;EAChC,kBAAkB;EAOlB,SAAS;GACP,KAAK;GAEL,kBAAkB;GAClB,qBAAqB;GAOrB,cAAc,EAAE,SAAS,GAAK;EAChC;EACA,WAAW;GACT,eAAe;GACf,qBAAqB;GACrB,qBAAqB;GACrB,mBAAmB;GACnB,mBAAmB;GACnB,oBAAoB;EACtB;EACA,WAAW;GACT,WACE;GACF,QACE;EACJ;EACA,SAAS,EACP,QAAQ;GACN,MAAM;GACN,SAAS;GACT,KAAK;GACL,MAAM;IACJ,KAAK;IACL,OAAO;IACP,SAAS;IACT,kBAAkB;GACpB;GACA,eAAe;IACb,KAAK;IACL,SAAS;IACT,UAAU;IAMV,WAAW;GACb;GACA,cAAc;IAAE,YAAY;IAAM,gBAAgB;GAAK;EACzD,EACF;EACA,iBAAiB;EACjB,cAAc;GACZ,MAAM;GACN,KAAK;GACL,OAAO;EACT;EACA,MAAM,EACJ,MAAM;GACJ;GACA;GACA;EACF,EACF;EACA,SAAS,EACP,KAAK,8BACP;EACA,WAAW,EACT,KAAK,gCACP;CACF;AACF"}
@@ -78,6 +78,8 @@ export type SymmioSolverKind = (typeof SUPPORTED_SOLVER_KINDS)[number];
78
78
  * to `false` — a solver must **declare** a capability to enable it.
79
79
  */
80
80
  export interface SolverCapabilitiesConfig {
81
+ /** Whether this solver deployment offers timelock approval. Unset means unspecified; consumers may discover support. */
82
+ timelockApproval?: boolean;
81
83
  /**
82
84
  * Whether the solver supports closing a whole market + side group of quotes in
83
85
  * one flow. Enigma (Virtual-Account isolation, one VA per market + side)
@@ -224,7 +226,7 @@ interface SymmioNotificationsConfigBase {
224
226
  url: string;
225
227
  /**
226
228
  * Base URL of the notification REST service that backs `searchNotifications`
227
- * (`POST /api/v1/search`), e.g. `https://notification.rasa.capital/notification`.
229
+ * (`POST /api/v1/search`), e.g. `https://notification.rasa.capital`.
228
230
  * Optional — when unset, `searchNotifications` requires a per-call `baseUrl`.
229
231
  */
230
232
  searchUrl?: string;
@@ -427,6 +429,19 @@ export interface SymmioGaslessStatusStreamConfig {
427
429
  */
428
430
  origin?: string;
429
431
  }
432
+ /**
433
+ * Context supplied to {@link SymmioGaslessConfig.getRequestHeaders} for each HTTP attempt.
434
+ * Applications must also bind their own deployment and authentication identity;
435
+ * a chain id alone does not distinguish deployments sharing a chain.
436
+ */
437
+ export interface GaslessRequestContext {
438
+ /** Chain selected for the request. */
439
+ chainId: number;
440
+ /** Gasless sub-service addressed by the request. */
441
+ service: "operations" | "deposits";
442
+ /** HTTP method of this attempt. */
443
+ method: "GET" | "POST";
444
+ }
430
445
  /**
431
446
  * Chain-level configuration for the GaslessQ relayer service.
432
447
  *
@@ -442,6 +457,24 @@ export interface SymmioGaslessStatusStreamConfig {
442
457
  * and has not disabled anonymous access.
443
458
  */
444
459
  export interface SymmioGaslessConfig {
460
+ /**
461
+ * Resolve application-owned HTTP headers immediately before each GET or POST
462
+ * attempt, including retries and exact resubmissions. Useful for an
463
+ * authenticated application proxy. Values override `apiKey` case-insensitively;
464
+ * the SDK retains its JSON Accept and Content-Type headers.
465
+ *
466
+ * Rejection aborts that attempt with `GASLESS_REQUEST_HEADERS_FAILED` without
467
+ * exposing the callback's error or credentials. An earlier uncertain submit
468
+ * remains uncertain. Headers never enter submission snapshots or WebSockets.
469
+ *
470
+ * @param context - Chain, service and HTTP method for this attempt.
471
+ * @returns Fresh headers, synchronously or asynchronously.
472
+ * @example
473
+ * ```ts
474
+ * getRequestHeaders: async () => ({ Authorization: `Bearer ${await getToken()}` })
475
+ * ```
476
+ */
477
+ getRequestHeaders?: (context: GaslessRequestContext) => Readonly<Record<string, string>> | Promise<Readonly<Record<string, string>>>;
445
478
  /**
446
479
  * Where the SDK reaches the GaslessQ gateway. One of:
447
480
  *
@@ -531,6 +564,8 @@ export interface SymmioChainConfig {
531
564
  chainId: number;
532
565
  /** Contracts generation deployed on this chain. See {@link SymmioContractsVersion}. */
533
566
  contractsVersion: SymmioContractsVersion;
567
+ /** Explicit deployment capability. `false` disables timelock calls; omitted means unknown. */
568
+ timelockSupported?: boolean;
534
569
  /** Contract addresses */
535
570
  addresses: SymmioContractAddresses;
536
571
  /** Subgraph endpoints */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/chains/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,mCAAmC;IACnC,aAAa,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,mBAAmB,EAAE,OAAO,CAAC;IAC7B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,uFAAuF;IACvF,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yBAAyB;IACzB,SAAS,EAAE,uBAAuB,CAAC;IACnC,yBAAyB;IACzB,SAAS,EAAE,kBAAkB,CAAC;IAC9B;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACvD,mFAAmF;IACnF,eAAe,EAAE,QAAQ,CAAC;IAC1B,kCAAkC;IAClC,YAAY,EAAE,wBAAwB,CAAC;IACvC,gCAAgC;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B;;;;OAIG;IACH,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/core/chains/types.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { GaslessRelayEvent } from \"../../gasless/types\";\n\n/**\n * Contract addresses for a SYMMIO chain deployment.\n */\nexport interface SymmioContractAddresses {\n /** Main SYMMIO diamond contract */\n symmioAddress: Address;\n /** InstantLayer contract for instant actions */\n instantLayerAddress: Address;\n /** AccountLayer contract for subaccount management */\n accountLayerAddress: Address;\n /** Affiliates registry contract */\n affiliatesAddress: Address;\n /** Collateral token address (e.g. USDC) */\n collateralAddress: Address;\n /** Decimals of the collateral token */\n collateralDecimals: number;\n}\n\n/**\n * Subgraph endpoints for a SYMMIO chain deployment.\n */\nexport interface SymmioSubgraphUrls {\n /** Analytics subgraph for aggregated data (balance changes, quotes, history). */\n analytics: string;\n /** Events subgraph for raw on-chain events (e.g. `internalTransfers`). */\n events: string;\n}\n\n/**\n * Name of a configured subgraph endpoint (a key of {@link SymmioSubgraphUrls}).\n *\n * Used to pick which subgraph an action queries (`\"analytics\"` | `\"events\"`); the\n * union grows automatically as endpoints are added.\n */\nexport type SymmioSubgraphName = keyof SymmioSubgraphUrls;\n\n/**\n * A solver's id within a chain config — its registry key. Equal to its\n * {@link SymmioSolverKind}: each chain registers at most one solver per kind, so\n * the id *is* the kind (`\"enigma\" | \"rasa\"`). Closed for that reason.\n */\nexport type SolverId = SymmioSolverKind;\n\n/**\n * The solver kinds the SDK can actually serve — one generated client and\n * behavior set per entry. Single source of truth: {@link SymmioSolverKind} is\n * derived from this list, and `createConfig` validates every configured solver\n * against it (`assertSupportedSolver` in `solver-support.ts`). To add a kind,\n * append it here and ship its generated client + dispatch in the same change.\n *\n * @internal\n */\nexport const SUPPORTED_SOLVER_KINDS = [\"enigma\", \"rasa\"] as const;\n\n/**\n * Schema family a solver's REST API speaks — the discriminant used to select a\n * generated client. Closed (derived from {@link SUPPORTED_SOLVER_KINDS}): the\n * SDK ships one client per kind, so dispatch must be exhaustive.\n *\n * There is deliberately no version axis: each SDK release supports exactly one\n * API generation per kind. When a solver ships a new API generation, the SDK\n * regenerates that kind's client in a new release — consumers pick the\n * generation by pinning the SDK version, not through config.\n */\nexport type SymmioSolverKind = (typeof SUPPORTED_SOLVER_KINDS)[number];\n\n/**\n * Solver / hedger configuration for a SYMMIO chain deployment.\n *\n * In this SDK a \"solver\" is the same actor that fronts the lowcap hedger REST\n * API (`/instant_trade/instant_open`, `/contract-symbols`, …) and acts as\n * `partyB` on-chain. Its `url` is the API base URL, its `address` is partyB.\n *\n * Solvers live under {@link SymmioChainConfig.solvers}, keyed by\n * {@link SolverId} — the key is the solver's id, which is also its kind, so the\n * kind is not repeated here. `config.getSolver({ chainId, solverId })` returns a\n * {@link SymmioResolvedSolver} (this config plus its resolved `id`).\n */\n/**\n * Per-solver capability flags. Gate SDK flows and UI on these so a solver that\n * lacks a feature degrades gracefully instead of erroring. Unset flags default\n * to `false` — a solver must **declare** a capability to enable it.\n */\nexport interface SolverCapabilitiesConfig {\n /**\n * Whether the solver supports closing a whole market + side group of quotes in\n * one flow. Enigma (Virtual-Account isolation, one VA per market + side)\n * supports it; rasa (cross-margin) does not. Default `false`.\n */\n groupClose?: boolean;\n /**\n * Whether the solver supports LIMIT orders — placing a pending open at a\n * user-set price. Majors (rasa) support it; enigma (lowcap) does not. Default\n * `false`.\n */\n limitOrder?: boolean;\n /**\n * Whether this solver's markets are the lowcap **Pools** (listing service).\n * Purely declarative: the SDK's listing functions resolve the listing backend\n * **at chain level** ({@link SymmioChainConfig.listing}) and do **not** gate on\n * this flag. It exists so config can express which solvers do listing, readable\n * via `getSolverCapabilities`. Enigma (lowcap) declares it; rasa does not.\n * Default `false`.\n */\n listingService?: boolean;\n}\n\nexport interface SymmioSolverConfig {\n /** Human-readable solver name */\n name: string;\n /** Solver's on-chain address (used as `partyB` in `sendQuote`) */\n address: Address;\n /** Solver / hedger API base URL */\n url: string;\n /** Optional TP/SL handler — solver supports conditional orders only when set. */\n tpsl?: SymmioTpSlConfig;\n /**\n * Price source for **this solver's** markets. Falls back to the chain's\n * {@link SymmioChainConfig.priceService} when omitted, so set it only where a\n * solver diverges from the chain default — do not duplicate the default.\n *\n * Needed because a chain may register several solvers that price differently:\n * a lowcap solver reads its own price service while a majors solver reads\n * Binance. A single chain-level value cannot be right for both.\n */\n priceService?: SymmioPriceServiceConfig;\n /**\n * Notifications endpoint for **this solver's** position/quote state stream and\n * history search. Required per solver: notifications are inherently\n * solver-specific — the enigma `channel` and the rasa position-state URL are\n * the solver's own — so there is no chain-level default to inherit.\n */\n notifications: SymmioNotificationsConfig;\n /**\n * Optional per-solver capability flags. Gate SDK flows and UI on these\n * ({@link SolverCapabilitiesConfig}); unset flags default to `false`.\n */\n capabilities?: SolverCapabilitiesConfig;\n}\n\n/**\n * A {@link SymmioSolverConfig} resolved from the registry, with its `id`\n * attached. The `id` is the solver's kind (`\"enigma\" | \"rasa\"`) and drives\n * per-kind dispatch inside solver actions. Returned by `config.getSolver`.\n */\nexport interface SymmioResolvedSolver extends SymmioSolverConfig {\n /** The resolved solver id — equal to its kind. */\n id: SolverId;\n}\n\n/**\n * TP/SL (Conditional Order Handler) configuration for a solver.\n *\n * The handler is an off-chain service that signs and executes\n * `requestToClosePosition` calls when the user's TP/SL trigger fires. To\n * authorize it, every user must grant a delegation to {@link cohWalletAddress}\n * for the standard instant-trade selectors.\n */\nexport interface SymmioTpSlConfig {\n /** Handler REST root URL (no `/api/v5/` suffix — orval-generated paths add it). */\n url: string;\n /** Handler WebSocket URL — enigma-protocol notifications scoped by `appName`. */\n wsUrl: string;\n /** `App-Name` header value, e.g. `Arbitrum_COH_Production`. */\n appName: string;\n /** COH wallet address that must be granted delegation to execute TP/SL orders. */\n cohWalletAddress: Address;\n}\n\n/**\n * The price providers the SDK ships a client for. Closed: it drives exhaustive\n * dispatch in `getMarkPrices` / `watchPrices`, and `createConfig` validates every\n * configured price service against it (`assertSupportedPriceServiceType` in\n * `price-service-support.ts`). To add a provider, append it here and ship its\n * adapter + dispatch in the same change.\n *\n * @internal\n */\nexport const SUPPORTED_PRICE_SERVICE_TYPES = [\"enigma\", \"binance\"] as const;\n\n/**\n * Supported price-service providers.\n *\n * A **second, independent axis** from {@link SymmioSolverKind}: a Rasa solver is\n * priced off Binance today, and nothing in the type system ties the two\n * together. The provider is *derived* from `{ chainId, solverId }` via\n * `solver.priceService ?? chain.priceService` — never selected per call.\n */\nexport type SymmioPriceServiceType = (typeof SUPPORTED_PRICE_SERVICE_TYPES)[number];\n\n/**\n * Price-service configuration for a SYMMIO chain deployment.\n *\n * Both URLs stay **required, including for Binance**. Binance's endpoints are\n * public constants, but keeping them in config is the geo-restriction escape\n * hatch: an integrator whose users are in a blocked region repoints both at\n * their own proxy with no SDK change.\n */\nexport interface SymmioPriceServiceConfig {\n /** Price-service provider type. Selects which client the SDK uses. */\n type: SymmioPriceServiceType;\n /**\n * REST host root, no trailing slash — the client appends the provider's path.\n * `enigma`: `https://lowcap-price.enigma.bz` (+ `/api/v1/prices/names`).\n * `binance`: `https://fapi.binance.com` (+ `/fapi/v1/premiumIndex`).\n */\n url: string;\n /**\n * **Full** WebSocket endpoint — the exact URL the SDK dials, identically for\n * every provider, so nothing downstream needs to know which provider it holds.\n * `enigma`: `wss://lowcap-price.enigma.bz/ws`.\n * `binance`: `wss://fstream.binance.com/market/ws/!markPrice@arr@1s`.\n */\n wsUrl: string;\n}\n\n/**\n * Wire protocol a notifications endpoint speaks. Closed: it drives exhaustive\n * dispatch in `watchNotifications` / `parseNotificationFrame`; to add a\n * protocol, append it here and ship its subscribe + parse path in the same\n * change.\n *\n * - `enigma` — the lowcap solver endpoint (`…/ws/v1/subscribe`). Subscribes\n * with a `channel_patterns` frame and wraps each push as `{ data, address }`.\n * - `rasa` — the Rasa position-state endpoint (`…/ws/position-state-ws3`).\n * Subscribes with an `{ address: [...] }` frame (one socket can carry many\n * SubAccounts) and pushes bare notification frames, no envelope.\n */\nexport type SymmioNotificationsProtocol = \"enigma\" | \"rasa\";\n\n/**\n * Fields every notifications endpoint shares, regardless of wire protocol.\n */\ninterface SymmioNotificationsConfigBase {\n /** Notifications WebSocket URL (`wss://…`). */\n url: string;\n /**\n * Base URL of the notification REST service that backs `searchNotifications`\n * (`POST /api/v1/search`), e.g. `https://notification.rasa.capital/notification`.\n * Optional — when unset, `searchNotifications` requires a per-call `baseUrl`.\n */\n searchUrl?: string;\n}\n\n/**\n * Notifications endpoint speaking the `enigma` protocol (the lowcap\n * solver's channel-scoped stream).\n */\nexport interface SymmioEnigmaNotificationsConfig extends SymmioNotificationsConfigBase {\n /** Wire protocol the endpoint speaks. */\n protocol: \"enigma\";\n /** Channel / `app_name` the subscribe frame targets on this endpoint. */\n channel: string;\n}\n\n/**\n * Notifications endpoint speaking the `rasa` position-state protocol. No\n * channel — the subscribe frame is just the watched SubAccount addresses.\n */\nexport interface SymmioRasaNotificationsConfig extends SymmioNotificationsConfigBase {\n /** Wire protocol the endpoint speaks. */\n protocol: \"rasa\";\n}\n\n/**\n * Notifications WebSocket configuration for a SYMMIO chain deployment.\n *\n * The notifications endpoint streams position/quote state transitions (instant\n * open/close confirmations, fills, cancels, liquidations) for a SubAccount. It\n * is a push channel, not a REST endpoint — `url` is a `ws://`/`wss://` URL.\n * Discriminated on `protocol`; narrow to reach protocol-specific fields\n * (e.g. the enigma `channel`).\n */\nexport type SymmioNotificationsConfig = SymmioEnigmaNotificationsConfig | SymmioRasaNotificationsConfig;\n\n/**\n * Muon oracle configuration for a SYMMIO chain deployment.\n *\n * The Muon network signs off-chain values (e.g. a party's unrealized PnL) that\n * the contracts verify on-chain — `removeMargin` requires such a signature. The\n * gateway is a query-param REST endpoint with no OpenAPI spec; `urls` are tried\n * in order until one returns a successful attestation.\n *\n * @see {@link https://docs.symm.io/api-endpoints-and-deployments/muon-api}\n */\nexport interface SymmioMuonConfig {\n /** Muon oracle gateway base URLs, tried in order (fallback on failure). */\n urls: readonly string[];\n}\n\n/**\n * Pools **listing backend** configuration for a SYMMIO chain deployment.\n *\n * The listing backend is an auth'd REST service that owns the lowcap Pools flow\n * — the pool catalogue, per-pool stats, a user's stake/rewards, and the\n * create/deposit/withdraw/claim actions. It is chain-level: one listing backend\n * is served per chain (a chain has at most one), with no solver or capability\n * involved. Present only where Pools is available (Enigma on Arbitrum); omitted\n * elsewhere.\n *\n * One deployment serves listings whose collateral was deposited on **several**\n * chains — a catalogue row's `chainId` is the token's deposit chain, which is\n * not the chain the resulting market trades on.\n */\nexport interface SymmioListingConfig {\n /**\n * Listing backend **host root** — no version segment and no trailing slash\n * (e.g. `https://listing85.enigma.bz`, staging\n * `https://listing-staging.enigma.bz`).\n *\n * The generated client's own paths already begin with `/v2`, so a versioned\n * base URL here would request `/v2/v2/market/search` and 404. Point this at\n * staging with a `createConfig` override — there is no separate environment\n * axis.\n */\n url: string;\n}\n\n/**\n * Inventory-service configuration for a SYMMIO chain deployment.\n *\n * The inventory service is the custody backend behind the lowcap Pools: it holds\n * the per-market token and collateral inventory that backs trading, and reports\n * the system-wide TVL those balances add up to. It is a **separate vendor** from\n * both the solver and the {@link SymmioListingConfig} listing backend, with its\n * own deployment and its own OpenAPI spec.\n *\n * Chain-level and optional, like `listing`: present where lowcap Pools are\n * available, omitted elsewhere.\n */\nexport interface SymmioInventoryConfig {\n /**\n * Inventory service **host root** — no path segment and no trailing slash\n * (e.g. `https://inventory85.enigma.bz`, staging\n * `https://inventory-staging.enigma.bz`).\n *\n * The generated client's own paths already begin with `/api/v1`, so appending\n * `/api` here would request `/api/api/v1/...` and 404.\n */\n url: string;\n}\n\n/**\n * Failure policy for the transparent gasless execution mode, applied when the\n * relay definitively rejects a request **before** it is accepted (a 4xx, or a\n * pre-broadcast `rejected`).\n *\n * - `\"error\"` (default): surface a typed error; the consumer decides what to do.\n * - `\"wallet\"`: silently fall back to the normal gas-paid wallet path.\n *\n * After the service accepts a request (HTTP 202) no fallback ever happens — the\n * relayed transaction may still execute, and a wallet retry would duplicate it.\n */\nexport type GaslessFallback = \"error\" | \"wallet\";\n\n/**\n * Defaults governing how existing contract writes dispatch when the transparent\n * gasless execution mode is active. Every field can be overridden per call via\n * the `gasless` write parameter.\n */\nexport interface GaslessExecutionConfig {\n /**\n * `\"wallet\"` (default): writes go through the connected wallet as always.\n * `\"gasless\"`: relayable writes are signed as InstantLayer operations and\n * relayed through GaslessQ; non-relayable writes keep the wallet path.\n */\n mode?: \"wallet\" | \"gasless\";\n /** Pre-acceptance failure policy. Default `\"error\"`. */\n fallback?: GaslessFallback;\n /**\n * Quote the batch on-chain (the GaslessLayer's `previewFeeQuote`) before\n * prompting the user for a signature, and fail fast when the quote refuses\n * it: `GASLESS_FREE_QUOTA_EXHAUSTED` when the daily free quota is spent (the\n * one case `fallback: \"wallet\"` recovers from), `GASLESS_FEE_QUOTE_REVERTED`\n * when the contract rejects the batch, and `GASLESS_LAYER_INTERFACE_UNSUPPORTED`\n * when the GaslessLayer predates the multi-wallet interface. A quote that\n * fails for transport reasons does not block, and the quote never checks\n * affordability — the relayer's simulation is authoritative. Default `true`.\n */\n preflightFee?: boolean;\n /**\n * Verify on-chain (`isDelegationActive`) that the signing key is authorized\n * for every selector a relayed write carries before prompting the user for a\n * signature, and fail fast when a session key is missing a delegation.\n * Skipped for the sub-account's own owner, who needs no delegation.\n * Default `true`.\n */\n preflightDelegation?: boolean;\n /** Max wait for the relayer to broadcast before timing out. Default `120_000` ms. */\n broadcastTimeoutMs?: number;\n /** Status poll cadence while the request is `queued`. Default `1_500` ms. */\n queuedPollMs?: number;\n /** Status poll cadence after the request is `submitted`. Default `3_000` ms. */\n submittedPollMs?: number;\n /**\n * How long a status wait lets the gateway's stream settle before falling back\n * to its first HTTP read. It ends early the moment the stream delivers, or\n * reports that it will not (unreachable, not-found, at its subscription cap,\n * disabled). Ignored where the stream is off. Default `1_000` ms.\n */\n streamSettleMs?: number;\n /**\n * How long a delivering stream may report nothing about a workflow before the\n * wait takes one HTTP read anyway and re-arms. Heartbeats do not count — only\n * records for the request do. Default `15_000` ms.\n */\n streamStaleMs?: number;\n /**\n * HTTP timeout for each gasless submit, in ms: every relay and\n * deposit-settlement POST, from the explicit actions as well as the\n * transparent mode. A submit that times out is ambiguous (the gateway may\n * already have accepted it) and fails like a network error, with status `0`.\n * Status reads are not bounded by it. Default `30_000`.\n */\n submitTimeoutMs?: number;\n /**\n * Lifecycle observer for relayed writes — fires at `accepted`, `broadcast`,\n * and `terminal`. Persist request ids in the `accepted` event so in-flight\n * workflows survive reloads.\n */\n onEvent?: (event: GaslessRelayEvent) => void;\n}\n\n/**\n * Status-stream availability for one GaslessQ deployment. It is a deployment\n * fact, like the URL. Status WebSockets are optional and disabled by default at\n * the gateway, and each environment enables them separately, so a stream is\n * declared per chain rather than assumed.\n *\n * Where it is enabled, the stream is the primary transport for status waits and\n * HTTP reads become the fallback: a wait subscribes, gives the stream\n * `execution.streamSettleMs` to deliver, and polls only while the stream is not\n * delivering. HTTP status reads stay available whether or not a stream is\n * declared.\n */\nexport interface SymmioGaslessStatusStreamConfig {\n /**\n * Whether this deployment serves the status WebSocket. Set it to `true` only\n * once the operators confirm streams for this environment and protocol\n * instance. A staging confirmation does not cover production.\n */\n enabled: boolean;\n /**\n * The gateway's `https://` origin, used to locate the stream when `url` is a\n * proxy root, because a proxy that forwards HTTP cannot be assumed to forward\n * WebSockets. Omit it for the gateway `url` forms, whose stream endpoint\n * derives from `url` itself.\n */\n origin?: string;\n}\n\n/**\n * Chain-level configuration for the GaslessQ relayer service.\n *\n * GaslessQ relays user-signed InstantLayer operations so account actions need\n * no native gas: the relayer broadcasts and pays, and the **GaslessLayer**\n * contract charges an operational fee from the user's SYMMIO collateral in the\n * same atomic transaction. Optional and chain-level, like `listing`: present\n * only on perps-core (`\"0.8.6\"`) chains with a GaslessLayer deployment.\n * Resolve it with `resolveGaslessService` / gate on `supportsGaslessService`.\n *\n * The gateway serves anonymous clients by default, so a browser app can call it\n * directly with no `apiKey`, as long as the deployment allows the app's Origin\n * and has not disabled anonymous access.\n */\nexport interface SymmioGaslessConfig {\n /**\n * Where the SDK reaches the GaslessQ gateway. One of:\n *\n * - the gateway **origin** (`https://host`, no path) with `protocolInstance`,\n * the recommended form. The SDK derives\n * `/v1/instances/{protocolInstance}/{operations|deposits}`.\n * - an **instance root** (`…/v1/instances/<protocol-instance>`). The SDK\n * appends `/{service}`.\n * - an **instance-pinned service base**\n * (`…/v1/instances/<protocol-instance>/operations` or `…/deposits`), used\n * as-is and for that one service only.\n * - any other path, absolute or relative, is a **proxy root** (for example a\n * server-side proxy at `/api/gasless`). The SDK appends `/{service}`.\n *\n * The instance-less `/v1/operations` and `/v1/deposits` compatibility routes\n * are rejected with `GASLESS_URL_LEGACY_ROUTE`: the gateway is retiring them,\n * and they pin no instance to verify responses against. A query string, a\n * fragment, credentials (`user:password@`) or a non-HTTP(S) scheme is\n * rejected with `GASLESS_URL_INVALID`.\n */\n url: string;\n /**\n * Protocol-instance key selecting the deployment at the gateway\n * (`\"<protocol-instance>\"`, from the deployment handoff). Staging and\n * production can share a chain id, so the key, not the chain, picks the\n * contracts.\n *\n * Required with an origin `url` (`GASLESS_PROTOCOL_INSTANCE_REQUIRED`). With\n * an instance root or service base it may be omitted, but when given it must\n * equal the instance the path pins (`GASLESS_PROTOCOL_INSTANCE_CONFLICT`).\n * With a proxy root it is the instance successful responses are checked\n * against, whenever the proxy forwards the `X-GasLessQ-Protocol-Instance`\n * header.\n */\n protocolInstance?: string;\n /**\n * The GaslessLayer proxy address — the operational-fee charger and the\n * source of every gasless read (wallet addresses, deposit policy, fee\n * quotes, nonces). A deployment fact with **no runtime discovery**: update it\n * on every gateway redeploy. It must run the multi-wallet GaslessLayer\n * interface (`walletId`-scoped reads, `previewFeeQuote`); a proxy that has not\n * been upgraded to it is unsupported, and its fee quote throws\n * `GASLESS_LAYER_INTERFACE_UNSUPPORTED`.\n */\n gaslessLayerAddress: Address;\n /**\n * Optional partner key, sent as `Authorization: Bearer <key>`. Omit it to use\n * the gateway's anonymous profile, which is on by default: 10 requests per\n * second per caller IP and protocol instance, shared across operations and\n * deposits, with no `Authorization` header sent at all. Where anonymous access\n * is on, a key only raises the gateway limits. A deployment can turn it off,\n * and then answers keyless requests with `401`, so a key is required there. A\n * key must be authorized for the protocol instance and service it calls, and\n * it changes neither fees, wallet selection nor signatures.\n *\n * Meant for servers and backend-for-frontend proxies. **Never ship a key in a\n * browser bundle**, where anyone can read it. An invalid, disabled or\n * unauthorized key is rejected (`401` / `403`) and never falls back to\n * anonymous access. Errors the SDK throws never carry the key.\n */\n apiKey?: string;\n /**\n * Status-stream availability for this deployment. Omitted, the deployment is\n * treated as serving no stream.\n */\n statusStream?: SymmioGaslessStatusStreamConfig;\n /** Transparent execution-mode defaults for existing contract writes. */\n execution?: GaslessExecutionConfig;\n}\n\n/**\n * The perps-core contracts generation a chain's deployment runs.\n *\n * A **deployment fact, declared per chain** — it is not probed at runtime (the\n * diamond exposes no version view). It drives the version-sensitive seams the\n * SDK carries for serving mixed-generation chains from one release: which\n * quote-send call the instant-open flow signs (`sendQuote` with solver-fee caps\n * on `\"0.8.6\"`, the legacy `sendQuoteWithAffiliateAndData` on `\"0.8.5\"`), which\n * selector the session-key delegation set includes, and which output shape the\n * withdraw-request reads decode.\n */\nexport type SymmioContractsVersion = \"0.8.5\" | \"0.8.6\";\n\n/**\n * Complete resolved configuration for a SYMMIO chain deployment.\n */\nexport interface SymmioChainConfig {\n /** Chain ID */\n chainId: number;\n /** Contracts generation deployed on this chain. See {@link SymmioContractsVersion}. */\n contractsVersion: SymmioContractsVersion;\n /** Contract addresses */\n addresses: SymmioContractAddresses;\n /** Subgraph endpoints */\n subgraphs: SymmioSubgraphUrls;\n /**\n * Solvers available on this chain, keyed by {@link SolverId} (which is the\n * solver's kind). A chain registers a subset of the kinds, so this is partial.\n * Resolve one with `config.getSolver({ chainId, solverId })`, which defaults to\n * {@link defaultSolverId} when `solverId` is omitted.\n */\n solvers: Partial<Record<SolverId, SymmioSolverConfig>>;\n /** Id of the solver an action targets on this chain when `solverId` is omitted. */\n defaultSolverId: SolverId;\n /** Price-service configuration */\n priceService: SymmioPriceServiceConfig;\n /** Muon oracle configuration */\n muon: SymmioMuonConfig;\n /**\n * Optional Pools listing backend, served per chain. Set on chains where the\n * lowcap Pools flow is available (Enigma on Arbitrum); omitted elsewhere.\n * Resolve it with `resolveListingService` / gate on `supportsListingService`.\n */\n listing?: SymmioListingConfig;\n /**\n * Optional inventory service — the custody backend behind lowcap Pools, and\n * the source of system-wide TVL. Set alongside {@link SymmioChainConfig.listing};\n * resolve it with `resolveInventoryService`.\n */\n inventory?: SymmioInventoryConfig;\n /**\n * Optional GaslessQ relayer service. Set on perps-core (`\"0.8.6\"`) chains\n * with a GaslessLayer deployment; omitted elsewhere. Resolve it with\n * `resolveGaslessService` / gate on `supportsGaslessService`.\n */\n gasless?: SymmioGaslessConfig;\n}\n"],"mappings":";AAuDA,IAAa,IAAyB,CAAC,UAAU,MAAM,GA8H1C,IAAgC,CAAC,UAAU,SAAS"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/core/chains/types.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { GaslessRelayEvent } from \"../../gasless/types\";\n\n/**\n * Contract addresses for a SYMMIO chain deployment.\n */\nexport interface SymmioContractAddresses {\n /** Main SYMMIO diamond contract */\n symmioAddress: Address;\n /** InstantLayer contract for instant actions */\n instantLayerAddress: Address;\n /** AccountLayer contract for subaccount management */\n accountLayerAddress: Address;\n /** Affiliates registry contract */\n affiliatesAddress: Address;\n /** Collateral token address (e.g. USDC) */\n collateralAddress: Address;\n /** Decimals of the collateral token */\n collateralDecimals: number;\n}\n\n/**\n * Subgraph endpoints for a SYMMIO chain deployment.\n */\nexport interface SymmioSubgraphUrls {\n /** Analytics subgraph for aggregated data (balance changes, quotes, history). */\n analytics: string;\n /** Events subgraph for raw on-chain events (e.g. `internalTransfers`). */\n events: string;\n}\n\n/**\n * Name of a configured subgraph endpoint (a key of {@link SymmioSubgraphUrls}).\n *\n * Used to pick which subgraph an action queries (`\"analytics\"` | `\"events\"`); the\n * union grows automatically as endpoints are added.\n */\nexport type SymmioSubgraphName = keyof SymmioSubgraphUrls;\n\n/**\n * A solver's id within a chain config — its registry key. Equal to its\n * {@link SymmioSolverKind}: each chain registers at most one solver per kind, so\n * the id *is* the kind (`\"enigma\" | \"rasa\"`). Closed for that reason.\n */\nexport type SolverId = SymmioSolverKind;\n\n/**\n * The solver kinds the SDK can actually serve — one generated client and\n * behavior set per entry. Single source of truth: {@link SymmioSolverKind} is\n * derived from this list, and `createConfig` validates every configured solver\n * against it (`assertSupportedSolver` in `solver-support.ts`). To add a kind,\n * append it here and ship its generated client + dispatch in the same change.\n *\n * @internal\n */\nexport const SUPPORTED_SOLVER_KINDS = [\"enigma\", \"rasa\"] as const;\n\n/**\n * Schema family a solver's REST API speaks — the discriminant used to select a\n * generated client. Closed (derived from {@link SUPPORTED_SOLVER_KINDS}): the\n * SDK ships one client per kind, so dispatch must be exhaustive.\n *\n * There is deliberately no version axis: each SDK release supports exactly one\n * API generation per kind. When a solver ships a new API generation, the SDK\n * regenerates that kind's client in a new release — consumers pick the\n * generation by pinning the SDK version, not through config.\n */\nexport type SymmioSolverKind = (typeof SUPPORTED_SOLVER_KINDS)[number];\n\n/**\n * Solver / hedger configuration for a SYMMIO chain deployment.\n *\n * In this SDK a \"solver\" is the same actor that fronts the lowcap hedger REST\n * API (`/instant_trade/instant_open`, `/contract-symbols`, …) and acts as\n * `partyB` on-chain. Its `url` is the API base URL, its `address` is partyB.\n *\n * Solvers live under {@link SymmioChainConfig.solvers}, keyed by\n * {@link SolverId} — the key is the solver's id, which is also its kind, so the\n * kind is not repeated here. `config.getSolver({ chainId, solverId })` returns a\n * {@link SymmioResolvedSolver} (this config plus its resolved `id`).\n */\n/**\n * Per-solver capability flags. Gate SDK flows and UI on these so a solver that\n * lacks a feature degrades gracefully instead of erroring. Unset flags default\n * to `false` — a solver must **declare** a capability to enable it.\n */\nexport interface SolverCapabilitiesConfig {\n /** Whether this solver deployment offers timelock approval. Unset means unspecified; consumers may discover support. */\n timelockApproval?: boolean;\n /**\n * Whether the solver supports closing a whole market + side group of quotes in\n * one flow. Enigma (Virtual-Account isolation, one VA per market + side)\n * supports it; rasa (cross-margin) does not. Default `false`.\n */\n groupClose?: boolean;\n /**\n * Whether the solver supports LIMIT orders — placing a pending open at a\n * user-set price. Majors (rasa) support it; enigma (lowcap) does not. Default\n * `false`.\n */\n limitOrder?: boolean;\n /**\n * Whether this solver's markets are the lowcap **Pools** (listing service).\n * Purely declarative: the SDK's listing functions resolve the listing backend\n * **at chain level** ({@link SymmioChainConfig.listing}) and do **not** gate on\n * this flag. It exists so config can express which solvers do listing, readable\n * via `getSolverCapabilities`. Enigma (lowcap) declares it; rasa does not.\n * Default `false`.\n */\n listingService?: boolean;\n}\n\nexport interface SymmioSolverConfig {\n /** Human-readable solver name */\n name: string;\n /** Solver's on-chain address (used as `partyB` in `sendQuote`) */\n address: Address;\n /** Solver / hedger API base URL */\n url: string;\n /** Optional TP/SL handler — solver supports conditional orders only when set. */\n tpsl?: SymmioTpSlConfig;\n /**\n * Price source for **this solver's** markets. Falls back to the chain's\n * {@link SymmioChainConfig.priceService} when omitted, so set it only where a\n * solver diverges from the chain default — do not duplicate the default.\n *\n * Needed because a chain may register several solvers that price differently:\n * a lowcap solver reads its own price service while a majors solver reads\n * Binance. A single chain-level value cannot be right for both.\n */\n priceService?: SymmioPriceServiceConfig;\n /**\n * Notifications endpoint for **this solver's** position/quote state stream and\n * history search. Required per solver: notifications are inherently\n * solver-specific — the enigma `channel` and the rasa position-state URL are\n * the solver's own — so there is no chain-level default to inherit.\n */\n notifications: SymmioNotificationsConfig;\n /**\n * Optional per-solver capability flags. Gate SDK flows and UI on these\n * ({@link SolverCapabilitiesConfig}); unset flags default to `false`.\n */\n capabilities?: SolverCapabilitiesConfig;\n}\n\n/**\n * A {@link SymmioSolverConfig} resolved from the registry, with its `id`\n * attached. The `id` is the solver's kind (`\"enigma\" | \"rasa\"`) and drives\n * per-kind dispatch inside solver actions. Returned by `config.getSolver`.\n */\nexport interface SymmioResolvedSolver extends SymmioSolverConfig {\n /** The resolved solver id — equal to its kind. */\n id: SolverId;\n}\n\n/**\n * TP/SL (Conditional Order Handler) configuration for a solver.\n *\n * The handler is an off-chain service that signs and executes\n * `requestToClosePosition` calls when the user's TP/SL trigger fires. To\n * authorize it, every user must grant a delegation to {@link cohWalletAddress}\n * for the standard instant-trade selectors.\n */\nexport interface SymmioTpSlConfig {\n /** Handler REST root URL (no `/api/v5/` suffix — orval-generated paths add it). */\n url: string;\n /** Handler WebSocket URL — enigma-protocol notifications scoped by `appName`. */\n wsUrl: string;\n /** `App-Name` header value, e.g. `Arbitrum_COH_Production`. */\n appName: string;\n /** COH wallet address that must be granted delegation to execute TP/SL orders. */\n cohWalletAddress: Address;\n}\n\n/**\n * The price providers the SDK ships a client for. Closed: it drives exhaustive\n * dispatch in `getMarkPrices` / `watchPrices`, and `createConfig` validates every\n * configured price service against it (`assertSupportedPriceServiceType` in\n * `price-service-support.ts`). To add a provider, append it here and ship its\n * adapter + dispatch in the same change.\n *\n * @internal\n */\nexport const SUPPORTED_PRICE_SERVICE_TYPES = [\"enigma\", \"binance\"] as const;\n\n/**\n * Supported price-service providers.\n *\n * A **second, independent axis** from {@link SymmioSolverKind}: a Rasa solver is\n * priced off Binance today, and nothing in the type system ties the two\n * together. The provider is *derived* from `{ chainId, solverId }` via\n * `solver.priceService ?? chain.priceService` — never selected per call.\n */\nexport type SymmioPriceServiceType = (typeof SUPPORTED_PRICE_SERVICE_TYPES)[number];\n\n/**\n * Price-service configuration for a SYMMIO chain deployment.\n *\n * Both URLs stay **required, including for Binance**. Binance's endpoints are\n * public constants, but keeping them in config is the geo-restriction escape\n * hatch: an integrator whose users are in a blocked region repoints both at\n * their own proxy with no SDK change.\n */\nexport interface SymmioPriceServiceConfig {\n /** Price-service provider type. Selects which client the SDK uses. */\n type: SymmioPriceServiceType;\n /**\n * REST host root, no trailing slash — the client appends the provider's path.\n * `enigma`: `https://lowcap-price.enigma.bz` (+ `/api/v1/prices/names`).\n * `binance`: `https://fapi.binance.com` (+ `/fapi/v1/premiumIndex`).\n */\n url: string;\n /**\n * **Full** WebSocket endpoint — the exact URL the SDK dials, identically for\n * every provider, so nothing downstream needs to know which provider it holds.\n * `enigma`: `wss://lowcap-price.enigma.bz/ws`.\n * `binance`: `wss://fstream.binance.com/market/ws/!markPrice@arr@1s`.\n */\n wsUrl: string;\n}\n\n/**\n * Wire protocol a notifications endpoint speaks. Closed: it drives exhaustive\n * dispatch in `watchNotifications` / `parseNotificationFrame`; to add a\n * protocol, append it here and ship its subscribe + parse path in the same\n * change.\n *\n * - `enigma` — the lowcap solver endpoint (`…/ws/v1/subscribe`). Subscribes\n * with a `channel_patterns` frame and wraps each push as `{ data, address }`.\n * - `rasa` — the Rasa position-state endpoint (`…/ws/position-state-ws3`).\n * Subscribes with an `{ address: [...] }` frame (one socket can carry many\n * SubAccounts) and pushes bare notification frames, no envelope.\n */\nexport type SymmioNotificationsProtocol = \"enigma\" | \"rasa\";\n\n/**\n * Fields every notifications endpoint shares, regardless of wire protocol.\n */\ninterface SymmioNotificationsConfigBase {\n /** Notifications WebSocket URL (`wss://…`). */\n url: string;\n /**\n * Base URL of the notification REST service that backs `searchNotifications`\n * (`POST /api/v1/search`), e.g. `https://notification.rasa.capital`.\n * Optional — when unset, `searchNotifications` requires a per-call `baseUrl`.\n */\n searchUrl?: string;\n}\n\n/**\n * Notifications endpoint speaking the `enigma` protocol (the lowcap\n * solver's channel-scoped stream).\n */\nexport interface SymmioEnigmaNotificationsConfig extends SymmioNotificationsConfigBase {\n /** Wire protocol the endpoint speaks. */\n protocol: \"enigma\";\n /** Channel / `app_name` the subscribe frame targets on this endpoint. */\n channel: string;\n}\n\n/**\n * Notifications endpoint speaking the `rasa` position-state protocol. No\n * channel — the subscribe frame is just the watched SubAccount addresses.\n */\nexport interface SymmioRasaNotificationsConfig extends SymmioNotificationsConfigBase {\n /** Wire protocol the endpoint speaks. */\n protocol: \"rasa\";\n}\n\n/**\n * Notifications WebSocket configuration for a SYMMIO chain deployment.\n *\n * The notifications endpoint streams position/quote state transitions (instant\n * open/close confirmations, fills, cancels, liquidations) for a SubAccount. It\n * is a push channel, not a REST endpoint — `url` is a `ws://`/`wss://` URL.\n * Discriminated on `protocol`; narrow to reach protocol-specific fields\n * (e.g. the enigma `channel`).\n */\nexport type SymmioNotificationsConfig = SymmioEnigmaNotificationsConfig | SymmioRasaNotificationsConfig;\n\n/**\n * Muon oracle configuration for a SYMMIO chain deployment.\n *\n * The Muon network signs off-chain values (e.g. a party's unrealized PnL) that\n * the contracts verify on-chain — `removeMargin` requires such a signature. The\n * gateway is a query-param REST endpoint with no OpenAPI spec; `urls` are tried\n * in order until one returns a successful attestation.\n *\n * @see {@link https://docs.symm.io/api-endpoints-and-deployments/muon-api}\n */\nexport interface SymmioMuonConfig {\n /** Muon oracle gateway base URLs, tried in order (fallback on failure). */\n urls: readonly string[];\n}\n\n/**\n * Pools **listing backend** configuration for a SYMMIO chain deployment.\n *\n * The listing backend is an auth'd REST service that owns the lowcap Pools flow\n * — the pool catalogue, per-pool stats, a user's stake/rewards, and the\n * create/deposit/withdraw/claim actions. It is chain-level: one listing backend\n * is served per chain (a chain has at most one), with no solver or capability\n * involved. Present only where Pools is available (Enigma on Arbitrum); omitted\n * elsewhere.\n *\n * One deployment serves listings whose collateral was deposited on **several**\n * chains — a catalogue row's `chainId` is the token's deposit chain, which is\n * not the chain the resulting market trades on.\n */\nexport interface SymmioListingConfig {\n /**\n * Listing backend **host root** — no version segment and no trailing slash\n * (e.g. `https://listing85.enigma.bz`, staging\n * `https://listing-staging.enigma.bz`).\n *\n * The generated client's own paths already begin with `/v2`, so a versioned\n * base URL here would request `/v2/v2/market/search` and 404. Point this at\n * staging with a `createConfig` override — there is no separate environment\n * axis.\n */\n url: string;\n}\n\n/**\n * Inventory-service configuration for a SYMMIO chain deployment.\n *\n * The inventory service is the custody backend behind the lowcap Pools: it holds\n * the per-market token and collateral inventory that backs trading, and reports\n * the system-wide TVL those balances add up to. It is a **separate vendor** from\n * both the solver and the {@link SymmioListingConfig} listing backend, with its\n * own deployment and its own OpenAPI spec.\n *\n * Chain-level and optional, like `listing`: present where lowcap Pools are\n * available, omitted elsewhere.\n */\nexport interface SymmioInventoryConfig {\n /**\n * Inventory service **host root** — no path segment and no trailing slash\n * (e.g. `https://inventory85.enigma.bz`, staging\n * `https://inventory-staging.enigma.bz`).\n *\n * The generated client's own paths already begin with `/api/v1`, so appending\n * `/api` here would request `/api/api/v1/...` and 404.\n */\n url: string;\n}\n\n/**\n * Failure policy for the transparent gasless execution mode, applied when the\n * relay definitively rejects a request **before** it is accepted (a 4xx, or a\n * pre-broadcast `rejected`).\n *\n * - `\"error\"` (default): surface a typed error; the consumer decides what to do.\n * - `\"wallet\"`: silently fall back to the normal gas-paid wallet path.\n *\n * After the service accepts a request (HTTP 202) no fallback ever happens — the\n * relayed transaction may still execute, and a wallet retry would duplicate it.\n */\nexport type GaslessFallback = \"error\" | \"wallet\";\n\n/**\n * Defaults governing how existing contract writes dispatch when the transparent\n * gasless execution mode is active. Every field can be overridden per call via\n * the `gasless` write parameter.\n */\nexport interface GaslessExecutionConfig {\n /**\n * `\"wallet\"` (default): writes go through the connected wallet as always.\n * `\"gasless\"`: relayable writes are signed as InstantLayer operations and\n * relayed through GaslessQ; non-relayable writes keep the wallet path.\n */\n mode?: \"wallet\" | \"gasless\";\n /** Pre-acceptance failure policy. Default `\"error\"`. */\n fallback?: GaslessFallback;\n /**\n * Quote the batch on-chain (the GaslessLayer's `previewFeeQuote`) before\n * prompting the user for a signature, and fail fast when the quote refuses\n * it: `GASLESS_FREE_QUOTA_EXHAUSTED` when the daily free quota is spent (the\n * one case `fallback: \"wallet\"` recovers from), `GASLESS_FEE_QUOTE_REVERTED`\n * when the contract rejects the batch, and `GASLESS_LAYER_INTERFACE_UNSUPPORTED`\n * when the GaslessLayer predates the multi-wallet interface. A quote that\n * fails for transport reasons does not block, and the quote never checks\n * affordability — the relayer's simulation is authoritative. Default `true`.\n */\n preflightFee?: boolean;\n /**\n * Verify on-chain (`isDelegationActive`) that the signing key is authorized\n * for every selector a relayed write carries before prompting the user for a\n * signature, and fail fast when a session key is missing a delegation.\n * Skipped for the sub-account's own owner, who needs no delegation.\n * Default `true`.\n */\n preflightDelegation?: boolean;\n /** Max wait for the relayer to broadcast before timing out. Default `120_000` ms. */\n broadcastTimeoutMs?: number;\n /** Status poll cadence while the request is `queued`. Default `1_500` ms. */\n queuedPollMs?: number;\n /** Status poll cadence after the request is `submitted`. Default `3_000` ms. */\n submittedPollMs?: number;\n /**\n * How long a status wait lets the gateway's stream settle before falling back\n * to its first HTTP read. It ends early the moment the stream delivers, or\n * reports that it will not (unreachable, not-found, at its subscription cap,\n * disabled). Ignored where the stream is off. Default `1_000` ms.\n */\n streamSettleMs?: number;\n /**\n * How long a delivering stream may report nothing about a workflow before the\n * wait takes one HTTP read anyway and re-arms. Heartbeats do not count — only\n * records for the request do. Default `15_000` ms.\n */\n streamStaleMs?: number;\n /**\n * HTTP timeout for each gasless submit, in ms: every relay and\n * deposit-settlement POST, from the explicit actions as well as the\n * transparent mode. A submit that times out is ambiguous (the gateway may\n * already have accepted it) and fails like a network error, with status `0`.\n * Status reads are not bounded by it. Default `30_000`.\n */\n submitTimeoutMs?: number;\n /**\n * Lifecycle observer for relayed writes — fires at `accepted`, `broadcast`,\n * and `terminal`. Persist request ids in the `accepted` event so in-flight\n * workflows survive reloads.\n */\n onEvent?: (event: GaslessRelayEvent) => void;\n}\n\n/**\n * Status-stream availability for one GaslessQ deployment. It is a deployment\n * fact, like the URL. Status WebSockets are optional and disabled by default at\n * the gateway, and each environment enables them separately, so a stream is\n * declared per chain rather than assumed.\n *\n * Where it is enabled, the stream is the primary transport for status waits and\n * HTTP reads become the fallback: a wait subscribes, gives the stream\n * `execution.streamSettleMs` to deliver, and polls only while the stream is not\n * delivering. HTTP status reads stay available whether or not a stream is\n * declared.\n */\nexport interface SymmioGaslessStatusStreamConfig {\n /**\n * Whether this deployment serves the status WebSocket. Set it to `true` only\n * once the operators confirm streams for this environment and protocol\n * instance. A staging confirmation does not cover production.\n */\n enabled: boolean;\n /**\n * The gateway's `https://` origin, used to locate the stream when `url` is a\n * proxy root, because a proxy that forwards HTTP cannot be assumed to forward\n * WebSockets. Omit it for the gateway `url` forms, whose stream endpoint\n * derives from `url` itself.\n */\n origin?: string;\n}\n\n/**\n * Context supplied to {@link SymmioGaslessConfig.getRequestHeaders} for each HTTP attempt.\n * Applications must also bind their own deployment and authentication identity;\n * a chain id alone does not distinguish deployments sharing a chain.\n */\nexport interface GaslessRequestContext {\n /** Chain selected for the request. */\n chainId: number;\n /** Gasless sub-service addressed by the request. */\n service: \"operations\" | \"deposits\";\n /** HTTP method of this attempt. */\n method: \"GET\" | \"POST\";\n}\n\n/**\n * Chain-level configuration for the GaslessQ relayer service.\n *\n * GaslessQ relays user-signed InstantLayer operations so account actions need\n * no native gas: the relayer broadcasts and pays, and the **GaslessLayer**\n * contract charges an operational fee from the user's SYMMIO collateral in the\n * same atomic transaction. Optional and chain-level, like `listing`: present\n * only on perps-core (`\"0.8.6\"`) chains with a GaslessLayer deployment.\n * Resolve it with `resolveGaslessService` / gate on `supportsGaslessService`.\n *\n * The gateway serves anonymous clients by default, so a browser app can call it\n * directly with no `apiKey`, as long as the deployment allows the app's Origin\n * and has not disabled anonymous access.\n */\nexport interface SymmioGaslessConfig {\n /**\n * Resolve application-owned HTTP headers immediately before each GET or POST\n * attempt, including retries and exact resubmissions. Useful for an\n * authenticated application proxy. Values override `apiKey` case-insensitively;\n * the SDK retains its JSON Accept and Content-Type headers.\n *\n * Rejection aborts that attempt with `GASLESS_REQUEST_HEADERS_FAILED` without\n * exposing the callback's error or credentials. An earlier uncertain submit\n * remains uncertain. Headers never enter submission snapshots or WebSockets.\n *\n * @param context - Chain, service and HTTP method for this attempt.\n * @returns Fresh headers, synchronously or asynchronously.\n * @example\n * ```ts\n * getRequestHeaders: async () => ({ Authorization: `Bearer ${await getToken()}` })\n * ```\n */\n getRequestHeaders?: (\n context: GaslessRequestContext,\n ) => Readonly<Record<string, string>> | Promise<Readonly<Record<string, string>>>;\n /**\n * Where the SDK reaches the GaslessQ gateway. One of:\n *\n * - the gateway **origin** (`https://host`, no path) with `protocolInstance`,\n * the recommended form. The SDK derives\n * `/v1/instances/{protocolInstance}/{operations|deposits}`.\n * - an **instance root** (`…/v1/instances/<protocol-instance>`). The SDK\n * appends `/{service}`.\n * - an **instance-pinned service base**\n * (`…/v1/instances/<protocol-instance>/operations` or `…/deposits`), used\n * as-is and for that one service only.\n * - any other path, absolute or relative, is a **proxy root** (for example a\n * server-side proxy at `/api/gasless`). The SDK appends `/{service}`.\n *\n * The instance-less `/v1/operations` and `/v1/deposits` compatibility routes\n * are rejected with `GASLESS_URL_LEGACY_ROUTE`: the gateway is retiring them,\n * and they pin no instance to verify responses against. A query string, a\n * fragment, credentials (`user:password@`) or a non-HTTP(S) scheme is\n * rejected with `GASLESS_URL_INVALID`.\n */\n url: string;\n /**\n * Protocol-instance key selecting the deployment at the gateway\n * (`\"<protocol-instance>\"`, from the deployment handoff). Staging and\n * production can share a chain id, so the key, not the chain, picks the\n * contracts.\n *\n * Required with an origin `url` (`GASLESS_PROTOCOL_INSTANCE_REQUIRED`). With\n * an instance root or service base it may be omitted, but when given it must\n * equal the instance the path pins (`GASLESS_PROTOCOL_INSTANCE_CONFLICT`).\n * With a proxy root it is the instance successful responses are checked\n * against, whenever the proxy forwards the `X-GasLessQ-Protocol-Instance`\n * header.\n */\n protocolInstance?: string;\n /**\n * The GaslessLayer proxy address — the operational-fee charger and the\n * source of every gasless read (wallet addresses, deposit policy, fee\n * quotes, nonces). A deployment fact with **no runtime discovery**: update it\n * on every gateway redeploy. It must run the multi-wallet GaslessLayer\n * interface (`walletId`-scoped reads, `previewFeeQuote`); a proxy that has not\n * been upgraded to it is unsupported, and its fee quote throws\n * `GASLESS_LAYER_INTERFACE_UNSUPPORTED`.\n */\n gaslessLayerAddress: Address;\n /**\n * Optional partner key, sent as `Authorization: Bearer <key>`. Omit it to use\n * the gateway's anonymous profile, which is on by default: 10 requests per\n * second per caller IP and protocol instance, shared across operations and\n * deposits, with no `Authorization` header sent at all. Where anonymous access\n * is on, a key only raises the gateway limits. A deployment can turn it off,\n * and then answers keyless requests with `401`, so a key is required there. A\n * key must be authorized for the protocol instance and service it calls, and\n * it changes neither fees, wallet selection nor signatures.\n *\n * Meant for servers and backend-for-frontend proxies. **Never ship a key in a\n * browser bundle**, where anyone can read it. An invalid, disabled or\n * unauthorized key is rejected (`401` / `403`) and never falls back to\n * anonymous access. Errors the SDK throws never carry the key.\n */\n apiKey?: string;\n /**\n * Status-stream availability for this deployment. Omitted, the deployment is\n * treated as serving no stream.\n */\n statusStream?: SymmioGaslessStatusStreamConfig;\n /** Transparent execution-mode defaults for existing contract writes. */\n execution?: GaslessExecutionConfig;\n}\n\n/**\n * The perps-core contracts generation a chain's deployment runs.\n *\n * A **deployment fact, declared per chain** — it is not probed at runtime (the\n * diamond exposes no version view). It drives the version-sensitive seams the\n * SDK carries for serving mixed-generation chains from one release: which\n * quote-send call the instant-open flow signs (`sendQuote` with solver-fee caps\n * on `\"0.8.6\"`, the legacy `sendQuoteWithAffiliateAndData` on `\"0.8.5\"`), which\n * selector the session-key delegation set includes, and which output shape the\n * withdraw-request reads decode.\n */\nexport type SymmioContractsVersion = \"0.8.5\" | \"0.8.6\";\n\n/**\n * Complete resolved configuration for a SYMMIO chain deployment.\n */\nexport interface SymmioChainConfig {\n /** Chain ID */\n chainId: number;\n /** Contracts generation deployed on this chain. See {@link SymmioContractsVersion}. */\n contractsVersion: SymmioContractsVersion;\n /** Explicit deployment capability. `false` disables timelock calls; omitted means unknown. */\n timelockSupported?: boolean;\n /** Contract addresses */\n addresses: SymmioContractAddresses;\n /** Subgraph endpoints */\n subgraphs: SymmioSubgraphUrls;\n /**\n * Solvers available on this chain, keyed by {@link SolverId} (which is the\n * solver's kind). A chain registers a subset of the kinds, so this is partial.\n * Resolve one with `config.getSolver({ chainId, solverId })`, which defaults to\n * {@link defaultSolverId} when `solverId` is omitted.\n */\n solvers: Partial<Record<SolverId, SymmioSolverConfig>>;\n /** Id of the solver an action targets on this chain when `solverId` is omitted. */\n defaultSolverId: SolverId;\n /** Price-service configuration */\n priceService: SymmioPriceServiceConfig;\n /** Muon oracle configuration */\n muon: SymmioMuonConfig;\n /**\n * Optional Pools listing backend, served per chain. Set on chains where the\n * lowcap Pools flow is available (Enigma on Arbitrum); omitted elsewhere.\n * Resolve it with `resolveListingService` / gate on `supportsListingService`.\n */\n listing?: SymmioListingConfig;\n /**\n * Optional inventory service — the custody backend behind lowcap Pools, and\n * the source of system-wide TVL. Set alongside {@link SymmioChainConfig.listing};\n * resolve it with `resolveInventoryService`.\n */\n inventory?: SymmioInventoryConfig;\n /**\n * Optional GaslessQ relayer service. Set on perps-core (`\"0.8.6\"`) chains\n * with a GaslessLayer deployment; omitted elsewhere. Resolve it with\n * `resolveGaslessService` / gate on `supportsGaslessService`.\n */\n gasless?: SymmioGaslessConfig;\n}\n"],"mappings":";AAuDA,IAAa,IAAyB,CAAC,UAAU,MAAM,GAgI1C,IAAgC,CAAC,UAAU,SAAS"}
@@ -11,10 +11,12 @@ function r(e) {
11
11
  return r;
12
12
  }
13
13
  function i(e, t) {
14
+ let n = t.addresses?.accountLayerAddress !== void 0 && t.addresses.accountLayerAddress.toLowerCase() !== e.addresses.accountLayerAddress.toLowerCase(), { timelockSupported: r, ...i } = e, o = t.timelockSupported ?? (n ? void 0 : r);
14
15
  return {
15
- ...e,
16
+ ...i,
16
17
  ...t.chainId === void 0 ? {} : { chainId: t.chainId },
17
18
  contractsVersion: t.contractsVersion ?? e.contractsVersion,
19
+ ...o === void 0 ? {} : { timelockSupported: o },
18
20
  addresses: {
19
21
  ...e.addresses,
20
22
  ...t.addresses
@@ -40,13 +42,14 @@ function a(t, n, r) {
40
42
  let s = r.execution || n?.execution ? {
41
43
  ...n?.execution ?? {},
42
44
  ...r.execution ?? {}
43
- } : void 0, c = r.protocolInstance ?? n?.protocolInstance, l = r.apiKey ?? n?.apiKey, u = o(t, n?.statusStream, r.statusStream);
45
+ } : void 0, c = r.protocolInstance ?? n?.protocolInstance, l = r.apiKey ?? n?.apiKey, u = r.getRequestHeaders ?? n?.getRequestHeaders, d = o(t, n?.statusStream, r.statusStream);
44
46
  return { gasless: {
45
47
  url: i,
46
48
  gaslessLayerAddress: a,
47
49
  ...c === void 0 ? {} : { protocolInstance: c },
48
50
  ...l === void 0 ? {} : { apiKey: l },
49
- ...u ? { statusStream: u } : {},
51
+ ...u === void 0 ? {} : { getRequestHeaders: u },
52
+ ...d ? { statusStream: d } : {},
50
53
  ...s ? { execution: s } : {}
51
54
  } };
52
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"merge-chain-config.js","names":[],"sources":["../../../src/core/config/merge-chain-config.ts"],"sourcesContent":["import { SymmError } from \"../../shared/errors/symm-error\";\nimport type { DeepPartial } from \"../../shared/types/properties\";\nimport {\n getChainConfig,\n listSupportedChains,\n type GaslessExecutionConfig,\n type SolverCapabilitiesConfig,\n type SolverId,\n type SymmioChainConfig,\n type SymmioGaslessConfig,\n type SymmioGaslessStatusStreamConfig,\n type SymmioInventoryConfig,\n type SymmioListingConfig,\n type SymmioNotificationsConfig,\n type SymmioPriceServiceConfig,\n type SymmioSolverConfig,\n type SymmioTpSlConfig,\n} from \"../chains\";\n\n/**\n * Build the per-chain config registry a {@link Config} holds: every built-in\n * supported chain, deep-merged with the caller's overrides.\n *\n * @param overrides - Optional per-chain partial overrides keyed by chain id.\n * @returns A registry mapping chain id to its fully-resolved config.\n *\n * @internal\n */\nexport function buildChainConfigs(\n overrides?: Partial<Record<number, DeepPartial<SymmioChainConfig>>>,\n): Record<number, SymmioChainConfig> {\n const registry: Record<number, SymmioChainConfig> = {};\n\n for (const chainId of listSupportedChains()) {\n const base = getChainConfig(chainId);\n const override = overrides?.[chainId];\n registry[chainId] = override ? mergeChainConfig(base, override) : base;\n }\n\n return registry;\n}\n\n/**\n * Deep-merge a single chain's overrides onto its built-in defaults. Only the\n * known nested groups (`addresses`, `subgraphs`, `solvers`, `priceService`,\n * `notifications`, `muon`, `listing`, `inventory`, `gasless`) are merged; unknown keys are ignored.\n *\n * @internal\n */\nfunction mergeChainConfig(base: SymmioChainConfig, override: DeepPartial<SymmioChainConfig>): SymmioChainConfig {\n return {\n ...base,\n ...(override.chainId !== undefined ? { chainId: override.chainId } : {}),\n contractsVersion: override.contractsVersion ?? base.contractsVersion,\n addresses: { ...base.addresses, ...override.addresses },\n subgraphs: { ...base.subgraphs, ...override.subgraphs },\n solvers: mergeSolvers(base.chainId, base.solvers, override.solvers),\n defaultSolverId: override.defaultSolverId ?? base.defaultSolverId,\n priceService: mergePriceService(base.chainId, base.priceService, override.priceService),\n muon: {\n /** `urls` is replaced wholesale when overridden, otherwise inherited from base. */\n urls: override.muon?.urls ?? base.muon.urls,\n },\n ...mergeListing(base.listing, override.listing),\n ...mergeInventory(base.inventory, override.inventory),\n ...mergeGasless(base.chainId, base.gasless, override.gasless),\n };\n}\n\n/**\n * Merge a GaslessQ service override onto its base.\n *\n * Returns a partial so the key stays **absent** when neither side configures\n * the service (same invariant as {@link mergeListing}). With a base, fields\n * merge one by one and the nested `execution` and `statusStream` blocks\n * deep-merge. With no base, the override must be a complete block — `url` and\n * `gaslessLayerAddress` are both required, since there is nothing to inherit\n * them from and a half-built block would only fail later, at request time, with\n * a confusing error.\n *\n * @throws {SymmError} `GASLESS_OVERRIDE_INCOMPLETE` when a base-less override\n * omits `url` or `gaslessLayerAddress`, or when a `statusStream` sets\n * `origin` with no `enabled` to inherit.\n */\nfunction mergeGasless(\n chainId: number,\n base: SymmioGaslessConfig | undefined,\n override: DeepPartial<SymmioGaslessConfig> | undefined,\n): Pick<SymmioChainConfig, \"gasless\"> | Record<string, never> {\n if (!base && !override) return {};\n if (!override) return { gasless: base };\n\n const url = override.url ?? base?.url;\n const gaslessLayerAddress = override.gaslessLayerAddress ?? base?.gaslessLayerAddress;\n if (url === undefined || gaslessLayerAddress === undefined) {\n throw new SymmError(\n \"config\",\n \"GASLESS_OVERRIDE_INCOMPLETE\",\n `createConfig: the gasless override for chain ${chainId} must declare ${url === undefined ? \"`url`\" : \"`gaslessLayerAddress`\"} — there is no built-in gasless config to inherit it from.`,\n );\n }\n\n const execution =\n override.execution || base?.execution\n ? { ...(base?.execution ?? {}), ...((override.execution ?? {}) as GaslessExecutionConfig) }\n : undefined;\n\n const protocolInstance = override.protocolInstance ?? base?.protocolInstance;\n const apiKey = override.apiKey ?? base?.apiKey;\n const statusStream = mergeGaslessStatusStream(chainId, base?.statusStream, override.statusStream);\n\n return {\n gasless: {\n url,\n gaslessLayerAddress,\n ...(protocolInstance !== undefined ? { protocolInstance } : {}),\n ...(apiKey !== undefined ? { apiKey } : {}),\n ...(statusStream ? { statusStream } : {}),\n ...(execution ? { execution } : {}),\n },\n };\n}\n\n/**\n * Merge a gasless `statusStream` override onto its base, field by field, so an\n * override that restates only `origin` keeps the base's `enabled` (and an\n * explicit `undefined` never erases a base value).\n *\n * The block stays absent when neither side declares a field. `enabled` has no\n * default: an `origin` with nothing to inherit `enabled` from is a half-built\n * block, and silently reading it as \"disabled\" would hide the mistake.\n *\n * @throws {SymmError} `GASLESS_OVERRIDE_INCOMPLETE` when the merged block has\n * an `origin` but no `enabled`.\n */\nfunction mergeGaslessStatusStream(\n chainId: number,\n base?: SymmioGaslessStatusStreamConfig,\n override?: DeepPartial<SymmioGaslessStatusStreamConfig>,\n): SymmioGaslessStatusStreamConfig | undefined {\n const enabled = override?.enabled ?? base?.enabled;\n const origin = override?.origin ?? base?.origin;\n if (enabled === undefined) {\n if (origin === undefined) return undefined;\n throw new SymmError(\n \"config\",\n \"GASLESS_OVERRIDE_INCOMPLETE\",\n `createConfig: the gasless statusStream override for chain ${chainId} sets \\`origin\\` but not \\`enabled\\` — there is no statusStream block to inherit it from.`,\n );\n }\n return { enabled, ...(origin !== undefined ? { origin } : {}) };\n}\n\n/**\n * Merge an inventory-service override onto its base. Mirrors\n * {@link mergeListing}: returns a partial so the key stays **absent** when\n * neither side configures the service.\n */\nfunction mergeInventory(\n base: SymmioInventoryConfig | undefined,\n override: DeepPartial<SymmioInventoryConfig> | undefined,\n): Pick<SymmioChainConfig, \"inventory\"> | Record<string, never> {\n const url = override?.url ?? base?.url;\n return url === undefined ? {} : { inventory: { url } };\n}\n\n/**\n * Merge a listing-service override onto its base.\n *\n * Returns a partial so the key stays **absent** when neither side configures the\n * service — an explicit `listing: undefined` would still be an own property and\n * would read as \"configured but empty\" to anything doing a key check.\n */\nfunction mergeListing(\n base: SymmioListingConfig | undefined,\n override: DeepPartial<SymmioListingConfig> | undefined,\n): Pick<SymmioChainConfig, \"listing\"> | Record<string, never> {\n const url = override?.url ?? base?.url;\n return url === undefined ? {} : { listing: { url } };\n}\n\n/**\n * Merge a price-service override onto its base.\n *\n * A plain spread is wrong once more than one provider exists: an override that\n * switches `type` without restating both URLs would inherit the *previous*\n * provider's endpoints, pointing one provider's client at another's host. That\n * type-checks cleanly and fails at runtime as a confusing 404, so a `type` swap\n * is required to supply the whole block.\n *\n * A same-type (or type-less) override still merges field-by-field, so the common\n * `{ url, wsUrl }` staging override keeps working.\n *\n * @throws {SymmError} `PRICE_SERVICE_OVERRIDE_INCOMPLETE` when the override\n * changes `type` but omits `url` or `wsUrl`.\n */\nfunction mergePriceService(\n chainId: number,\n base: SymmioPriceServiceConfig,\n override: DeepPartial<SymmioPriceServiceConfig> | undefined,\n): SymmioPriceServiceConfig {\n if (!override) return base;\n\n const merged = { ...base, ...override } as SymmioPriceServiceConfig;\n const swapsProvider = override.type !== undefined && override.type !== base.type;\n if (swapsProvider && (override.url === undefined || override.wsUrl === undefined)) {\n throw new SymmError(\n \"config\",\n \"PRICE_SERVICE_OVERRIDE_INCOMPLETE\",\n `createConfig: the priceService override for chain ${chainId} changes type from \"${base.type}\" to \"${override.type}\" but omits ${override.url === undefined ? \"`url`\" : \"`wsUrl`\"}. Supply both URLs when switching provider — inheriting the previous provider's endpoints would point the \"${override.type}\" client at \"${base.type}\" hosts.`,\n );\n }\n return merged;\n}\n\n/**\n * Merge a notifications override onto its base.\n *\n * Same trap as {@link mergePriceService}: once the config is a per-protocol\n * union, an override that switches `protocol` without restating the endpoint\n * would inherit the *previous* protocol's fields — a `rasa → enigma` swap\n * without a `channel` (or either swap without a `url`) type-checks as a\n * `DeepPartial` and fails at runtime. So a `protocol` swap must supply the\n * whole block; a same-protocol override still merges field-by-field.\n *\n * A swap takes the override block **alone** — nothing is inherited, including\n * the optional `searchUrl` (the previous protocol's REST search service does\n * not index the new protocol's stream).\n *\n * @throws {SymmError} `NOTIFICATIONS_OVERRIDE_INCOMPLETE` when the override\n * changes `protocol` but omits `url`, or targets `enigma` without a\n * `channel`.\n */\nfunction mergeNotifications(\n chainId: number,\n base: SymmioNotificationsConfig,\n override: DeepPartial<SymmioNotificationsConfig> | undefined,\n): SymmioNotificationsConfig {\n if (!override) return base;\n\n const swapsProtocol = override.protocol !== undefined && override.protocol !== base.protocol;\n if (swapsProtocol) {\n const missing =\n override.url === undefined\n ? \"`url`\"\n : override.protocol === \"enigma\" && (override as { channel?: string }).channel === undefined\n ? \"`channel`\"\n : null;\n if (missing) {\n throw new SymmError(\n \"config\",\n \"NOTIFICATIONS_OVERRIDE_INCOMPLETE\",\n `createConfig: the notifications override for chain ${chainId} changes protocol from \"${base.protocol}\" to \"${override.protocol}\" but omits ${missing}. Supply the whole block when switching protocol — inheriting the previous protocol's fields would point the \"${override.protocol}\" subscriber at \"${base.protocol}\" endpoints.`,\n );\n }\n return { ...override } as SymmioNotificationsConfig;\n }\n\n const merged = { ...base, ...override } as SymmioNotificationsConfig;\n if (merged.protocol === \"rasa\") {\n // A cast override could still sneak a `channel` key onto the rasa variant.\n delete (merged as { channel?: string }).channel;\n }\n return merged;\n}\n\n/**\n * Merge a per-chain solver map by id: each overridden solver is deep-merged onto\n * its base (or added when the id is new). Solvers the override does not mention\n * are inherited unchanged.\n */\nfunction mergeSolvers(\n chainId: number,\n base: Partial<Record<SolverId, SymmioSolverConfig>>,\n override: DeepPartial<Record<SolverId, SymmioSolverConfig>> | undefined,\n): Partial<Record<SolverId, SymmioSolverConfig>> {\n if (!override) return base;\n const merged: Partial<Record<SolverId, SymmioSolverConfig>> = { ...base };\n for (const [id, solverOverride] of Object.entries(override) as [SolverId, DeepPartial<SymmioSolverConfig>][]) {\n if (!solverOverride) continue;\n merged[id] = mergeSolver(chainId, base[id], solverOverride);\n }\n return merged;\n}\n\n/**\n * Merge one solver's fields. The optional nested `tpsl` and `priceService` blocks\n * are deep-merged so a partial override (e.g. only the `url`) keeps the base's\n * other fields. When neither base nor override declares a block, it stays absent\n * — for `priceService` that absence is meaningful: it is what makes the solver\n * fall back to the chain-level price service.\n */\nfunction mergeSolver(\n chainId: number,\n base: SymmioSolverConfig | undefined,\n override: DeepPartial<SymmioSolverConfig>,\n): SymmioSolverConfig {\n const merged = { ...(base ?? {}), ...(override as Partial<SymmioSolverConfig>) } as SymmioSolverConfig;\n\n const overrideTpsl = override.tpsl;\n if (overrideTpsl) {\n merged.tpsl = {\n ...(base?.tpsl ?? ({} as SymmioTpSlConfig)),\n ...(overrideTpsl as Partial<SymmioTpSlConfig>),\n } as SymmioTpSlConfig;\n } else if (base?.tpsl) {\n merged.tpsl = base.tpsl;\n } else {\n delete merged.tpsl;\n }\n\n const overridePriceService = override.priceService;\n if (overridePriceService) {\n // With no base block there is nothing to inherit, so the override must be\n // complete — route it through the same type-swap guard by treating it as a\n // swap away from the base (or chain) provider.\n merged.priceService = base?.priceService\n ? mergePriceService(chainId, base.priceService, overridePriceService)\n : assertCompletePriceService(chainId, overridePriceService);\n } else if (base?.priceService) {\n merged.priceService = base.priceService;\n } else {\n delete merged.priceService;\n }\n\n const overrideNotifications = override.notifications;\n if (overrideNotifications) {\n // With a base solver, deep-merge (same protocol-swap guard as the chain path\n // used to apply). With no base, the override must be a complete block.\n merged.notifications = base?.notifications\n ? mergeNotifications(chainId, base.notifications, overrideNotifications)\n : assertCompleteNotifications(chainId, overrideNotifications);\n } else if (base?.notifications) {\n merged.notifications = base.notifications;\n } else {\n throw new SymmError(\n \"config\",\n \"SOLVER_NOTIFICATIONS_REQUIRED\",\n `createConfig: a new solver on chain ${chainId} added via symmioConfig must declare a \\`notifications\\` block — it is required per solver and there is no base to inherit it from.`,\n );\n }\n\n const overrideCapabilities = override.capabilities;\n if (overrideCapabilities) {\n merged.capabilities = {\n ...(base?.capabilities ?? {}),\n ...(overrideCapabilities as SolverCapabilitiesConfig),\n };\n } else if (base?.capabilities) {\n merged.capabilities = base.capabilities;\n } else {\n delete merged.capabilities;\n }\n\n return merged;\n}\n\n/**\n * Validate a solver-nested price service that has no base to inherit from: every\n * field must be present, since there is nothing to fall back to.\n *\n * @throws {SymmError} `PRICE_SERVICE_OVERRIDE_INCOMPLETE`\n */\nfunction assertCompletePriceService(\n chainId: number,\n override: DeepPartial<SymmioPriceServiceConfig>,\n): SymmioPriceServiceConfig {\n if (override.type === undefined || override.url === undefined || override.wsUrl === undefined) {\n throw new SymmError(\n \"config\",\n \"PRICE_SERVICE_OVERRIDE_INCOMPLETE\",\n `createConfig: a solver-nested priceService on chain ${chainId} must declare \\`type\\`, \\`url\\` and \\`wsUrl\\` — there is no per-solver base to inherit the missing fields from. Omit the block entirely to fall back to the chain's price service.`,\n );\n }\n return override as SymmioPriceServiceConfig;\n}\n\n/**\n * Validate a solver-nested notifications block that has no base to inherit from\n * (a brand-new solver added via `symmioConfig`): `url` and `protocol` are always\n * required, and `enigma` additionally requires a `channel`.\n *\n * @throws {SymmError} `NOTIFICATIONS_OVERRIDE_INCOMPLETE`\n */\nfunction assertCompleteNotifications(\n chainId: number,\n override: DeepPartial<SymmioNotificationsConfig>,\n): SymmioNotificationsConfig {\n const missing =\n override.url === undefined\n ? \"`url`\"\n : override.protocol === undefined\n ? \"`protocol`\"\n : override.protocol === \"enigma\" && (override as { channel?: string }).channel === undefined\n ? \"`channel`\"\n : null;\n if (missing) {\n throw new SymmError(\n \"config\",\n \"NOTIFICATIONS_OVERRIDE_INCOMPLETE\",\n `createConfig: a solver-nested notifications block on chain ${chainId} must declare ${missing} — there is no per-solver base to inherit the missing fields from.`,\n );\n }\n return override as SymmioNotificationsConfig;\n}\n"],"mappings":";;;;AA4BA,SAAgB,EACd,GACmC;CACnC,IAAM,IAA8C,CAAC;CAErD,KAAK,IAAM,KAAW,EAAoB,GAAG;EAC3C,IAAM,IAAO,EAAe,CAAO,GAC7B,IAAW,IAAY;EAC7B,EAAS,KAAW,IAAW,EAAiB,GAAM,CAAQ,IAAI;CACpE;CAEA,OAAO;AACT;AASA,SAAS,EAAiB,GAAyB,GAA6D;CAC9G,OAAO;EACL,GAAG;EACH,GAAI,EAAS,YAAY,KAAA,IAA4C,CAAC,IAAjC,EAAE,SAAS,EAAS,QAAQ;EACjE,kBAAkB,EAAS,oBAAoB,EAA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,UACA,iCACA,uCAAuC,EAAQ,oIACjD;CAGF,IAAM,IAAuB,EAAS;CAYtC,OAXI,IACF,EAAO,eAAe;EACpB,GAAI,GAAM,gBAAgB,CAAC;EAC3B,GAAI;CACN,IACS,GAAM,eACf,EAAO,eAAe,EAAK,eAE3B,OAAO,EAAO,cAGT;AACT;AAQA,SAAS,EACP,GACA,GAC0B;CAC1B,IAAI,EAAS,SAAS,KAAA,KAAa,EAAS,QAAQ,KAAA,KAAa,EAAS,UAAU,KAAA,GAClF,MAAM,IAAI,EACR,UACA,qCACA,uDAAuD,EAAQ,mLACjE;CAEF,OAAO;AACT;AASA,SAAS,EACP,GACA,GAC2B;CAC3B,IAAM,IACJ,EAAS,QAAQ,KAAA,IACb,UACA,EAAS,aAAa,KAAA,IACpB,eACA,EAAS,aAAa,YAAa,EAAkC,YAAY,KAAA,IAC/E,cACA;CACV,IAAI,GACF,MAAM,IAAI,EACR,UACA,qCACA,8DAA8D,EAAQ,gBAAgB,EAAQ,mEAChG;CAEF,OAAO;AACT"}
1
+ {"version":3,"file":"merge-chain-config.js","names":[],"sources":["../../../src/core/config/merge-chain-config.ts"],"sourcesContent":["import { SymmError } from \"../../shared/errors/symm-error\";\nimport type { DeepPartial } from \"../../shared/types/properties\";\nimport {\n getChainConfig,\n listSupportedChains,\n type GaslessExecutionConfig,\n type SolverCapabilitiesConfig,\n type SolverId,\n type SymmioChainConfig,\n type SymmioGaslessConfig,\n type SymmioGaslessStatusStreamConfig,\n type SymmioInventoryConfig,\n type SymmioListingConfig,\n type SymmioNotificationsConfig,\n type SymmioPriceServiceConfig,\n type SymmioSolverConfig,\n type SymmioTpSlConfig,\n} from \"../chains\";\n\n/**\n * Build the per-chain config registry a {@link Config} holds: every built-in\n * supported chain, deep-merged with the caller's overrides.\n *\n * @param overrides - Optional per-chain partial overrides keyed by chain id.\n * @returns A registry mapping chain id to its fully-resolved config.\n *\n * @internal\n */\nexport function buildChainConfigs(\n overrides?: Partial<Record<number, DeepPartial<SymmioChainConfig>>>,\n): Record<number, SymmioChainConfig> {\n const registry: Record<number, SymmioChainConfig> = {};\n\n for (const chainId of listSupportedChains()) {\n const base = getChainConfig(chainId);\n const override = overrides?.[chainId];\n registry[chainId] = override ? mergeChainConfig(base, override) : base;\n }\n\n return registry;\n}\n\n/**\n * Deep-merge a single chain's overrides onto its built-in defaults. Only the\n * known nested groups (`addresses`, `subgraphs`, `solvers`, `priceService`,\n * `notifications`, `muon`, `listing`, `inventory`, `gasless`) are merged; unknown keys are ignored.\n *\n * @internal\n */\nfunction mergeChainConfig(base: SymmioChainConfig, override: DeepPartial<SymmioChainConfig>): SymmioChainConfig {\n const accountLayerChanged =\n override.addresses?.accountLayerAddress !== undefined &&\n override.addresses.accountLayerAddress.toLowerCase() !== base.addresses.accountLayerAddress.toLowerCase();\n const { timelockSupported: baseTimelockSupported, ...baseWithoutTimelockSupport } = base;\n const timelockSupported = override.timelockSupported ?? (accountLayerChanged ? undefined : baseTimelockSupported);\n return {\n ...baseWithoutTimelockSupport,\n ...(override.chainId !== undefined ? { chainId: override.chainId } : {}),\n contractsVersion: override.contractsVersion ?? base.contractsVersion,\n ...(timelockSupported !== undefined ? { timelockSupported } : {}),\n addresses: { ...base.addresses, ...override.addresses },\n subgraphs: { ...base.subgraphs, ...override.subgraphs },\n solvers: mergeSolvers(base.chainId, base.solvers, override.solvers),\n defaultSolverId: override.defaultSolverId ?? base.defaultSolverId,\n priceService: mergePriceService(base.chainId, base.priceService, override.priceService),\n muon: {\n /** `urls` is replaced wholesale when overridden, otherwise inherited from base. */\n urls: override.muon?.urls ?? base.muon.urls,\n },\n ...mergeListing(base.listing, override.listing),\n ...mergeInventory(base.inventory, override.inventory),\n ...mergeGasless(base.chainId, base.gasless, override.gasless),\n };\n}\n\n/**\n * Merge a GaslessQ service override onto its base.\n *\n * Returns a partial so the key stays **absent** when neither side configures\n * the service (same invariant as {@link mergeListing}). With a base, fields\n * merge one by one and the nested `execution` and `statusStream` blocks\n * deep-merge. With no base, the override must be a complete block — `url` and\n * `gaslessLayerAddress` are both required, since there is nothing to inherit\n * them from and a half-built block would only fail later, at request time, with\n * a confusing error.\n *\n * @throws {SymmError} `GASLESS_OVERRIDE_INCOMPLETE` when a base-less override\n * omits `url` or `gaslessLayerAddress`, or when a `statusStream` sets\n * `origin` with no `enabled` to inherit.\n */\nfunction mergeGasless(\n chainId: number,\n base: SymmioGaslessConfig | undefined,\n override: DeepPartial<SymmioGaslessConfig> | undefined,\n): Pick<SymmioChainConfig, \"gasless\"> | Record<string, never> {\n if (!base && !override) return {};\n if (!override) return { gasless: base };\n\n const url = override.url ?? base?.url;\n const gaslessLayerAddress = override.gaslessLayerAddress ?? base?.gaslessLayerAddress;\n if (url === undefined || gaslessLayerAddress === undefined) {\n throw new SymmError(\n \"config\",\n \"GASLESS_OVERRIDE_INCOMPLETE\",\n `createConfig: the gasless override for chain ${chainId} must declare ${url === undefined ? \"`url`\" : \"`gaslessLayerAddress`\"} — there is no built-in gasless config to inherit it from.`,\n );\n }\n\n const execution =\n override.execution || base?.execution\n ? { ...(base?.execution ?? {}), ...((override.execution ?? {}) as GaslessExecutionConfig) }\n : undefined;\n\n const protocolInstance = override.protocolInstance ?? base?.protocolInstance;\n const apiKey = override.apiKey ?? base?.apiKey;\n const getRequestHeaders = override.getRequestHeaders ?? base?.getRequestHeaders;\n const statusStream = mergeGaslessStatusStream(chainId, base?.statusStream, override.statusStream);\n\n return {\n gasless: {\n url,\n gaslessLayerAddress,\n ...(protocolInstance !== undefined ? { protocolInstance } : {}),\n ...(apiKey !== undefined ? { apiKey } : {}),\n ...(getRequestHeaders !== undefined ? { getRequestHeaders } : {}),\n ...(statusStream ? { statusStream } : {}),\n ...(execution ? { execution } : {}),\n },\n };\n}\n\n/**\n * Merge a gasless `statusStream` override onto its base, field by field, so an\n * override that restates only `origin` keeps the base's `enabled` (and an\n * explicit `undefined` never erases a base value).\n *\n * The block stays absent when neither side declares a field. `enabled` has no\n * default: an `origin` with nothing to inherit `enabled` from is a half-built\n * block, and silently reading it as \"disabled\" would hide the mistake.\n *\n * @throws {SymmError} `GASLESS_OVERRIDE_INCOMPLETE` when the merged block has\n * an `origin` but no `enabled`.\n */\nfunction mergeGaslessStatusStream(\n chainId: number,\n base?: SymmioGaslessStatusStreamConfig,\n override?: DeepPartial<SymmioGaslessStatusStreamConfig>,\n): SymmioGaslessStatusStreamConfig | undefined {\n const enabled = override?.enabled ?? base?.enabled;\n const origin = override?.origin ?? base?.origin;\n if (enabled === undefined) {\n if (origin === undefined) return undefined;\n throw new SymmError(\n \"config\",\n \"GASLESS_OVERRIDE_INCOMPLETE\",\n `createConfig: the gasless statusStream override for chain ${chainId} sets \\`origin\\` but not \\`enabled\\` — there is no statusStream block to inherit it from.`,\n );\n }\n return { enabled, ...(origin !== undefined ? { origin } : {}) };\n}\n\n/**\n * Merge an inventory-service override onto its base. Mirrors\n * {@link mergeListing}: returns a partial so the key stays **absent** when\n * neither side configures the service.\n */\nfunction mergeInventory(\n base: SymmioInventoryConfig | undefined,\n override: DeepPartial<SymmioInventoryConfig> | undefined,\n): Pick<SymmioChainConfig, \"inventory\"> | Record<string, never> {\n const url = override?.url ?? base?.url;\n return url === undefined ? {} : { inventory: { url } };\n}\n\n/**\n * Merge a listing-service override onto its base.\n *\n * Returns a partial so the key stays **absent** when neither side configures the\n * service — an explicit `listing: undefined` would still be an own property and\n * would read as \"configured but empty\" to anything doing a key check.\n */\nfunction mergeListing(\n base: SymmioListingConfig | undefined,\n override: DeepPartial<SymmioListingConfig> | undefined,\n): Pick<SymmioChainConfig, \"listing\"> | Record<string, never> {\n const url = override?.url ?? base?.url;\n return url === undefined ? {} : { listing: { url } };\n}\n\n/**\n * Merge a price-service override onto its base.\n *\n * A plain spread is wrong once more than one provider exists: an override that\n * switches `type` without restating both URLs would inherit the *previous*\n * provider's endpoints, pointing one provider's client at another's host. That\n * type-checks cleanly and fails at runtime as a confusing 404, so a `type` swap\n * is required to supply the whole block.\n *\n * A same-type (or type-less) override still merges field-by-field, so the common\n * `{ url, wsUrl }` staging override keeps working.\n *\n * @throws {SymmError} `PRICE_SERVICE_OVERRIDE_INCOMPLETE` when the override\n * changes `type` but omits `url` or `wsUrl`.\n */\nfunction mergePriceService(\n chainId: number,\n base: SymmioPriceServiceConfig,\n override: DeepPartial<SymmioPriceServiceConfig> | undefined,\n): SymmioPriceServiceConfig {\n if (!override) return base;\n\n const merged = { ...base, ...override } as SymmioPriceServiceConfig;\n const swapsProvider = override.type !== undefined && override.type !== base.type;\n if (swapsProvider && (override.url === undefined || override.wsUrl === undefined)) {\n throw new SymmError(\n \"config\",\n \"PRICE_SERVICE_OVERRIDE_INCOMPLETE\",\n `createConfig: the priceService override for chain ${chainId} changes type from \"${base.type}\" to \"${override.type}\" but omits ${override.url === undefined ? \"`url`\" : \"`wsUrl`\"}. Supply both URLs when switching provider — inheriting the previous provider's endpoints would point the \"${override.type}\" client at \"${base.type}\" hosts.`,\n );\n }\n return merged;\n}\n\n/**\n * Merge a notifications override onto its base.\n *\n * Same trap as {@link mergePriceService}: once the config is a per-protocol\n * union, an override that switches `protocol` without restating the endpoint\n * would inherit the *previous* protocol's fields — a `rasa → enigma` swap\n * without a `channel` (or either swap without a `url`) type-checks as a\n * `DeepPartial` and fails at runtime. So a `protocol` swap must supply the\n * whole block; a same-protocol override still merges field-by-field.\n *\n * A swap takes the override block **alone** — nothing is inherited, including\n * the optional `searchUrl` (the previous protocol's REST search service does\n * not index the new protocol's stream).\n *\n * @throws {SymmError} `NOTIFICATIONS_OVERRIDE_INCOMPLETE` when the override\n * changes `protocol` but omits `url`, or targets `enigma` without a\n * `channel`.\n */\nfunction mergeNotifications(\n chainId: number,\n base: SymmioNotificationsConfig,\n override: DeepPartial<SymmioNotificationsConfig> | undefined,\n): SymmioNotificationsConfig {\n if (!override) return base;\n\n const swapsProtocol = override.protocol !== undefined && override.protocol !== base.protocol;\n if (swapsProtocol) {\n const missing =\n override.url === undefined\n ? \"`url`\"\n : override.protocol === \"enigma\" && (override as { channel?: string }).channel === undefined\n ? \"`channel`\"\n : null;\n if (missing) {\n throw new SymmError(\n \"config\",\n \"NOTIFICATIONS_OVERRIDE_INCOMPLETE\",\n `createConfig: the notifications override for chain ${chainId} changes protocol from \"${base.protocol}\" to \"${override.protocol}\" but omits ${missing}. Supply the whole block when switching protocol — inheriting the previous protocol's fields would point the \"${override.protocol}\" subscriber at \"${base.protocol}\" endpoints.`,\n );\n }\n return { ...override } as SymmioNotificationsConfig;\n }\n\n const merged = { ...base, ...override } as SymmioNotificationsConfig;\n if (merged.protocol === \"rasa\") {\n // A cast override could still sneak a `channel` key onto the rasa variant.\n delete (merged as { channel?: string }).channel;\n }\n return merged;\n}\n\n/**\n * Merge a per-chain solver map by id: each overridden solver is deep-merged onto\n * its base (or added when the id is new). Solvers the override does not mention\n * are inherited unchanged.\n */\nfunction mergeSolvers(\n chainId: number,\n base: Partial<Record<SolverId, SymmioSolverConfig>>,\n override: DeepPartial<Record<SolverId, SymmioSolverConfig>> | undefined,\n): Partial<Record<SolverId, SymmioSolverConfig>> {\n if (!override) return base;\n const merged: Partial<Record<SolverId, SymmioSolverConfig>> = { ...base };\n for (const [id, solverOverride] of Object.entries(override) as [SolverId, DeepPartial<SymmioSolverConfig>][]) {\n if (!solverOverride) continue;\n merged[id] = mergeSolver(chainId, base[id], solverOverride);\n }\n return merged;\n}\n\n/**\n * Merge one solver's fields. The optional nested `tpsl` and `priceService` blocks\n * are deep-merged so a partial override (e.g. only the `url`) keeps the base's\n * other fields. When neither base nor override declares a block, it stays absent\n * — for `priceService` that absence is meaningful: it is what makes the solver\n * fall back to the chain-level price service.\n */\nfunction mergeSolver(\n chainId: number,\n base: SymmioSolverConfig | undefined,\n override: DeepPartial<SymmioSolverConfig>,\n): SymmioSolverConfig {\n const merged = { ...(base ?? {}), ...(override as Partial<SymmioSolverConfig>) } as SymmioSolverConfig;\n\n const overrideTpsl = override.tpsl;\n if (overrideTpsl) {\n merged.tpsl = {\n ...(base?.tpsl ?? ({} as SymmioTpSlConfig)),\n ...(overrideTpsl as Partial<SymmioTpSlConfig>),\n } as SymmioTpSlConfig;\n } else if (base?.tpsl) {\n merged.tpsl = base.tpsl;\n } else {\n delete merged.tpsl;\n }\n\n const overridePriceService = override.priceService;\n if (overridePriceService) {\n // With no base block there is nothing to inherit, so the override must be\n // complete — route it through the same type-swap guard by treating it as a\n // swap away from the base (or chain) provider.\n merged.priceService = base?.priceService\n ? mergePriceService(chainId, base.priceService, overridePriceService)\n : assertCompletePriceService(chainId, overridePriceService);\n } else if (base?.priceService) {\n merged.priceService = base.priceService;\n } else {\n delete merged.priceService;\n }\n\n const overrideNotifications = override.notifications;\n if (overrideNotifications) {\n // With a base solver, deep-merge (same protocol-swap guard as the chain path\n // used to apply). With no base, the override must be a complete block.\n merged.notifications = base?.notifications\n ? mergeNotifications(chainId, base.notifications, overrideNotifications)\n : assertCompleteNotifications(chainId, overrideNotifications);\n } else if (base?.notifications) {\n merged.notifications = base.notifications;\n } else {\n throw new SymmError(\n \"config\",\n \"SOLVER_NOTIFICATIONS_REQUIRED\",\n `createConfig: a new solver on chain ${chainId} added via symmioConfig must declare a \\`notifications\\` block — it is required per solver and there is no base to inherit it from.`,\n );\n }\n\n const overrideCapabilities = override.capabilities;\n if (overrideCapabilities) {\n merged.capabilities = {\n ...(base?.capabilities ?? {}),\n ...(overrideCapabilities as SolverCapabilitiesConfig),\n };\n } else if (base?.capabilities) {\n merged.capabilities = base.capabilities;\n } else {\n delete merged.capabilities;\n }\n\n return merged;\n}\n\n/**\n * Validate a solver-nested price service that has no base to inherit from: every\n * field must be present, since there is nothing to fall back to.\n *\n * @throws {SymmError} `PRICE_SERVICE_OVERRIDE_INCOMPLETE`\n */\nfunction assertCompletePriceService(\n chainId: number,\n override: DeepPartial<SymmioPriceServiceConfig>,\n): SymmioPriceServiceConfig {\n if (override.type === undefined || override.url === undefined || override.wsUrl === undefined) {\n throw new SymmError(\n \"config\",\n \"PRICE_SERVICE_OVERRIDE_INCOMPLETE\",\n `createConfig: a solver-nested priceService on chain ${chainId} must declare \\`type\\`, \\`url\\` and \\`wsUrl\\` — there is no per-solver base to inherit the missing fields from. Omit the block entirely to fall back to the chain's price service.`,\n );\n }\n return override as SymmioPriceServiceConfig;\n}\n\n/**\n * Validate a solver-nested notifications block that has no base to inherit from\n * (a brand-new solver added via `symmioConfig`): `url` and `protocol` are always\n * required, and `enigma` additionally requires a `channel`.\n *\n * @throws {SymmError} `NOTIFICATIONS_OVERRIDE_INCOMPLETE`\n */\nfunction assertCompleteNotifications(\n chainId: number,\n override: DeepPartial<SymmioNotificationsConfig>,\n): SymmioNotificationsConfig {\n const missing =\n override.url === undefined\n ? \"`url`\"\n : override.protocol === undefined\n ? \"`protocol`\"\n : override.protocol === \"enigma\" && (override as { channel?: string }).channel === undefined\n ? \"`channel`\"\n : null;\n if (missing) {\n throw new SymmError(\n \"config\",\n \"NOTIFICATIONS_OVERRIDE_INCOMPLETE\",\n `createConfig: a solver-nested notifications block on chain ${chainId} must declare ${missing} — there is no per-solver base to inherit the missing fields from.`,\n );\n }\n return override as SymmioNotificationsConfig;\n}\n"],"mappings":";;;;AA4BA,SAAgB,EACd,GACmC;CACnC,IAAM,IAA8C,CAAC;CAErD,KAAK,IAAM,KAAW,EAAoB,GAAG;EAC3C,IAAM,IAAO,EAAe,CAAO,GAC7B,IAAW,IAAY;EAC7B,EAAS,KAAW,IAAW,EAAiB,GAAM,CAAQ,IAAI;CACpE;CAEA,OAAO;AACT;AASA,SAAS,EAAiB,GAAyB,GAA6D;CAC9G,IAAM,IACJ,EAAS,WAAW,wBAAwB,KAAA,KAC5C,EAAS,UAAU,oBAAoB,YAAY,MAAM,EAAK,UAAU,oBAAoB,YAAY,GACpG,EAAE,mBAAmB,GAAuB,GAAG,MAA+B,GAC9E,IAAoB,EAAS,sBAAsB,IAAsB,KAAA,IAAY;CAC3F,OAAO;EACL,GAAG;EACH,GAAI,EAAS,YAAY,KAAA,IAA4C,CAAC,IAAjC,EAAE,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OAAO,EAAO;CAGhB,IAAM,IAAwB,EAAS;CACvC,IAAI,GAGF,EAAO,gBAAgB,GAAM,gBACzB,EAAmB,GAAS,EAAK,eAAe,CAAqB,IACrE,EAA4B,GAAS,CAAqB;MACzD,IAAI,GAAM,eACf,EAAO,gBAAgB,EAAK;MAE5B,MAAM,IAAI,EACR,UACA,iCACA,uCAAuC,EAAQ,oIACjD;CAGF,IAAM,IAAuB,EAAS;CAYtC,OAXI,IACF,EAAO,eAAe;EACpB,GAAI,GAAM,gBAAgB,CAAC;EAC3B,GAAI;CACN,IACS,GAAM,eACf,EAAO,eAAe,EAAK,eAE3B,OAAO,EAAO,cAGT;AACT;AAQA,SAAS,EACP,GACA,GAC0B;CAC1B,IAAI,EAAS,SAAS,KAAA,KAAa,EAAS,QAAQ,KAAA,KAAa,EAAS,UAAU,KAAA,GAClF,MAAM,IAAI,EACR,UACA,qCACA,uDAAuD,EAAQ,mLACjE;CAEF,OAAO;AACT;AASA,SAAS,EACP,GACA,GAC2B;CAC3B,IAAM,IACJ,EAAS,QAAQ,KAAA,IACb,UACA,EAAS,aAAa,KAAA,IACpB,eACA,EAAS,aAAa,YAAa,EAAkC,YAAY,KAAA,IAC/E,cACA;CACV,IAAI,GACF,MAAM,IAAI,EACR,UACA,qCACA,8DAA8D,EAAQ,gBAAgB,EAAQ,mEAChG;CAEF,OAAO;AACT"}
@@ -1,4 +1,4 @@
1
- import { Abi, Hex } from 'viem';
1
+ import { Abi, Address, Hex } from 'viem';
2
2
  import { GaslessWalletCall } from '../gasless-wallet-execute/calls.js';
3
3
  /**
4
4
  * A relayable write named by its function, which the SDK encodes with viem's
@@ -23,11 +23,20 @@ export interface GaslessBatchContractCall {
23
23
  functionName: string;
24
24
  /** Arguments for `functionName`, in order. Omit for a no-argument function. */
25
25
  args?: readonly unknown[];
26
+ /**
27
+ * Who signs this call. Defaults to the batch's `from` (or the connected
28
+ * wallet). Give it to mix signers in one batch, for example a session key
29
+ * signing a call that an owner-signed grant earlier in the same batch
30
+ * authorizes.
31
+ */
32
+ from?: Address;
26
33
  }
27
34
  /** A relayable write given as raw calldata; its selector decides the target contract. */
28
35
  export interface GaslessBatchRawCall {
29
36
  /** Calldata of a relayable write. */
30
37
  data: Hex;
38
+ /** Who signs this call. Defaults to the batch's `from` (or the connected wallet). */
39
+ from?: Address;
31
40
  }
32
41
  /**
33
42
  * A GaslessWallet `execute` entry: several calls the owner's deterministic
@@ -46,6 +55,11 @@ export interface GaslessBatchWalletExecute {
46
55
  * balance and nonce stream.
47
56
  */
48
57
  walletId?: bigint;
58
+ /**
59
+ * Who signs this wallet operation. Defaults to the batch's `from`, then the
60
+ * configured wallet. The wallet contract still executes the inner calls.
61
+ */
62
+ from?: Address;
49
63
  }
50
64
  /**
51
65
  * One entry of a gasless batch: a relayable write — an ABI-level call
@@ -93,17 +107,17 @@ export declare function gaslessCallDataSelector(callData: Hex): Hex;
93
107
  * The selectors a gasless batch runs — the delegation set a session key must
94
108
  * hold to relay it on the batch's account: each relayable write's selector, and
95
109
  * for every GaslessWallet entry the wallet-execution sentinel plus each inner
96
- * call's selector. Lowercased and de-duplicated in first-seen order, because
97
- * `grantDelegation` rejects a duplicate-bearing array.
110
+ * call's selector. Lowercased and de-duplicated in first-seen order.
98
111
  *
99
112
  * Selectors come from the **encoded** calldata, so an overloaded ABI resolves to
100
113
  * the function that will actually run.
101
114
  *
102
- * A batch that contains `grantDelegation` must be owner-signed whatever this
103
- * returns: the InstantLayer rejects a delegate-signed grant, so no delegation
104
- * makes it relayable by a session key.
115
+ * For a mixed-signer batch, pass only the calls the delegate signs. This helper
116
+ * collects selectors without resolving `from`. A `grantDelegation` or
117
+ * `grantDelegations` entry must itself be owner-signed: no delegation makes a
118
+ * grant relayable by a session key.
105
119
  *
106
- * @param calls - The batch, in any order.
120
+ * @param calls - The calls signed by the delegate, in any order.
107
121
  * @returns The selector set, as `bytes4` hex.
108
122
  * @throws Viem's encoding error when an ABI-level call does not encode.
109
123
  *
@@ -1 +1 @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CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,CAE1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,GAAG,EAAE,CAmB3F"}
@@ -1,36 +1,37 @@
1
1
  import { SymmError as e } from "../../shared/errors/symm-error.js";
2
2
  import { GASLESS_RELAYABLE_FUNCTIONS as t } from "../relayable-writes.js";
3
- import { getGaslessWalletExecuteSelectors as n } from "../gasless-wallet-execute/selectors.js";
4
- import { encodeFunctionData as r, size as i, slice as a } from "viem";
3
+ import { getEffectiveInstantSelectors as n } from "../effective-instant-selectors.js";
4
+ import { getGaslessWalletExecuteSelectors as r } from "../gasless-wallet-execute/selectors.js";
5
+ import { encodeFunctionData as i, size as a, slice as o } from "viem";
5
6
  //#region src/gasless/batch/calls.ts
6
- function o(e) {
7
+ function s(e) {
7
8
  return "walletCalls" in e;
8
9
  }
9
- function s(e) {
10
- return "data" in e ? e.data : r({
11
- abi: e.abi ?? [c(e.functionName)],
10
+ function c(e) {
11
+ return "data" in e ? e.data : i({
12
+ abi: e.abi ?? [l(e.functionName)],
12
13
  functionName: e.functionName,
13
14
  args: e.args
14
15
  });
15
16
  }
16
- function c(n) {
17
+ function l(n) {
17
18
  let r = t.get(n);
18
19
  if (!r) throw new e("validation", "GASLESS_NOT_RELAYABLE", `Gasless: no relayable write is named "${n}". A batch carries the writes in GASLESS_RELAYABLE_SELECTORS; run any other call from the GaslessWallet as a \`walletCalls\` entry.`);
19
20
  return r;
20
21
  }
21
- function l(e) {
22
- return (i(e) < 4 ? "0x00000000" : a(e, 0, 4)).toLowerCase();
23
- }
24
22
  function u(e) {
25
- let t = /* @__PURE__ */ new Set(), r = [], i = (e) => {
23
+ return (a(e) < 4 ? "0x00000000" : o(e, 0, 4)).toLowerCase();
24
+ }
25
+ function d(e) {
26
+ let t = /* @__PURE__ */ new Set(), i = [], a = (e) => {
26
27
  let n = e.toLowerCase();
27
- t.has(n) || (t.add(n), r.push(n));
28
+ t.has(n) || (t.add(n), i.push(n));
28
29
  };
29
- for (let t of e) if (o(t)) for (let e of n(t.walletCalls)) i(e);
30
- else i(l(s(t)));
31
- return r;
30
+ for (let t of e) if (s(t)) for (let e of r(t.walletCalls)) a(e);
31
+ else for (let e of n(c(t))) a(e);
32
+ return i;
32
33
  }
33
34
  //#endregion
34
- export { s as gaslessBatchCallData, l as gaslessCallDataSelector, u as getGaslessBatchSelectors, o as isGaslessBatchWalletExecute };
35
+ export { c as gaslessBatchCallData, u as gaslessCallDataSelector, d as getGaslessBatchSelectors, s as isGaslessBatchWalletExecute };
35
36
 
36
37
  //# sourceMappingURL=calls.js.map