@symmio/trading-core 3.0.0 → 3.1.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 (650) hide show
  1. package/dist/core/chains/types.d.ts +197 -0
  2. package/dist/core/chains/types.d.ts.map +1 -1
  3. package/dist/core/chains/types.js.map +1 -1
  4. package/dist/core/config/merge-chain-config.d.ts.map +1 -1
  5. package/dist/core/config/merge-chain-config.js +49 -19
  6. package/dist/core/config/merge-chain-config.js.map +1 -1
  7. package/dist/gasless/abortable-sleep.d.ts +17 -0
  8. package/dist/gasless/abortable-sleep.d.ts.map +1 -0
  9. package/dist/gasless/abortable-sleep.js +21 -0
  10. package/dist/gasless/abortable-sleep.js.map +1 -0
  11. package/dist/gasless/assert-gateway-coherence.d.ts +20 -0
  12. package/dist/gasless/assert-gateway-coherence.d.ts.map +1 -0
  13. package/dist/gasless/assert-gateway-coherence.js +26 -0
  14. package/dist/gasless/assert-gateway-coherence.js.map +1 -0
  15. package/dist/gasless/batch/calls.d.ts +121 -0
  16. package/dist/gasless/batch/calls.d.ts.map +1 -0
  17. package/dist/gasless/batch/calls.js +36 -0
  18. package/dist/gasless/batch/calls.js.map +1 -0
  19. package/dist/gasless/batch/index.d.ts +2 -0
  20. package/dist/gasless/batch/index.d.ts.map +1 -0
  21. package/dist/gasless/batch/resolve-gasless-batch.d.ts +118 -0
  22. package/dist/gasless/batch/resolve-gasless-batch.d.ts.map +1 -0
  23. package/dist/gasless/batch/resolve-gasless-batch.js +89 -0
  24. package/dist/gasless/batch/resolve-gasless-batch.js.map +1 -0
  25. package/dist/gasless/classify-gasless-failure.d.ts +99 -0
  26. package/dist/gasless/classify-gasless-failure.d.ts.map +1 -0
  27. package/dist/gasless/classify-gasless-failure.js +60 -0
  28. package/dist/gasless/classify-gasless-failure.js.map +1 -0
  29. package/dist/gasless/confirm-gasless-request/confirm-gasless-request.d.ts +121 -0
  30. package/dist/gasless/confirm-gasless-request/confirm-gasless-request.d.ts.map +1 -0
  31. package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js +73 -0
  32. package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js.map +1 -0
  33. package/dist/gasless/confirm-gasless-request/index.d.ts +2 -0
  34. package/dist/gasless/confirm-gasless-request/index.d.ts.map +1 -0
  35. package/dist/gasless/constants.d.ts +24 -0
  36. package/dist/gasless/constants.d.ts.map +1 -0
  37. package/dist/gasless/constants.js +6 -0
  38. package/dist/gasless/constants.js.map +1 -0
  39. package/dist/gasless/delegation-preflight.d.ts +39 -0
  40. package/dist/gasless/delegation-preflight.d.ts.map +1 -0
  41. package/dist/gasless/delegation-preflight.js +33 -0
  42. package/dist/gasless/delegation-preflight.js.map +1 -0
  43. package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts +73 -0
  44. package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts.map +1 -0
  45. package/dist/gasless/dispatch/maybe-relay-as-gasless.js +189 -0
  46. package/dist/gasless/dispatch/maybe-relay-as-gasless.js.map +1 -0
  47. package/dist/gasless/eip712.d.ts +79 -0
  48. package/dist/gasless/eip712.d.ts.map +1 -0
  49. package/dist/gasless/eip712.js +60 -0
  50. package/dist/gasless/eip712.js.map +1 -0
  51. package/dist/gasless/errors.d.ts +132 -0
  52. package/dist/gasless/errors.d.ts.map +1 -0
  53. package/dist/gasless/errors.js +110 -0
  54. package/dist/gasless/errors.js.map +1 -0
  55. package/dist/gasless/events.d.ts +37 -0
  56. package/dist/gasless/events.d.ts.map +1 -0
  57. package/dist/gasless/events.js +34 -0
  58. package/dist/gasless/events.js.map +1 -0
  59. package/dist/gasless/fallback.d.ts +58 -0
  60. package/dist/gasless/fallback.d.ts.map +1 -0
  61. package/dist/gasless/fallback.js +34 -0
  62. package/dist/gasless/fallback.js.map +1 -0
  63. package/dist/gasless/format-gasless-operation.d.ts +37 -0
  64. package/dist/gasless/format-gasless-operation.d.ts.map +1 -0
  65. package/dist/gasless/format-gasless-operation.js +33 -0
  66. package/dist/gasless/format-gasless-operation.js.map +1 -0
  67. package/dist/gasless/gasless-url.d.ts +82 -0
  68. package/dist/gasless/gasless-url.d.ts.map +1 -0
  69. package/dist/gasless/gasless-url.js +70 -0
  70. package/dist/gasless/gasless-url.js.map +1 -0
  71. package/dist/gasless/gasless-wallet-execute/calls.d.ts +73 -0
  72. package/dist/gasless/gasless-wallet-execute/calls.d.ts.map +1 -0
  73. package/dist/gasless/gasless-wallet-execute/calls.js +24 -0
  74. package/dist/gasless/gasless-wallet-execute/calls.js.map +1 -0
  75. package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts +148 -0
  76. package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts.map +1 -0
  77. package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js +120 -0
  78. package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js.map +1 -0
  79. package/dist/gasless/gasless-wallet-execute/index.d.ts +5 -0
  80. package/dist/gasless/gasless-wallet-execute/index.d.ts.map +1 -0
  81. package/dist/gasless/gasless-wallet-execute/query.d.ts +18 -0
  82. package/dist/gasless/gasless-wallet-execute/query.d.ts.map +1 -0
  83. package/dist/gasless/gasless-wallet-execute/query.js +12 -0
  84. package/dist/gasless/gasless-wallet-execute/query.js.map +1 -0
  85. package/dist/gasless/gasless-wallet-execute/selectors.d.ts +38 -0
  86. package/dist/gasless/gasless-wallet-execute/selectors.d.ts.map +1 -0
  87. package/dist/gasless/gasless-wallet-execute/selectors.js +15 -0
  88. package/dist/gasless/gasless-wallet-execute/selectors.js.map +1 -0
  89. package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.d.ts +72 -0
  90. package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.d.ts.map +1 -0
  91. package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.js +42 -0
  92. package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.js.map +1 -0
  93. package/dist/gasless/get-gasless-batch-fee-quote/index.d.ts +3 -0
  94. package/dist/gasless/get-gasless-batch-fee-quote/index.d.ts.map +1 -0
  95. package/dist/gasless/get-gasless-batch-fee-quote/query.d.ts +47 -0
  96. package/dist/gasless/get-gasless-batch-fee-quote/query.d.ts.map +1 -0
  97. package/dist/gasless/get-gasless-batch-fee-quote/query.js +50 -0
  98. package/dist/gasless/get-gasless-batch-fee-quote/query.js.map +1 -0
  99. package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.d.ts +80 -0
  100. package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.d.ts.map +1 -0
  101. package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.js +61 -0
  102. package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.js.map +1 -0
  103. package/dist/gasless/get-gasless-deposit-policy/index.d.ts +3 -0
  104. package/dist/gasless/get-gasless-deposit-policy/index.d.ts.map +1 -0
  105. package/dist/gasless/get-gasless-deposit-policy/query.d.ts +51 -0
  106. package/dist/gasless/get-gasless-deposit-policy/query.d.ts.map +1 -0
  107. package/dist/gasless/get-gasless-deposit-policy/query.js +25 -0
  108. package/dist/gasless/get-gasless-deposit-policy/query.js.map +1 -0
  109. package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.d.ts +27 -0
  110. package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.d.ts.map +1 -0
  111. package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.js +22 -0
  112. package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.js.map +1 -0
  113. package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.d.ts +61 -0
  114. package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.d.ts.map +1 -0
  115. package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.js +59 -0
  116. package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.js.map +1 -0
  117. package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.d.ts +79 -0
  118. package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.d.ts.map +1 -0
  119. package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.js +53 -0
  120. package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.js.map +1 -0
  121. package/dist/gasless/get-gasless-fee-quote/index.d.ts +4 -0
  122. package/dist/gasless/get-gasless-fee-quote/index.d.ts.map +1 -0
  123. package/dist/gasless/get-gasless-fee-quote/query.d.ts +41 -0
  124. package/dist/gasless/get-gasless-fee-quote/query.d.ts.map +1 -0
  125. package/dist/gasless/get-gasless-fee-quote/query.js +31 -0
  126. package/dist/gasless/get-gasless-fee-quote/query.js.map +1 -0
  127. package/dist/gasless/get-gasless-request/get-gasless-request.d.ts +51 -0
  128. package/dist/gasless/get-gasless-request/get-gasless-request.d.ts.map +1 -0
  129. package/dist/gasless/get-gasless-request/get-gasless-request.js +15 -0
  130. package/dist/gasless/get-gasless-request/get-gasless-request.js.map +1 -0
  131. package/dist/gasless/get-gasless-request/index.d.ts +4 -0
  132. package/dist/gasless/get-gasless-request/index.d.ts.map +1 -0
  133. package/dist/gasless/get-gasless-request/query.d.ts +64 -0
  134. package/dist/gasless/get-gasless-request/query.d.ts.map +1 -0
  135. package/dist/gasless/get-gasless-request/query.js +42 -0
  136. package/dist/gasless/get-gasless-request/query.js.map +1 -0
  137. package/dist/gasless/get-gasless-request/to-gasless-request.d.ts +26 -0
  138. package/dist/gasless/get-gasless-request/to-gasless-request.d.ts.map +1 -0
  139. package/dist/gasless/get-gasless-request/to-gasless-request.js +62 -0
  140. package/dist/gasless/get-gasless-request/to-gasless-request.js.map +1 -0
  141. package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.d.ts +40 -0
  142. package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.d.ts.map +1 -0
  143. package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.js +15 -0
  144. package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.js.map +1 -0
  145. package/dist/gasless/get-gasless-request-transactions/index.d.ts +4 -0
  146. package/dist/gasless/get-gasless-request-transactions/index.d.ts.map +1 -0
  147. package/dist/gasless/get-gasless-request-transactions/query.d.ts +75 -0
  148. package/dist/gasless/get-gasless-request-transactions/query.d.ts.map +1 -0
  149. package/dist/gasless/get-gasless-request-transactions/query.js +37 -0
  150. package/dist/gasless/get-gasless-request-transactions/query.js.map +1 -0
  151. package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.d.ts +21 -0
  152. package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.d.ts.map +1 -0
  153. package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.js +27 -0
  154. package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.js.map +1 -0
  155. package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.d.ts +48 -0
  156. package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.d.ts.map +1 -0
  157. package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.js +20 -0
  158. package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.js.map +1 -0
  159. package/dist/gasless/get-gasless-wallet-address/index.d.ts +3 -0
  160. package/dist/gasless/get-gasless-wallet-address/index.d.ts.map +1 -0
  161. package/dist/gasless/get-gasless-wallet-address/query.d.ts +46 -0
  162. package/dist/gasless/get-gasless-wallet-address/query.d.ts.map +1 -0
  163. package/dist/gasless/get-gasless-wallet-address/query.js +25 -0
  164. package/dist/gasless/get-gasless-wallet-address/query.js.map +1 -0
  165. package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.d.ts +57 -0
  166. package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.d.ts.map +1 -0
  167. package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js +17 -0
  168. package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js.map +1 -0
  169. package/dist/gasless/get-gasless-wallet-creation-fee/index.d.ts +3 -0
  170. package/dist/gasless/get-gasless-wallet-creation-fee/index.d.ts.map +1 -0
  171. package/dist/gasless/get-gasless-wallet-creation-fee/query.d.ts +51 -0
  172. package/dist/gasless/get-gasless-wallet-creation-fee/query.d.ts.map +1 -0
  173. package/dist/gasless/get-gasless-wallet-creation-fee/query.js +25 -0
  174. package/dist/gasless/get-gasless-wallet-creation-fee/query.js.map +1 -0
  175. package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.d.ts +51 -0
  176. package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.d.ts.map +1 -0
  177. package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.js +21 -0
  178. package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.js.map +1 -0
  179. package/dist/gasless/get-gasless-wallet-nonce/index.d.ts +3 -0
  180. package/dist/gasless/get-gasless-wallet-nonce/index.d.ts.map +1 -0
  181. package/dist/gasless/get-gasless-wallet-nonce/query.d.ts +47 -0
  182. package/dist/gasless/get-gasless-wallet-nonce/query.d.ts.map +1 -0
  183. package/dist/gasless/get-gasless-wallet-nonce/query.js +25 -0
  184. package/dist/gasless/get-gasless-wallet-nonce/query.js.map +1 -0
  185. package/dist/gasless/get-session-key-selectors.d.ts +83 -0
  186. package/dist/gasless/get-session-key-selectors.d.ts.map +1 -0
  187. package/dist/gasless/get-session-key-selectors.js +25 -0
  188. package/dist/gasless/get-session-key-selectors.js.map +1 -0
  189. package/dist/gasless/http.d.ts +229 -0
  190. package/dist/gasless/http.d.ts.map +1 -0
  191. package/dist/gasless/http.js +165 -0
  192. package/dist/gasless/http.js.map +1 -0
  193. package/dist/gasless/index.d.ts +34 -0
  194. package/dist/gasless/index.d.ts.map +1 -0
  195. package/dist/gasless/is-newer-gasless-request.d.ts +32 -0
  196. package/dist/gasless/is-newer-gasless-request.d.ts.map +1 -0
  197. package/dist/gasless/is-newer-gasless-request.js +21 -0
  198. package/dist/gasless/is-newer-gasless-request.js.map +1 -0
  199. package/dist/gasless/nonce-lock.d.ts +180 -0
  200. package/dist/gasless/nonce-lock.d.ts.map +1 -0
  201. package/dist/gasless/nonce-lock.js +102 -0
  202. package/dist/gasless/nonce-lock.js.map +1 -0
  203. package/dist/gasless/observe-gasless-request.d.ts +65 -0
  204. package/dist/gasless/observe-gasless-request.d.ts.map +1 -0
  205. package/dist/gasless/observe-gasless-request.js +56 -0
  206. package/dist/gasless/observe-gasless-request.js.map +1 -0
  207. package/dist/gasless/query-poll-delay.d.ts +39 -0
  208. package/dist/gasless/query-poll-delay.d.ts.map +1 -0
  209. package/dist/gasless/query-poll-delay.js +14 -0
  210. package/dist/gasless/query-poll-delay.js.map +1 -0
  211. package/dist/gasless/relay-gasless-batch/index.d.ts +3 -0
  212. package/dist/gasless/relay-gasless-batch/index.d.ts.map +1 -0
  213. package/dist/gasless/relay-gasless-batch/query.d.ts +18 -0
  214. package/dist/gasless/relay-gasless-batch/query.d.ts.map +1 -0
  215. package/dist/gasless/relay-gasless-batch/query.js +12 -0
  216. package/dist/gasless/relay-gasless-batch/query.js.map +1 -0
  217. package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts +106 -0
  218. package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts.map +1 -0
  219. package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js +145 -0
  220. package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js.map +1 -0
  221. package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts +36 -0
  222. package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts.map +1 -0
  223. package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js +24 -0
  224. package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js.map +1 -0
  225. package/dist/gasless/relay-grant-delegation/index.d.ts +3 -0
  226. package/dist/gasless/relay-grant-delegation/index.d.ts.map +1 -0
  227. package/dist/gasless/relay-grant-delegation/query.d.ts +18 -0
  228. package/dist/gasless/relay-grant-delegation/query.d.ts.map +1 -0
  229. package/dist/gasless/relay-grant-delegation/query.js +12 -0
  230. package/dist/gasless/relay-grant-delegation/query.js.map +1 -0
  231. package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts +69 -0
  232. package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts.map +1 -0
  233. package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js +57 -0
  234. package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js.map +1 -0
  235. package/dist/gasless/relay-instant-operations/index.d.ts +3 -0
  236. package/dist/gasless/relay-instant-operations/index.d.ts.map +1 -0
  237. package/dist/gasless/relay-instant-operations/query.d.ts +18 -0
  238. package/dist/gasless/relay-instant-operations/query.d.ts.map +1 -0
  239. package/dist/gasless/relay-instant-operations/query.js +12 -0
  240. package/dist/gasless/relay-instant-operations/query.js.map +1 -0
  241. package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts +127 -0
  242. package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts.map +1 -0
  243. package/dist/gasless/relay-instant-operations/relay-instant-operations.js +42 -0
  244. package/dist/gasless/relay-instant-operations/relay-instant-operations.js.map +1 -0
  245. package/dist/gasless/relayable-writes.d.ts +163 -0
  246. package/dist/gasless/relayable-writes.d.ts.map +1 -0
  247. package/dist/gasless/relayable-writes.js +113 -0
  248. package/dist/gasless/relayable-writes.js.map +1 -0
  249. package/dist/gasless/resolve-gasless.d.ts +52 -0
  250. package/dist/gasless/resolve-gasless.d.ts.map +1 -0
  251. package/dist/gasless/resolve-gasless.js +19 -0
  252. package/dist/gasless/resolve-gasless.js.map +1 -0
  253. package/dist/gasless/resolve-wallet-identities.d.ts +30 -0
  254. package/dist/gasless/resolve-wallet-identities.d.ts.map +1 -0
  255. package/dist/gasless/resolve-wallet-identities.js +21 -0
  256. package/dist/gasless/resolve-wallet-identities.js.map +1 -0
  257. package/dist/gasless/resubmit-gasless-request/index.d.ts +3 -0
  258. package/dist/gasless/resubmit-gasless-request/index.d.ts.map +1 -0
  259. package/dist/gasless/resubmit-gasless-request/query.d.ts +19 -0
  260. package/dist/gasless/resubmit-gasless-request/query.d.ts.map +1 -0
  261. package/dist/gasless/resubmit-gasless-request/query.js +12 -0
  262. package/dist/gasless/resubmit-gasless-request/query.js.map +1 -0
  263. package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts +50 -0
  264. package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts.map +1 -0
  265. package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js +52 -0
  266. package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js.map +1 -0
  267. package/dist/gasless/settle-gasless-deposit-existing-account/index.d.ts +3 -0
  268. package/dist/gasless/settle-gasless-deposit-existing-account/index.d.ts.map +1 -0
  269. package/dist/gasless/settle-gasless-deposit-existing-account/query.d.ts +18 -0
  270. package/dist/gasless/settle-gasless-deposit-existing-account/query.d.ts.map +1 -0
  271. package/dist/gasless/settle-gasless-deposit-existing-account/query.js +12 -0
  272. package/dist/gasless/settle-gasless-deposit-existing-account/query.js.map +1 -0
  273. package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts +66 -0
  274. package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts.map +1 -0
  275. package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js +36 -0
  276. package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js.map +1 -0
  277. package/dist/gasless/settle-gasless-deposit-new-account/index.d.ts +3 -0
  278. package/dist/gasless/settle-gasless-deposit-new-account/index.d.ts.map +1 -0
  279. package/dist/gasless/settle-gasless-deposit-new-account/query.d.ts +18 -0
  280. package/dist/gasless/settle-gasless-deposit-new-account/query.d.ts.map +1 -0
  281. package/dist/gasless/settle-gasless-deposit-new-account/query.js +12 -0
  282. package/dist/gasless/settle-gasless-deposit-new-account/query.js.map +1 -0
  283. package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts +106 -0
  284. package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts.map +1 -0
  285. package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js +43 -0
  286. package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js.map +1 -0
  287. package/dist/gasless/status-read-limiter.d.ts +44 -0
  288. package/dist/gasless/status-read-limiter.d.ts.map +1 -0
  289. package/dist/gasless/status-read-limiter.js +28 -0
  290. package/dist/gasless/status-read-limiter.js.map +1 -0
  291. package/dist/gasless/to-gasless-deposit-receipt.d.ts +61 -0
  292. package/dist/gasless/to-gasless-deposit-receipt.d.ts.map +1 -0
  293. package/dist/gasless/to-gasless-deposit-receipt.js +36 -0
  294. package/dist/gasless/to-gasless-deposit-receipt.js.map +1 -0
  295. package/dist/gasless/to-gasless-submit-receipt.d.ts +60 -0
  296. package/dist/gasless/to-gasless-submit-receipt.d.ts.map +1 -0
  297. package/dist/gasless/to-gasless-submit-receipt.js +26 -0
  298. package/dist/gasless/to-gasless-submit-receipt.js.map +1 -0
  299. package/dist/gasless/transient-read.d.ts +32 -0
  300. package/dist/gasless/transient-read.d.ts.map +1 -0
  301. package/dist/gasless/transient-read.js +28 -0
  302. package/dist/gasless/transient-read.js.map +1 -0
  303. package/dist/gasless/types/generated/gasless-deposits.d.ts +170 -0
  304. package/dist/gasless/types/generated/gasless-deposits.d.ts.map +1 -0
  305. package/dist/gasless/types/generated/gasless-operations.d.ts +260 -0
  306. package/dist/gasless/types/generated/gasless-operations.d.ts.map +1 -0
  307. package/dist/gasless/types.d.ts +493 -0
  308. package/dist/gasless/types.d.ts.map +1 -0
  309. package/dist/gasless/types.js +33 -0
  310. package/dist/gasless/types.js.map +1 -0
  311. package/dist/gasless/unconfirmed-submit.d.ts +132 -0
  312. package/dist/gasless/unconfirmed-submit.d.ts.map +1 -0
  313. package/dist/gasless/unconfirmed-submit.js +49 -0
  314. package/dist/gasless/unconfirmed-submit.js.map +1 -0
  315. package/dist/gasless/wait-for-gasless-request/index.d.ts +2 -0
  316. package/dist/gasless/wait-for-gasless-request/index.d.ts.map +1 -0
  317. package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.d.ts +114 -0
  318. package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.d.ts.map +1 -0
  319. package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.js +77 -0
  320. package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.js.map +1 -0
  321. package/dist/gasless/wallet-id.d.ts +42 -0
  322. package/dist/gasless/wallet-id.d.ts.map +1 -0
  323. package/dist/gasless/wallet-id.js +25 -0
  324. package/dist/gasless/wallet-id.js.map +1 -0
  325. package/dist/gasless/wire-parse.d.ts +33 -0
  326. package/dist/gasless/wire-parse.d.ts.map +1 -0
  327. package/dist/gasless/wire-parse.js +14 -0
  328. package/dist/gasless/wire-parse.js.map +1 -0
  329. package/dist/gasless/wire-types.d.ts +73 -0
  330. package/dist/gasless/wire-types.d.ts.map +1 -0
  331. package/dist/gasless/write-request-registry.d.ts +56 -0
  332. package/dist/gasless/write-request-registry.d.ts.map +1 -0
  333. package/dist/gasless/write-request-registry.js +22 -0
  334. package/dist/gasless/write-request-registry.js.map +1 -0
  335. package/dist/index.d.ts +82 -17
  336. package/dist/index.d.ts.map +1 -1
  337. package/dist/index.js +568 -497
  338. package/dist/pools/listing-config/to-listing-config.js +2 -2
  339. package/dist/pools/listing-config/to-listing-config.js.map +1 -1
  340. package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
  341. package/dist/pools/market-detail/to-listing-market-detail.js +46 -40
  342. package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
  343. package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
  344. package/dist/pools/markets/to-listing-market.js +2 -1
  345. package/dist/pools/markets/to-listing-market.js.map +1 -1
  346. package/dist/pools/types/generated/listing-backend.d.ts +163 -16
  347. package/dist/pools/types/generated/listing-backend.d.ts.map +1 -1
  348. package/dist/pools/types/generated/listing-backend.js.map +1 -1
  349. package/dist/pools/types.d.ts +52 -2
  350. package/dist/pools/types.d.ts.map +1 -1
  351. package/dist/pools/types.js +6 -4
  352. package/dist/pools/types.js.map +1 -1
  353. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +3 -2
  354. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
  355. package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
  356. package/dist/quotes/get-quote-funding/types.d.ts +4 -2
  357. package/dist/quotes/get-quote-funding/types.d.ts.map +1 -1
  358. package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.d.ts +68 -0
  359. package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.d.ts.map +1 -0
  360. package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.js +34 -0
  361. package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.js.map +1 -0
  362. package/dist/quotes/get-quote-pending-funding/index.d.ts +4 -0
  363. package/dist/quotes/get-quote-pending-funding/index.d.ts.map +1 -0
  364. package/dist/quotes/get-quote-pending-funding/query.d.ts +58 -0
  365. package/dist/quotes/get-quote-pending-funding/query.d.ts.map +1 -0
  366. package/dist/quotes/get-quote-pending-funding/query.js +27 -0
  367. package/dist/quotes/get-quote-pending-funding/query.js.map +1 -0
  368. package/dist/quotes/get-quote-pending-funding/types.d.ts +19 -0
  369. package/dist/quotes/get-quote-pending-funding/types.d.ts.map +1 -0
  370. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +2 -1
  371. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -1
  372. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -1
  373. package/dist/quotes/grouping/aggregate-group-funding.d.ts +9 -8
  374. package/dist/quotes/grouping/aggregate-group-funding.d.ts.map +1 -1
  375. package/dist/quotes/grouping/aggregate-group-funding.js.map +1 -1
  376. package/dist/quotes/grouping/partition-quotes.d.ts +30 -0
  377. package/dist/quotes/grouping/partition-quotes.d.ts.map +1 -1
  378. package/dist/quotes/grouping/partition-quotes.js +9 -6
  379. package/dist/quotes/grouping/partition-quotes.js.map +1 -1
  380. package/dist/quotes/index.d.ts +1 -0
  381. package/dist/quotes/index.d.ts.map +1 -1
  382. package/dist/quotes/unified-quote.d.ts +6 -6
  383. package/dist/quotes/unified-quote.js.map +1 -1
  384. package/dist/shared/errors/redact-url.d.ts +15 -0
  385. package/dist/shared/errors/redact-url.d.ts.map +1 -0
  386. package/dist/shared/errors/redact-url.js +9 -0
  387. package/dist/shared/errors/redact-url.js.map +1 -0
  388. package/dist/shared/errors/retry-after.d.ts +17 -0
  389. package/dist/shared/errors/retry-after.d.ts.map +1 -0
  390. package/dist/shared/errors/retry-after.js +16 -0
  391. package/dist/shared/errors/retry-after.js.map +1 -0
  392. package/dist/shared/errors/sanitized-api-error.d.ts +32 -0
  393. package/dist/shared/errors/sanitized-api-error.d.ts.map +1 -0
  394. package/dist/shared/errors/sanitized-api-error.js +41 -0
  395. package/dist/shared/errors/sanitized-api-error.js.map +1 -0
  396. package/dist/shared/errors/symm-error.d.ts +39 -4
  397. package/dist/shared/errors/symm-error.d.ts.map +1 -1
  398. package/dist/shared/errors/symm-error.js +29 -15
  399. package/dist/shared/errors/symm-error.js.map +1 -1
  400. package/dist/shared/types/properties.d.ts +53 -5
  401. package/dist/shared/types/properties.d.ts.map +1 -1
  402. package/dist/shared/utils/core-units.d.ts +82 -0
  403. package/dist/shared/utils/core-units.d.ts.map +1 -0
  404. package/dist/shared/utils/core-units.js +21 -0
  405. package/dist/shared/utils/core-units.js.map +1 -0
  406. package/dist/shared/utils/http-header.d.ts +16 -0
  407. package/dist/shared/utils/http-header.d.ts.map +1 -0
  408. package/dist/shared/utils/http-header.js +14 -0
  409. package/dist/shared/utils/http-header.js.map +1 -0
  410. package/dist/shared/utils/query.js +2 -1
  411. package/dist/shared/utils/query.js.map +1 -1
  412. package/dist/solvers/force-close/force-close-auto.d.ts +6 -2
  413. package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -1
  414. package/dist/solvers/force-close/force-close-auto.js +2 -1
  415. package/dist/solvers/force-close/force-close-auto.js.map +1 -1
  416. package/dist/solvers/force-close/force-close-position.d.ts +9 -3
  417. package/dist/solvers/force-close/force-close-position.d.ts.map +1 -1
  418. package/dist/solvers/force-close/force-close-position.js +2 -1
  419. package/dist/solvers/force-close/force-close-position.js.map +1 -1
  420. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +12 -12
  421. package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +7 -7
  422. package/dist/symmio-contracts/abi/index.d.ts +2 -0
  423. package/dist/symmio-contracts/abi/index.d.ts.map +1 -1
  424. package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.d.ts +2323 -0
  425. package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.d.ts.map +1 -0
  426. package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.js +2706 -0
  427. package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.js.map +1 -0
  428. package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.d.ts +137 -0
  429. package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.d.ts.map +1 -0
  430. package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.js +145 -0
  431. package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.js.map +1 -0
  432. package/dist/symmio-contracts/abi/v0.8.6/index.d.ts +2 -0
  433. package/dist/symmio-contracts/abi/v0.8.6/index.d.ts.map +1 -1
  434. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts +1879 -37
  435. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts.map +1 -1
  436. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js +2180 -50
  437. package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -1
  438. package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +2 -2
  439. package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts.map +1 -1
  440. package/dist/symmio-contracts/account-layer/actions/add-margin.js +34 -17
  441. package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
  442. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +11 -2
  443. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts.map +1 -1
  444. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +33 -17
  445. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
  446. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +9 -2
  447. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts.map +1 -1
  448. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +33 -16
  449. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
  450. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts +8 -2
  451. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts.map +1 -1
  452. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js +34 -17
  453. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js.map +1 -1
  454. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts +8 -2
  455. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts.map +1 -1
  456. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js +34 -17
  457. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js.map +1 -1
  458. package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +7 -2
  459. package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts.map +1 -1
  460. package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +34 -17
  461. package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
  462. package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.d.ts +1 -1
  463. package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.js.map +1 -1
  464. package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts +9 -3
  465. package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts.map +1 -1
  466. package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.js.map +1 -1
  467. package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +2 -2
  468. package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts.map +1 -1
  469. package/dist/symmio-contracts/account-layer/actions/remove-margin.js +41 -20
  470. package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
  471. package/dist/symmio-contracts/account-layer/types.d.ts +3 -1
  472. package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
  473. package/dist/symmio-contracts/account-layer/types.js.map +1 -1
  474. package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.d.ts +60 -0
  475. package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.d.ts.map +1 -0
  476. package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.js +35 -0
  477. package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.js.map +1 -0
  478. package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.d.ts +91 -0
  479. package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.d.ts.map +1 -0
  480. package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.js +19 -0
  481. package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.js.map +1 -0
  482. package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.d.ts +36 -0
  483. package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.d.ts.map +1 -0
  484. package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js +15 -0
  485. package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js.map +1 -0
  486. package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.d.ts +79 -0
  487. package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.d.ts.map +1 -0
  488. package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.js +32 -0
  489. package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.js.map +1 -0
  490. package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.d.ts +43 -0
  491. package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.d.ts.map +1 -0
  492. package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.js +14 -0
  493. package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.js.map +1 -0
  494. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +24 -3
  495. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts.map +1 -1
  496. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +48 -22
  497. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
  498. package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.d.ts +62 -0
  499. package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.d.ts.map +1 -0
  500. package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.js +35 -0
  501. package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.js.map +1 -0
  502. package/dist/symmio-contracts/instant-layer/index.d.ts +12 -0
  503. package/dist/symmio-contracts/instant-layer/index.d.ts.map +1 -1
  504. package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.d.ts +22 -0
  505. package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.d.ts.map +1 -0
  506. package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.js +12 -0
  507. package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.js.map +1 -0
  508. package/dist/symmio-contracts/instant-layer/query/get-active-delegations.d.ts +36 -0
  509. package/dist/symmio-contracts/instant-layer/query/get-active-delegations.d.ts.map +1 -0
  510. package/dist/symmio-contracts/instant-layer/query/get-active-delegations.js +29 -0
  511. package/dist/symmio-contracts/instant-layer/query/get-active-delegations.js.map +1 -0
  512. package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.d.ts +39 -0
  513. package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.d.ts.map +1 -0
  514. package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.js +27 -0
  515. package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.js.map +1 -0
  516. package/dist/symmio-contracts/instant-layer/query/get-is-delegation-active.js +7 -7
  517. package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.d.ts +42 -0
  518. package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.d.ts.map +1 -0
  519. package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.js +30 -0
  520. package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.js.map +1 -0
  521. package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.d.ts +36 -0
  522. package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.d.ts.map +1 -0
  523. package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.js +21 -0
  524. package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.js.map +1 -0
  525. package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.d.ts +22 -0
  526. package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.d.ts.map +1 -0
  527. package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.js +12 -0
  528. package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.js.map +1 -0
  529. package/dist/symmio-contracts/symmio/actions/allocate.d.ts +2 -2
  530. package/dist/symmio-contracts/symmio/actions/allocate.d.ts.map +1 -1
  531. package/dist/symmio-contracts/symmio/actions/allocate.js +2 -1
  532. package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
  533. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts +87 -0
  534. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts.map +1 -0
  535. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js +38 -0
  536. package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js.map +1 -0
  537. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +2 -2
  538. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts.map +1 -1
  539. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +2 -1
  540. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
  541. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +2 -2
  542. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
  543. package/dist/symmio-contracts/symmio/actions/deallocate.js +2 -1
  544. package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
  545. package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts +15 -3
  546. package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts.map +1 -1
  547. package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js +34 -17
  548. package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js.map +1 -1
  549. package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts +2 -2
  550. package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts.map +1 -1
  551. package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js +2 -1
  552. package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js.map +1 -1
  553. package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts +2 -2
  554. package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts.map +1 -1
  555. package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js +2 -1
  556. package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js.map +1 -1
  557. package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.d.ts +85 -0
  558. package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.d.ts.map +1 -0
  559. package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.js +29 -0
  560. package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.js.map +1 -0
  561. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +2 -2
  562. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts.map +1 -1
  563. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +2 -1
  564. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
  565. package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts +2 -2
  566. package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts.map +1 -1
  567. package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js +2 -1
  568. package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js.map +1 -1
  569. package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts +2 -2
  570. package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts.map +1 -1
  571. package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js +2 -1
  572. package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js.map +1 -1
  573. package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts +2 -2
  574. package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts.map +1 -1
  575. package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js +2 -1
  576. package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js.map +1 -1
  577. package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +9 -7
  578. package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -1
  579. package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +24 -22
  580. package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -1
  581. package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +2 -2
  582. package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -1
  583. package/dist/symmio-contracts/symmio/actions/withdraw.js +4 -2
  584. package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
  585. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.d.ts +43 -0
  586. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.d.ts.map +1 -0
  587. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.js +15 -0
  588. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.js.map +1 -0
  589. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/index.d.ts +4 -0
  590. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/index.d.ts.map +1 -0
  591. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.d.ts +43 -0
  592. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.d.ts.map +1 -0
  593. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.js +25 -0
  594. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.js.map +1 -0
  595. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/types.d.ts +85 -0
  596. package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/types.d.ts.map +1 -0
  597. package/dist/symmio-contracts/symmio/index.d.ts +5 -0
  598. package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
  599. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts +2 -1
  600. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts.map +1 -1
  601. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +46 -17
  602. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
  603. package/dist/symmio-contracts/symmio/query/approve-operational-fee.d.ts +18 -0
  604. package/dist/symmio-contracts/symmio/query/approve-operational-fee.d.ts.map +1 -0
  605. package/dist/symmio-contracts/symmio/query/approve-operational-fee.js +12 -0
  606. package/dist/symmio-contracts/symmio/query/approve-operational-fee.js.map +1 -0
  607. package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.d.ts +35 -0
  608. package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.d.ts.map +1 -0
  609. package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.js +28 -0
  610. package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.js.map +1 -0
  611. package/dist/symmio-contracts/symmio/types.d.ts +6 -6
  612. package/dist/symmio-contracts/symmio/types.js.map +1 -1
  613. package/dist/symmio-subgraph/executeSubgraphRequest.d.ts +2 -1
  614. package/dist/symmio-subgraph/executeSubgraphRequest.d.ts.map +1 -1
  615. package/dist/symmio-subgraph/executeSubgraphRequest.js +24 -21
  616. package/dist/symmio-subgraph/executeSubgraphRequest.js.map +1 -1
  617. package/dist/websocket/gasless/close-code-policy.d.ts +51 -0
  618. package/dist/websocket/gasless/close-code-policy.d.ts.map +1 -0
  619. package/dist/websocket/gasless/close-code-policy.js +75 -0
  620. package/dist/websocket/gasless/close-code-policy.js.map +1 -0
  621. package/dist/websocket/gasless/gasless-stream-hub.d.ts +61 -0
  622. package/dist/websocket/gasless/gasless-stream-hub.d.ts.map +1 -0
  623. package/dist/websocket/gasless/gasless-stream-hub.js +311 -0
  624. package/dist/websocket/gasless/gasless-stream-hub.js.map +1 -0
  625. package/dist/websocket/gasless/index.d.ts +7 -0
  626. package/dist/websocket/gasless/index.d.ts.map +1 -0
  627. package/dist/websocket/gasless/parse-gasless-stream-message.d.ts +82 -0
  628. package/dist/websocket/gasless/parse-gasless-stream-message.d.ts.map +1 -0
  629. package/dist/websocket/gasless/parse-gasless-stream-message.js +136 -0
  630. package/dist/websocket/gasless/parse-gasless-stream-message.js.map +1 -0
  631. package/dist/websocket/gasless/resolve-gasless-stream-url.d.ts +58 -0
  632. package/dist/websocket/gasless/resolve-gasless-stream-url.d.ts.map +1 -0
  633. package/dist/websocket/gasless/resolve-gasless-stream-url.js +59 -0
  634. package/dist/websocket/gasless/resolve-gasless-stream-url.js.map +1 -0
  635. package/dist/websocket/gasless/types.d.ts +48 -0
  636. package/dist/websocket/gasless/types.d.ts.map +1 -0
  637. package/dist/websocket/gasless/watch-gasless-request.d.ts +72 -0
  638. package/dist/websocket/gasless/watch-gasless-request.d.ts.map +1 -0
  639. package/dist/websocket/gasless/watch-gasless-request.js +35 -0
  640. package/dist/websocket/gasless/watch-gasless-request.js.map +1 -0
  641. package/dist/websocket/index.d.ts +1 -0
  642. package/dist/websocket/index.d.ts.map +1 -1
  643. package/dist/websocket/socket/create-reconnecting-socket.d.ts +39 -6
  644. package/dist/websocket/socket/create-reconnecting-socket.d.ts.map +1 -1
  645. package/dist/websocket/socket/create-reconnecting-socket.js +92 -53
  646. package/dist/websocket/socket/create-reconnecting-socket.js.map +1 -1
  647. package/dist/websocket/socket/socket-status.d.ts +7 -2
  648. package/dist/websocket/socket/socket-status.d.ts.map +1 -1
  649. package/dist/websocket/socket/socket-status.js.map +1 -1
  650. package/package.json +1 -1
@@ -0,0 +1,189 @@
1
+ import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
2
+ import { getInstantLayerEip712Domain as n, signSignedOperation as r } from "../../solvers/instant-open/shared/eip712.js";
3
+ import { buildSignedOperation as i } from "../../solvers/instant-open/shared/operations.js";
4
+ import { getVirtualAccount as a } from "../../symmio-contracts/account-layer/actions/get-virtual-account.js";
5
+ import { getInstantLayerNonce as o } from "../../symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js";
6
+ import { assertGaslessGatewayCoherence as s } from "../assert-gateway-coherence.js";
7
+ import { findUndelegatedGaslessSelectors as c, getCachedGaslessAccountOwner as l } from "../delegation-preflight.js";
8
+ import { fireGaslessEvent as u, toGaslessRecordBody as d } from "../events.js";
9
+ import { resolveGaslessService as f, supportsGaslessService as p } from "../resolve-gasless.js";
10
+ import { getGaslessUnconfirmedSubmit as m, isGaslessIdempotencyConflictError as h } from "../unconfirmed-submit.js";
11
+ import { generateGaslessIdempotencyKey as g, isGaslessAcceptedInstanceMismatchError as _ } from "../http.js";
12
+ import { GaslessRequestStatus as v } from "../types.js";
13
+ import { isConfirmedGaslessFeeLimitError as y, isConfirmedGaslessUnavailableError as b } from "../fallback.js";
14
+ import { isGaslessFreeQuotaExhaustedError as x } from "../get-gasless-fee-quote/fee-quote-errors.js";
15
+ import { getGaslessFeeQuote as S } from "../get-gasless-fee-quote/get-gasless-fee-quote.js";
16
+ import { waitForGaslessRequest as C } from "../wait-for-gasless-request/wait-for-gasless-request.js";
17
+ import { blocksGaslessNonceStream as w, gaslessInstantNonceStreamKey as T, readGaslessStreamNonce as E, submitOnGaslessNonceStream as D, withGaslessNonceLock as O } from "../nonce-lock.js";
18
+ import { relayInstantOperations as k } from "../relay-instant-operations/relay-instant-operations.js";
19
+ import { GASLESS_RELAYABLE_WRITES as A } from "../relayable-writes.js";
20
+ import { registerGaslessWriteRequest as j } from "../write-request-registry.js";
21
+ //#region src/gasless/dispatch/maybe-relay-as-gasless.ts
22
+ var M = 1200;
23
+ function N(e, t) {
24
+ let n = t.gasless, r = typeof n == "boolean" ? { enabled: n } : n ?? {}, i = p(e, { chainId: t.chainId }), a = i ? f(e, { chainId: t.chainId }).execution ?? {} : {};
25
+ return r.enabled ?? a.mode === "gasless" ? i ? {
26
+ gasless: f(e, { chainId: t.chainId }),
27
+ options: r,
28
+ execution: a,
29
+ fallback: r.fallback ?? a.fallback ?? "error"
30
+ } : typeof n == "boolean" || n?.enabled !== void 0 ? "unconfigured-explicit" : "wallet" : "wallet";
31
+ }
32
+ async function P(p, P) {
33
+ let F = N(p, P);
34
+ if (F === "wallet") return null;
35
+ if (F === "unconfigured-explicit") return f(p, { chainId: P.chainId }), null;
36
+ let { gasless: I, options: L, execution: R, fallback: z } = F, B = P.calls.map((e) => A.get(e.callData.slice(0, 10).toLowerCase()));
37
+ if (B.some((e) => e === void 0)) {
38
+ if (L.enabled === !0) {
39
+ if (z === "wallet") return null;
40
+ throw new t("validation", "GASLESS_NOT_RELAYABLE", "Gasless: this write's calldata is not relayable through the gasless service.");
41
+ }
42
+ return null;
43
+ }
44
+ let V = B[0]?.operationType ?? "gaslessWrite", H = p.getChainConfig(P.chainId).chainId;
45
+ await s(p, H, I);
46
+ let U = L.account ?? P.signerAccount;
47
+ if (!U && P.accountMaybeVirtual) {
48
+ let e = await a(p, {
49
+ chainId: H,
50
+ account: P.accountMaybeVirtual
51
+ });
52
+ U = e.isExists ? e.parentAccount : P.accountMaybeVirtual;
53
+ }
54
+ if (!U) {
55
+ if (!P.virtualAccount) throw new t("validation", "GASLESS_ACCOUNT_UNRESOLVED", "Gasless: no sub-account to relay under — pass `gasless.account`.");
56
+ let e = await a(p, {
57
+ chainId: H,
58
+ account: P.virtualAccount
59
+ });
60
+ if (!e.isExists) throw new t("validation", "GASLESS_ACCOUNT_UNRESOLVED", `Gasless: ${P.virtualAccount} is not a known virtual account — pass \`gasless.account\` with the paying sub-account.`);
61
+ U = e.parentAccount;
62
+ }
63
+ let W = U, G = await p.getWalletClient({
64
+ chainId: H,
65
+ from: P.from
66
+ });
67
+ if (R.preflightDelegation ?? !0) {
68
+ let e = await c(p, {
69
+ chainId: H,
70
+ signer: G.account.address,
71
+ signerAccount: W,
72
+ selectors: P.calls.map((e) => e.callData.slice(0, 10).toLowerCase())
73
+ });
74
+ if (e.length > 0) {
75
+ if (z === "wallet") return null;
76
+ throw new t("validation", "GASLESS_SIGNER_NOT_DELEGATED", `Gasless: signer ${G.account.address} holds no active InstantLayer delegation from sub-account ${W} for selector(s) ${e.join(", ")}. Grant them to the session key (the selector set is built by getSessionKeySelectors) or sign this write with the sub-account's owner.`);
77
+ }
78
+ }
79
+ let K = n(p, { chainId: H }), q = R.onEvent, J = T(H, W), Y = await O(p, J, async () => {
80
+ let e = await E(p, J, () => o(p, {
81
+ chainId: H,
82
+ account: W
83
+ })), n = BigInt(Math.floor(Date.now() / 1e3) + M), a = P.calls.map((t, r) => i({
84
+ signer: G.account.address,
85
+ target: t.target,
86
+ callData: t.callData,
87
+ signerAccount: W,
88
+ deadline: n,
89
+ nonce: e + BigInt(r + 1)
90
+ }));
91
+ if (R.preflightFee ?? !0) try {
92
+ await S(p, {
93
+ chainId: H,
94
+ operations: a.map((e) => ({ operation: e }))
95
+ });
96
+ } catch (e) {
97
+ if (x(e)) {
98
+ if (z === "wallet") return "wallet";
99
+ throw e;
100
+ }
101
+ if (e instanceof t) throw e;
102
+ }
103
+ let s = [];
104
+ for (let e of a) s.push(await r(e, K, G));
105
+ let c = g(), u = await l(p, H, W).catch(() => null) ?? G.account.address;
106
+ try {
107
+ return {
108
+ receipt: await D(p, J, {
109
+ signedNonce: e + BigInt(a.length),
110
+ service: "operations",
111
+ chainId: H,
112
+ deadline: n
113
+ }, () => k(p, {
114
+ chainId: H,
115
+ userAddress: u,
116
+ operationType: V,
117
+ operations: a.map((e, t) => ({
118
+ operation: e,
119
+ signature: s[t]
120
+ })),
121
+ idempotencyKey: c
122
+ }), w),
123
+ owner: u
124
+ };
125
+ } catch (e) {
126
+ if (!(m(e) !== null || h(e) || _(e)) && (y(e) || b(e)) && z === "wallet") return "wallet";
127
+ throw e;
128
+ }
129
+ });
130
+ if (Y === "wallet") return null;
131
+ let { receipt: X, owner: Z } = Y;
132
+ u(q, {
133
+ type: "accepted",
134
+ requestId: X.requestId,
135
+ service: "operations",
136
+ chainId: H,
137
+ protocolInstance: I.protocolInstance ?? null,
138
+ operationType: V,
139
+ idempotencyKey: X.idempotencyKey,
140
+ owner: Z,
141
+ walletIds: X.walletIds
142
+ });
143
+ let Q = await C(p, {
144
+ chainId: H,
145
+ requestId: X.requestId,
146
+ until: "broadcast",
147
+ timeoutMs: L.broadcastTimeoutMs ?? R.broadcastTimeoutMs,
148
+ queuedPollMs: R.queuedPollMs,
149
+ submittedPollMs: R.submittedPollMs,
150
+ signal: L.signal,
151
+ onUpdate: (e) => {
152
+ e.txHash && u(q, {
153
+ type: "broadcast",
154
+ requestId: e.requestId,
155
+ txHash: e.txHash,
156
+ chainId: H
157
+ });
158
+ }
159
+ });
160
+ if (Q.txHash !== null) return j(p, {
161
+ requestId: X.requestId,
162
+ service: "operations",
163
+ chainId: H,
164
+ protocolInstance: I.protocolInstance ?? null,
165
+ broadcastHash: Q.txHash
166
+ }), Q.txHash;
167
+ u(q, {
168
+ type: "terminal",
169
+ requestId: Q.requestId,
170
+ status: Q.status,
171
+ txHash: Q.txHash,
172
+ chainId: H
173
+ });
174
+ let $ = new e({
175
+ code: Q.status === v.REJECTED ? "GASLESS_RELAY_REJECTED" : "GASLESS_RELAY_FAILED",
176
+ message: `Gasless: request ${Q.requestId} ended ${Q.status} before any broadcast${Q.errorMessage ? ` — ${Q.errorMessage}` : ""}.`,
177
+ status: 200,
178
+ statusText: "OK",
179
+ responseData: d(Q),
180
+ url: I.url,
181
+ method: "GET"
182
+ });
183
+ if (z === "wallet" && y($)) return null;
184
+ throw $;
185
+ }
186
+ //#endregion
187
+ export { P as maybeRelayAsGasless };
188
+
189
+ //# sourceMappingURL=maybe-relay-as-gasless.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maybe-relay-as-gasless.js","names":[],"sources":["../../../src/gasless/dispatch/maybe-relay-as-gasless.ts"],"sourcesContent":["import type { Address, Hash, Hex } from \"viem\";\nimport type { GaslessExecutionConfig, SymmioGaslessConfig } from \"../../core/chains/types\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { GaslessWriteOptions } from \"../../shared/types/properties\";\nimport { getInstantLayerEip712Domain, signSignedOperation } from \"../../solvers/instant-open/shared/eip712\";\nimport { buildSignedOperation } from \"../../solvers/instant-open/shared/operations\";\nimport { getVirtualAccount } from \"../../symmio-contracts/account-layer/actions/get-virtual-account\";\nimport { getInstantLayerNonce } from \"../../symmio-contracts/instant-layer/actions/get-instant-layer-nonce\";\nimport { assertGaslessGatewayCoherence } from \"../assert-gateway-coherence\";\nimport { findUndelegatedGaslessSelectors, getCachedGaslessAccountOwner } from \"../delegation-preflight\";\nimport { fireGaslessEvent, toGaslessRecordBody } from \"../events\";\nimport { isConfirmedGaslessFeeLimitError, isConfirmedGaslessUnavailableError } from \"../fallback\";\nimport { isGaslessFreeQuotaExhaustedError } from \"../get-gasless-fee-quote/fee-quote-errors\";\nimport { getGaslessFeeQuote } from \"../get-gasless-fee-quote/get-gasless-fee-quote\";\nimport { generateGaslessIdempotencyKey, isGaslessAcceptedInstanceMismatchError } from \"../http\";\nimport {\n blocksGaslessNonceStream,\n gaslessInstantNonceStreamKey,\n readGaslessStreamNonce,\n submitOnGaslessNonceStream,\n withGaslessNonceLock,\n} from \"../nonce-lock\";\nimport { relayInstantOperations } from \"../relay-instant-operations/relay-instant-operations\";\nimport { GASLESS_RELAYABLE_WRITES } from \"../relayable-writes\";\nimport { resolveGaslessService, supportsGaslessService } from \"../resolve-gasless\";\nimport { GaslessRequestStatus, type GaslessSubmitReceipt } from \"../types\";\nimport { getGaslessUnconfirmedSubmit, isGaslessIdempotencyConflictError } from \"../unconfirmed-submit\";\nimport { waitForGaslessRequest } from \"../wait-for-gasless-request/wait-for-gasless-request\";\nimport { registerGaslessWriteRequest } from \"../write-request-registry\";\n\n/** How long a relayed operation's signature stays valid. */\nconst GASLESS_OPERATION_DEADLINE_SECONDS = 20 * 60;\n\n/** One inner call of a write the dispatcher may relay. @internal */\nexport interface GaslessDispatchCall {\n /** Contract the calldata targets (core diamond or AccountLayer). */\n target: Address;\n /** Raw function calldata. */\n callData: Hex;\n}\n\n/** Input the write seams hand to {@link maybeRelayAsGasless}. @internal */\nexport interface MaybeRelayAsGaslessParameters {\n chainId?: number;\n from?: Address;\n /** The write's `gasless` parameter, verbatim. */\n gasless: boolean | GaslessWriteOptions | undefined;\n /** The calls, in execution order (a multi-call `_call` batch stays atomic as a relay batch). */\n calls: readonly GaslessDispatchCall[];\n /**\n * The sub-account the operations run under. The `_call` seam knows it; the\n * margin seam passes `virtualAccount` instead and the parent is resolved\n * on-chain (or taken from `gasless.account`).\n */\n signerAccount?: Address;\n /** The virtual account of a margin write, for parent-sub-account resolution. */\n virtualAccount?: Address;\n /**\n * An account a write targets that may be either a sub-account or a virtual\n * account — the deposit seams cannot tell the two apart from their parameters.\n * A VA resolves to its parent sub-account (a VA has no balance of its own to\n * bill); anything else is used as the billing account unchanged. Unlike\n * {@link MaybeRelayAsGaslessParameters.virtualAccount} this never throws for a\n * non-VA address.\n */\n accountMaybeVirtual?: Address;\n}\n\n/**\n * What the locked read-sign-submit section hands back: the acceptance and the\n * owner it was tracked under, or `\"wallet\"` when a definitive pre-broadcast\n * rejection sends the write down the wallet path.\n */\ntype GaslessDispatchSubmit = { receipt: GaslessSubmitReceipt; owner: Address } | \"wallet\";\n\ninterface ResolvedGaslessDispatch {\n gasless: SymmioGaslessConfig;\n options: GaslessWriteOptions;\n execution: GaslessExecutionConfig;\n fallback: \"error\" | \"wallet\";\n}\n\nfunction resolveDispatch(\n config: Config,\n parameters: MaybeRelayAsGaslessParameters,\n): ResolvedGaslessDispatch | \"wallet\" | \"unconfigured-explicit\" {\n const raw = parameters.gasless;\n const options: GaslessWriteOptions = typeof raw === \"boolean\" ? { enabled: raw } : (raw ?? {});\n\n const supported = supportsGaslessService(config, { chainId: parameters.chainId });\n const execution = supported ? (resolveGaslessService(config, { chainId: parameters.chainId }).execution ?? {}) : {};\n const enabled = options.enabled ?? (execution.mode === \"gasless\" ? true : false);\n\n if (!enabled) return \"wallet\";\n if (!supported) {\n /** Implicit (config-driven) mode degrades silently; an explicit `gasless: true` must not. */\n return typeof raw === \"boolean\" || raw?.enabled !== undefined ? \"unconfigured-explicit\" : \"wallet\";\n }\n\n return {\n gasless: resolveGaslessService(config, { chainId: parameters.chainId }),\n options,\n execution,\n fallback: options.fallback ?? execution.fallback ?? \"error\",\n };\n}\n\n/**\n * The transparent gasless dispatcher. Called by relayable write actions before\n * their wallet path: returns the relayer's broadcast transaction hash when the\n * write was relayed, or `null` when the caller must proceed on the normal\n * gas-paid wallet path (gasless off, unsupported selector, or a definitive\n * pre-broadcast rejection under `fallback: \"wallet\"`).\n *\n * The full policy lives in the docs; the load-bearing rules are:\n * - **202 is the point of no return** — after acceptance there is no wallet\n * fallback ever, except a `rejected` terminal whose cause is a confirmed\n * fee/quota limit (nothing was broadcast, so a wallet retry cannot\n * double-execute).\n * - A user's signature rejection always propagates — the user said no.\n * - The returned hash behaves exactly like a wallet-submitted hash: the\n * caller's receipt-wait and invalidation pipelines run unchanged.\n * - A signer that is not the sub-account's owner is checked against its\n * InstantLayer delegations **before** the signature prompt\n * (`execution.preflightDelegation`, default on): a session key missing a\n * selector throws `GASLESS_SIGNER_NOT_DELEGATED` — the selector set to grant\n * is the one `getSessionKeySelectors` builds. Under `fallback: \"wallet\"` that\n * rejection returns `null` instead, exactly like an exhausted free quota; note\n * the wallet path will then fail too for a session key, which holds no gas\n * and is not the owner — guarding that is the caller's concern, not this\n * dispatcher's.\n * - The fee quote runs **before** the signature prompt too\n * (`execution.preflightFee`, default on). An exhausted daily free quota throws\n * `GASLESS_FREE_QUOTA_EXHAUSTED` (or returns `null` under `fallback: \"wallet\"`);\n * a quote the contract rejects throws `GASLESS_FEE_QUOTE_REVERTED` and a\n * GaslessLayer without the multi-wallet interface throws\n * `GASLESS_LAYER_INTERFACE_UNSUPPORTED`, neither with a fallback. A quote that\n * fails for transport reasons does not block: the relayer's own simulation is\n * authoritative.\n *\n * @internal\n */\nexport async function maybeRelayAsGasless(\n config: Config,\n parameters: MaybeRelayAsGaslessParameters,\n): Promise<Hash | null> {\n const resolved = resolveDispatch(config, parameters);\n if (resolved === \"wallet\") return null;\n if (resolved === \"unconfigured-explicit\") {\n /** Throws the precise typed error (not-configured vs wrong contracts version). */\n resolveGaslessService(config, { chainId: parameters.chainId });\n return null;\n }\n const { gasless, options, execution, fallback } = resolved;\n\n /** Selector gate — any non-relayable call sends the whole write to the wallet path. */\n const writes = parameters.calls.map((call) =>\n GASLESS_RELAYABLE_WRITES.get(call.callData.slice(0, 10).toLowerCase() as Hex),\n );\n if (writes.some((write) => write === undefined)) {\n if (options.enabled === true) {\n if (fallback === \"wallet\") return null;\n throw new SymmError(\n \"validation\",\n \"GASLESS_NOT_RELAYABLE\",\n \"Gasless: this write's calldata is not relayable through the gasless service.\",\n );\n }\n return null;\n }\n const operationType = writes[0]?.operationType ?? \"gaslessWrite\";\n\n const chain = config.getChainConfig(parameters.chainId);\n const chainId = chain.chainId;\n\n await assertGaslessGatewayCoherence(config, chainId, gasless);\n\n /** Billing/authority account: explicit override → seam-provided sub-account → VA parent. */\n let signerAccount = options.account ?? parameters.signerAccount;\n if (!signerAccount && parameters.accountMaybeVirtual) {\n const detail = await getVirtualAccount(config, { chainId, account: parameters.accountMaybeVirtual });\n signerAccount = detail.isExists ? detail.parentAccount : parameters.accountMaybeVirtual;\n }\n if (!signerAccount) {\n if (!parameters.virtualAccount) {\n throw new SymmError(\n \"validation\",\n \"GASLESS_ACCOUNT_UNRESOLVED\",\n \"Gasless: no sub-account to relay under — pass `gasless.account`.\",\n );\n }\n const detail = await getVirtualAccount(config, { chainId, account: parameters.virtualAccount });\n if (!detail.isExists) {\n throw new SymmError(\n \"validation\",\n \"GASLESS_ACCOUNT_UNRESOLVED\",\n `Gasless: ${parameters.virtualAccount} is not a known virtual account — pass \\`gasless.account\\` with the paying sub-account.`,\n );\n }\n signerAccount = detail.parentAccount;\n }\n const resolvedSignerAccount = signerAccount;\n\n const walletClient = await config.getWalletClient({ chainId, from: parameters.from });\n\n /**\n * Delegation pre-flight, before any signature prompt. Without it a session key\n * that was never granted a selector still signs, the relayer still accepts,\n * and the InstantLayer reverts on-chain — the user pays a prompt for a write\n * that could never land.\n */\n if (execution.preflightDelegation ?? true) {\n const missing = await findUndelegatedGaslessSelectors(config, {\n chainId,\n signer: walletClient.account.address,\n signerAccount: resolvedSignerAccount,\n selectors: parameters.calls.map((call) => call.callData.slice(0, 10).toLowerCase() as Hex),\n });\n if (missing.length > 0) {\n /** A definitive pre-acceptance rejection, so it honors `fallback: \"wallet\"` like the fee quota does. */\n if (fallback === \"wallet\") return null;\n throw new SymmError(\n \"validation\",\n \"GASLESS_SIGNER_NOT_DELEGATED\",\n `Gasless: signer ${walletClient.account.address} holds no active InstantLayer delegation from sub-account ${resolvedSignerAccount} for selector(s) ${missing.join(\", \")}. Grant them to the session key (the selector set is built by getSessionKeySelectors) or sign this write with the sub-account's owner.`,\n );\n }\n }\n\n const domain = getInstantLayerEip712Domain(config, { chainId });\n const events = execution.onEvent;\n const streamKey = gaslessInstantNonceStreamKey(chainId, resolvedSignerAccount);\n\n /**\n * The lock spans read-sign-submit only. Holding it across the broadcast wait\n * would stall every later write behind one slow relay; instead the signed\n * nonce is recorded on the stream and the next caller waits for it lazily.\n */\n const submitted = await withGaslessNonceLock(config, streamKey, async (): Promise<GaslessDispatchSubmit> => {\n /** Fresh sequential nonces, read inside the lock, immediately before signing. */\n const currentNonce = await readGaslessStreamNonce(config, streamKey, () =>\n getInstantLayerNonce(config, { chainId, account: resolvedSignerAccount }),\n );\n const deadline = BigInt(Math.floor(Date.now() / 1000) + GASLESS_OPERATION_DEADLINE_SECONDS);\n\n const operations = parameters.calls.map((call, index) =>\n buildSignedOperation({\n signer: walletClient.account.address,\n target: call.target,\n callData: call.callData,\n signerAccount: resolvedSignerAccount,\n deadline,\n nonce: currentNonce + BigInt(index + 1),\n }),\n );\n\n /**\n * Fee pre-flight before any signature prompt. Ordinary InstantLayer\n * operations always relay with wallet id 0.\n */\n if (execution.preflightFee ?? true) {\n try {\n await getGaslessFeeQuote(config, { chainId, operations: operations.map((operation) => ({ operation })) });\n } catch (err) {\n /** A definitive pre-acceptance rejection — nothing was signed, so a wallet retry is safe. */\n if (isGaslessFreeQuotaExhaustedError(err)) {\n if (fallback === \"wallet\") return \"wallet\";\n throw err;\n }\n /** A reverted quote or an unsupported GaslessLayer: the relay would fail the same way. */\n if (err instanceof SymmError) throw err;\n /**\n * Anything else is inconclusive: a transport or RPC failure of the quote\n * read itself, or an empty-data revert whose classifying read failed. The\n * relayer simulates the full transaction before accepting it, so signing\n * proceeds.\n */\n }\n }\n\n /** EIP-712 prompts — a user rejection propagates unwrapped, with no fallback. */\n const signatures: Hex[] = [];\n for (const operation of operations) {\n signatures.push(await signSignedOperation(operation, domain, walletClient));\n }\n\n /**\n * One key per signature: the operations above were just signed, so the key\n * is minted here rather than taken from the caller. A caller-supplied key\n * could only ever be reused for a different payload, which the service\n * answers with `409 IDEMPOTENCY_KEY_CONFLICT`.\n */\n const idempotencyKey = generateGaslessIdempotencyKey();\n\n /**\n * `userAddress` is the service's tracking identity, and the vendor asks for\n * a workflow to be persisted under its owner. The billing sub-account's\n * owner is that identity — the signer may be a session key that owns\n * nothing. An unreadable owner falls back to the signer rather than failing\n * a write over a tracking label.\n */\n const owner =\n (await getCachedGaslessAccountOwner(config, chainId, resolvedSignerAccount).catch(() => null)) ??\n walletClient.account.address;\n\n try {\n const receipt = await submitOnGaslessNonceStream(\n config,\n streamKey,\n {\n signedNonce: currentNonce + BigInt(operations.length),\n service: \"operations\",\n chainId,\n deadline,\n },\n () =>\n relayInstantOperations(config, {\n chainId,\n userAddress: owner,\n operationType,\n operations: operations.map((operation, index) => ({ operation, signature: signatures[index]! })),\n idempotencyKey,\n }),\n blocksGaslessNonceStream,\n );\n return { receipt, owner };\n } catch (err) {\n /**\n * The two fallback predicates already exclude everything ambiguous, but\n * the rule this guard encodes is the one that must never be re-derived\n * wrong: an unconfirmed submit, an idempotency conflict and a `2xx` from\n * the wrong instance all describe a request that may be executing right\n * now. Paying for the same intent from the wallet would double-execute\n * it, so they end the write here whatever `fallback` says.\n */\n const mayBeExecuting =\n getGaslessUnconfirmedSubmit(err) !== null ||\n isGaslessIdempotencyConflictError(err) ||\n isGaslessAcceptedInstanceMismatchError(err);\n const canFallBack =\n !mayBeExecuting && (isConfirmedGaslessFeeLimitError(err) || isConfirmedGaslessUnavailableError(err));\n if (canFallBack && fallback === \"wallet\") return \"wallet\";\n throw err;\n }\n });\n\n if (submitted === \"wallet\") return null;\n const { receipt, owner } = submitted;\n\n fireGaslessEvent(events, {\n type: \"accepted\",\n requestId: receipt.requestId,\n service: \"operations\",\n chainId,\n protocolInstance: gasless.protocolInstance ?? null,\n operationType,\n idempotencyKey: receipt.idempotencyKey,\n owner,\n walletIds: receipt.walletIds,\n });\n\n const record = await waitForGaslessRequest(config, {\n chainId,\n requestId: receipt.requestId,\n until: \"broadcast\",\n timeoutMs: options.broadcastTimeoutMs ?? execution.broadcastTimeoutMs,\n queuedPollMs: execution.queuedPollMs,\n submittedPollMs: execution.submittedPollMs,\n signal: options.signal,\n onUpdate: (update) => {\n if (update.txHash)\n fireGaslessEvent(events, { type: \"broadcast\", requestId: update.requestId, txHash: update.txHash, chainId });\n },\n });\n\n if (record.txHash !== null) {\n /**\n * The hash the write is about to return is only the *first* broadcast — the\n * relayer replaces it on a gas bump or a stuck nonce. Registering it here is\n * what lets the caller's receipt wait follow the request instead of a hash\n * that may never mine (`getGaslessWriteRequest`).\n */\n registerGaslessWriteRequest(config, {\n requestId: receipt.requestId,\n service: \"operations\",\n chainId,\n protocolInstance: gasless.protocolInstance ?? null,\n broadcastHash: record.txHash,\n });\n return record.txHash;\n }\n\n /** Terminal without a broadcast: rejected or failed before any transaction. */\n fireGaslessEvent(events, {\n type: \"terminal\",\n requestId: record.requestId,\n status: record.status,\n txHash: record.txHash,\n chainId,\n });\n\n const terminalError = new SymmApiError({\n code: record.status === GaslessRequestStatus.REJECTED ? \"GASLESS_RELAY_REJECTED\" : \"GASLESS_RELAY_FAILED\",\n message: `Gasless: request ${record.requestId} ended ${record.status} before any broadcast${record.errorMessage ? ` — ${record.errorMessage}` : \"\"}.`,\n status: 200,\n statusText: \"OK\",\n responseData: toGaslessRecordBody(record),\n url: gasless.url,\n method: \"GET\",\n });\n\n /** A confirmed fee/quota rejection never broadcast — the one post-202 wallet fallback. */\n if (fallback === \"wallet\" && isConfirmedGaslessFeeLimitError(terminalError)) return null;\n throw terminalError;\n}\n"],"mappings":"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"}
@@ -0,0 +1,79 @@
1
+ import { TypedDataDomain } from 'viem';
2
+ import { Config } from '../core/config/index.js';
3
+ /**
4
+ * EIP-712 domain name of the GaslessLayer.
5
+ *
6
+ * Deliberately the literal `"GaslessGateway"`: the contract was renamed to
7
+ * GaslessLayer, but the on-chain domain string was intentionally kept —
8
+ * "fixing" this constant breaks every wallet-operation signature.
9
+ */
10
+ export declare const GASLESS_GATEWAY_EIP712_DOMAIN_NAME: "GaslessGateway";
11
+ /** EIP-712 domain version of the GaslessLayer. */
12
+ export declare const GASLESS_GATEWAY_EIP712_DOMAIN_VERSION: "1";
13
+ /**
14
+ * EIP-712 type table for a **gasless-wallet operation** — the gateway-domain
15
+ * `SignedOperation`.
16
+ *
17
+ * NOT the InstantLayer table: this struct has **five** fields — no
18
+ * `flexFields`, no `maxUses`. The relay transport still requires
19
+ * `flexFields: []` and `maxUses: 1` in the JSON body, appended *after*
20
+ * signing; including them in the signed struct produces a digest the gateway
21
+ * rejects.
22
+ */
23
+ export declare const GASLESS_WALLET_OPERATION_TYPES: {
24
+ readonly Account: readonly [{
25
+ readonly name: "addr";
26
+ readonly type: "address";
27
+ }, {
28
+ readonly name: "isPartyB";
29
+ readonly type: "bool";
30
+ }];
31
+ readonly ReplayAttackHeader: readonly [{
32
+ readonly name: "nonce";
33
+ readonly type: "uint256";
34
+ }, {
35
+ readonly name: "deadline";
36
+ readonly type: "uint256";
37
+ }, {
38
+ readonly name: "salt";
39
+ readonly type: "bytes32";
40
+ }];
41
+ readonly SignedOperation: readonly [{
42
+ readonly name: "signer";
43
+ readonly type: "address";
44
+ }, {
45
+ readonly name: "target";
46
+ readonly type: "address";
47
+ }, {
48
+ readonly name: "callData";
49
+ readonly type: "bytes";
50
+ }, {
51
+ readonly name: "signerAccount";
52
+ readonly type: "Account";
53
+ }, {
54
+ readonly name: "replayAttackHeader";
55
+ readonly type: "ReplayAttackHeader";
56
+ }];
57
+ };
58
+ /**
59
+ * Build the GaslessLayer's EIP-712 domain for a chain.
60
+ *
61
+ * `verifyingContract` is the **GaslessLayer** address (from the chain's
62
+ * `gasless` block) — while a wallet operation's `target` is the deterministic
63
+ * gasless wallet. The two are easy to swap; swapping them yields
64
+ * `InvalidWalletOperationTarget` from simulation.
65
+ *
66
+ * @param config - The SDK config.
67
+ * @param options - Optional chain override.
68
+ * @returns The typed-data domain for gateway-domain signatures.
69
+ * @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const domain = getGaslessGatewayEip712Domain(config, { chainId });
74
+ * ```
75
+ */
76
+ export declare function getGaslessGatewayEip712Domain(config: Config, options?: {
77
+ chainId?: number;
78
+ }): TypedDataDomain;
79
+ //# sourceMappingURL=eip712.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eip712.d.ts","sourceRoot":"","sources":["../../src/gasless/eip712.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC,EAAG,gBAAyB,CAAC;AAE5E,kDAAkD;AAClD,eAAO,MAAM,qCAAqC,EAAG,GAAY,CAAC;AAElE;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBjC,CAAC;AAEX;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,eAAe,CASjH"}
@@ -0,0 +1,60 @@
1
+ import { resolveGaslessService as e } from "./resolve-gasless.js";
2
+ //#region src/gasless/eip712.ts
3
+ var t = "GaslessGateway", n = "1", r = {
4
+ Account: [{
5
+ name: "addr",
6
+ type: "address"
7
+ }, {
8
+ name: "isPartyB",
9
+ type: "bool"
10
+ }],
11
+ ReplayAttackHeader: [
12
+ {
13
+ name: "nonce",
14
+ type: "uint256"
15
+ },
16
+ {
17
+ name: "deadline",
18
+ type: "uint256"
19
+ },
20
+ {
21
+ name: "salt",
22
+ type: "bytes32"
23
+ }
24
+ ],
25
+ SignedOperation: [
26
+ {
27
+ name: "signer",
28
+ type: "address"
29
+ },
30
+ {
31
+ name: "target",
32
+ type: "address"
33
+ },
34
+ {
35
+ name: "callData",
36
+ type: "bytes"
37
+ },
38
+ {
39
+ name: "signerAccount",
40
+ type: "Account"
41
+ },
42
+ {
43
+ name: "replayAttackHeader",
44
+ type: "ReplayAttackHeader"
45
+ }
46
+ ]
47
+ };
48
+ function i(n, r = {}) {
49
+ let i = n.getChainConfig(r.chainId), a = e(n, { chainId: r.chainId });
50
+ return {
51
+ name: t,
52
+ version: "1",
53
+ chainId: i.chainId,
54
+ verifyingContract: a.gaslessLayerAddress
55
+ };
56
+ }
57
+ //#endregion
58
+ export { t as GASLESS_GATEWAY_EIP712_DOMAIN_NAME, n as GASLESS_GATEWAY_EIP712_DOMAIN_VERSION, r as GASLESS_WALLET_OPERATION_TYPES, i as getGaslessGatewayEip712Domain };
59
+
60
+ //# sourceMappingURL=eip712.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eip712.js","names":[],"sources":["../../src/gasless/eip712.ts"],"sourcesContent":["import type { TypedDataDomain } from \"viem\";\nimport type { Config } from \"../core/config\";\nimport { resolveGaslessService } from \"./resolve-gasless\";\n\n/**\n * EIP-712 domain name of the GaslessLayer.\n *\n * Deliberately the literal `\"GaslessGateway\"`: the contract was renamed to\n * GaslessLayer, but the on-chain domain string was intentionally kept —\n * \"fixing\" this constant breaks every wallet-operation signature.\n */\nexport const GASLESS_GATEWAY_EIP712_DOMAIN_NAME = \"GaslessGateway\" as const;\n\n/** EIP-712 domain version of the GaslessLayer. */\nexport const GASLESS_GATEWAY_EIP712_DOMAIN_VERSION = \"1\" as const;\n\n/**\n * EIP-712 type table for a **gasless-wallet operation** — the gateway-domain\n * `SignedOperation`.\n *\n * NOT the InstantLayer table: this struct has **five** fields — no\n * `flexFields`, no `maxUses`. The relay transport still requires\n * `flexFields: []` and `maxUses: 1` in the JSON body, appended *after*\n * signing; including them in the signed struct produces a digest the gateway\n * rejects.\n */\nexport const GASLESS_WALLET_OPERATION_TYPES = {\n Account: [\n { name: \"addr\", type: \"address\" },\n { name: \"isPartyB\", type: \"bool\" },\n ],\n ReplayAttackHeader: [\n { name: \"nonce\", type: \"uint256\" },\n { name: \"deadline\", type: \"uint256\" },\n { name: \"salt\", type: \"bytes32\" },\n ],\n SignedOperation: [\n { name: \"signer\", type: \"address\" },\n { name: \"target\", type: \"address\" },\n { name: \"callData\", type: \"bytes\" },\n { name: \"signerAccount\", type: \"Account\" },\n { name: \"replayAttackHeader\", type: \"ReplayAttackHeader\" },\n ],\n} as const;\n\n/**\n * Build the GaslessLayer's EIP-712 domain for a chain.\n *\n * `verifyingContract` is the **GaslessLayer** address (from the chain's\n * `gasless` block) — while a wallet operation's `target` is the deterministic\n * gasless wallet. The two are easy to swap; swapping them yields\n * `InvalidWalletOperationTarget` from simulation.\n *\n * @param config - The SDK config.\n * @param options - Optional chain override.\n * @returns The typed-data domain for gateway-domain signatures.\n * @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.\n *\n * @example\n * ```ts\n * const domain = getGaslessGatewayEip712Domain(config, { chainId });\n * ```\n */\nexport function getGaslessGatewayEip712Domain(config: Config, options: { chainId?: number } = {}): TypedDataDomain {\n const chain = config.getChainConfig(options.chainId);\n const gasless = resolveGaslessService(config, { chainId: options.chainId });\n return {\n name: GASLESS_GATEWAY_EIP712_DOMAIN_NAME,\n version: GASLESS_GATEWAY_EIP712_DOMAIN_VERSION,\n chainId: chain.chainId,\n verifyingContract: gasless.gaslessLayerAddress,\n };\n}\n"],"mappings":";;AAWA,IAAa,IAAqC,kBAGrC,IAAwC,KAYxC,IAAiC;CAC5C,SAAS,CACP;EAAE,MAAM;EAAQ,MAAM;CAAU,GAChC;EAAE,MAAM;EAAY,MAAM;CAAO,CACnC;CACA,oBAAoB;EAClB;GAAE,MAAM;GAAS,MAAM;EAAU;EACjC;GAAE,MAAM;GAAY,MAAM;EAAU;EACpC;GAAE,MAAM;GAAQ,MAAM;EAAU;CAClC;CACA,iBAAiB;EACf;GAAE,MAAM;GAAU,MAAM;EAAU;EAClC;GAAE,MAAM;GAAU,MAAM;EAAU;EAClC;GAAE,MAAM;GAAY,MAAM;EAAQ;EAClC;GAAE,MAAM;GAAiB,MAAM;EAAU;EACzC;GAAE,MAAM;GAAsB,MAAM;EAAqB;CAC3D;AACF;AAoBA,SAAgB,EAA8B,GAAgB,IAAgC,CAAC,GAAoB;CACjH,IAAM,IAAQ,EAAO,eAAe,EAAQ,OAAO,GAC7C,IAAU,EAAsB,GAAQ,EAAE,SAAS,EAAQ,QAAQ,CAAC;CAC1E,OAAO;EACL,MAAM;EACN,SAAA;EACA,SAAS,EAAM;EACf,mBAAmB,EAAQ;CAC7B;AACF"}
@@ -0,0 +1,132 @@
1
+ import { Hex } from 'viem';
2
+ /**
3
+ * A decoded on-chain custom error the service extracted from a failed
4
+ * `eth_call` simulation and returned inside `details.contract_revert`.
5
+ */
6
+ export interface GaslessContractRevert {
7
+ /** 4-byte error selector. */
8
+ selector: string;
9
+ /** Custom-error name, e.g. `"InvalidWalletOperationTarget"`. */
10
+ error: string;
11
+ /** Full error signature when the node supplied it. */
12
+ signature?: string;
13
+ /**
14
+ * Decoded argument values — a positional array, or an object keyed by
15
+ * parameter name. The vendor sends whichever its decoder produced, so both
16
+ * shapes reach a consumer and neither can be assumed; narrow with
17
+ * `Array.isArray` before indexing.
18
+ */
19
+ arguments?: readonly unknown[] | Record<string, unknown>;
20
+ /** Decoded arguments keyed by parameter name, when available. */
21
+ decoded?: Record<string, unknown> | string;
22
+ }
23
+ /**
24
+ * The batch entry an `OperationFailed(operationIndex, revertData)` revert
25
+ * blames, as the service reported it.
26
+ *
27
+ * The InstantLayer wraps every inner revert of a relayed batch in this error,
28
+ * so the generic simulation message never names the call that actually failed.
29
+ * Decode `revertData` against the failing target's ABI with
30
+ * {@link decodeGaslessOperationFailure} to get the real cause.
31
+ */
32
+ export interface GaslessFailedOperation {
33
+ /** Zero-based position of the failing operation in the submitted batch. */
34
+ index: number;
35
+ /** The inner revert data, to decode against the target contract's ABI. */
36
+ revertData: Hex;
37
+ }
38
+ /**
39
+ * One request-validation failure from a FastAPI `422` response, whose body is
40
+ * `{ "detail": [{ "loc", "msg", "type" }] }`. The service rejected the
41
+ * payload's shape before acting on it, so a `422` is a client bug to fix, not a
42
+ * condition a user can resolve.
43
+ */
44
+ export interface GaslessValidationIssue {
45
+ /** Path to the offending input, e.g. `["path", "request_id"]` or `["body", "signedOps", 0, "target"]`. */
46
+ loc: readonly (string | number)[];
47
+ /** Human-readable reason. */
48
+ msg: string;
49
+ /** Machine-readable failure type, e.g. `"uuid_parsing"` or `"missing"`. */
50
+ type: string;
51
+ }
52
+ /**
53
+ * The vendor's structured error detail, normalized from whichever envelope an
54
+ * HTTP error used: the service's `{ detail: { code, message, details } }`, the
55
+ * gateway's own `{ error }`, or a FastAPI `422` `{ detail: [...] }`.
56
+ */
57
+ export interface GaslessErrorDetail {
58
+ /** Vendor error code, e.g. `"SIMULATION_REVERTED"`, `"INSUFFICIENT_ALLOWANCE"`. */
59
+ code: string | null;
60
+ /** Human-readable vendor message. */
61
+ message: string | null;
62
+ /** Safe diagnostic context; `contract_revert` is surfaced separately. */
63
+ details: Record<string, unknown> | null;
64
+ /** Decoded on-chain revert, when the node returned custom-error data. */
65
+ contractRevert: GaslessContractRevert | null;
66
+ /**
67
+ * The gateway's own error string, from its `{ "error": "…" }` envelope.
68
+ * The gateway answers authentication, routing and rate-limit failures itself
69
+ * before any service sees the request, e.g.
70
+ * `"Unknown or disabled protocol instance: …"` or `"Rate limit exceeded"`.
71
+ * `null` for errors the service returned.
72
+ */
73
+ gatewayError: string | null;
74
+ /** The request-validation issues of a FastAPI `422` response; `null` for any other error. */
75
+ validationErrors: readonly GaslessValidationIssue[] | null;
76
+ /**
77
+ * The node's plain revert string (`revert_message`), when the simulation
78
+ * produced one. Prefer it, `contractRevert` and {@link GaslessErrorDetail.failedOperation}
79
+ * over the generic `message` when deciding what the user can fix — an
80
+ * `"OperationalFee: Insufficient balance"` here names the payer's shortfall,
81
+ * which the simulation message does not.
82
+ */
83
+ revertMessage: string | null;
84
+ /** The service's own decoded view of the revert (`decoded_revert`), in whatever shape it sent. */
85
+ decodedRevert: unknown;
86
+ /** The nested JSON-RPC error (`rpc_error`) the node returned, when the failure came from the chain. */
87
+ rpcError: Record<string, unknown> | null;
88
+ /** The failing batch entry of an `OperationFailed` revert; `null` when the service named none. */
89
+ failedOperation: GaslessFailedOperation | null;
90
+ }
91
+ /**
92
+ * Every string the service offered about a revert, joined into one haystack.
93
+ *
94
+ * The same cause reaches the client under different keys depending on how far
95
+ * the service got decoding it — a custom-error name, a full signature, a
96
+ * decoded string, the node's `revert_message`, or only the generic message — so
97
+ * a predicate that reads one of them misses the other four.
98
+ *
99
+ * @param detail - A parsed vendor detail, or `null`.
100
+ * @returns The concatenated revert text, empty when there is none.
101
+ *
102
+ * @internal
103
+ */
104
+ export declare function gaslessRevertText(detail: GaslessErrorDetail | null): string;
105
+ /**
106
+ * Extract the vendor's error detail from any error a gasless action throws:
107
+ * the service's `{ code, message, details }` (including a decoded
108
+ * `contract_revert`, when present), the gateway's own `{ error }` string, or a
109
+ * FastAPI `422`'s validation issues.
110
+ *
111
+ * Gasless HTTP failures are thrown as `SymmApiError` with the raw response
112
+ * body preserved in `responseData`; this digs the vendor envelope out of it so
113
+ * UIs can branch on the vendor code (`FEE_POLICY_WOULD_REVERT`,
114
+ * `INSUFFICIENT_ALLOWANCE`, `SIMULATION_REVERTED`, …) without re-parsing.
115
+ * Also understands the flat `{ error_code, error_message }` shape stored on
116
+ * polled records.
117
+ *
118
+ * @param err - Anything caught from a gasless action or read from a record.
119
+ * @returns The normalized detail, or `null` when none can be extracted.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * try {
124
+ * await relayInstantOperations(config, parameters);
125
+ * } catch (err) {
126
+ * const detail = parseGaslessErrorDetail(err);
127
+ * if (detail?.contractRevert) showRevert(detail.contractRevert.error);
128
+ * }
129
+ * ```
130
+ */
131
+ export declare function parseGaslessErrorDetail(err: unknown): GaslessErrorDetail | null;
132
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/gasless/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAGhC;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;CAC5C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,UAAU,EAAE,GAAG,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,0GAA0G;IAC1G,GAAG,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAClC,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,qCAAqC;IACrC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,yEAAyE;IACzE,cAAc,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC7C;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6FAA6F;IAC7F,gBAAgB,EAAE,SAAS,sBAAsB,EAAE,GAAG,IAAI,CAAC;IAC3D;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kGAAkG;IAClG,aAAa,EAAE,OAAO,CAAC;IACvB,uGAAuG;IACvG,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACzC,kGAAkG;IAClG,eAAe,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAChD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,MAAM,CAa3E;AAuHD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAqD/E"}
@@ -0,0 +1,110 @@
1
+ import { SymmApiError as e, SymmError as t } from "../shared/errors/symm-error.js";
2
+ //#region src/gasless/errors.ts
3
+ function n(e) {
4
+ if (!e) return "";
5
+ let t = e.contractRevert;
6
+ return [
7
+ t?.error,
8
+ t?.signature,
9
+ typeof t?.decoded == "string" ? t.decoded : void 0,
10
+ e.revertMessage,
11
+ typeof e.decodedRevert == "string" ? e.decodedRevert : void 0,
12
+ e.message
13
+ ].filter((e) => typeof e == "string").join(" | ");
14
+ }
15
+ function r(e) {
16
+ return typeof e == "object" && e && !Array.isArray(e) ? e : null;
17
+ }
18
+ function i(e) {
19
+ return e.flatMap((e) => {
20
+ if (typeof e == "string") return [{
21
+ loc: [],
22
+ msg: e,
23
+ type: ""
24
+ }];
25
+ let t = r(e);
26
+ return t ? [{
27
+ loc: Array.isArray(t.loc) ? t.loc.filter((e) => typeof e == "string" || typeof e == "number") : [],
28
+ msg: typeof t.msg == "string" ? t.msg : "",
29
+ type: typeof t.type == "string" ? t.type : ""
30
+ }] : [];
31
+ });
32
+ }
33
+ function a(e, ...t) {
34
+ for (let n of e) if (n) {
35
+ for (let e of t) if (n[e] !== void 0 && n[e] !== null) return n[e];
36
+ }
37
+ }
38
+ function o(e) {
39
+ if (typeof e == "number") return Number.isSafeInteger(e) && e >= 0 ? e : null;
40
+ if (typeof e == "bigint") return e >= 0n && e <= BigInt(2 ** 53 - 1) ? Number(e) : null;
41
+ if (typeof e == "string" && /^\d+$/.test(e)) {
42
+ let t = Number(e);
43
+ return Number.isSafeInteger(t) ? t : null;
44
+ }
45
+ return null;
46
+ }
47
+ function s(e) {
48
+ return typeof e == "string" && /^0x[0-9a-fA-F]*$/.test(e) ? e : null;
49
+ }
50
+ function c(e, t) {
51
+ let n = [r(a(e, "failed_operation", "failedOperation")), ...e];
52
+ for (let e of n) {
53
+ if (!e) continue;
54
+ let t = o(e.index ?? e.operation_index ?? e.operationIndex), n = s(e.revert_data ?? e.revertData);
55
+ if (t !== null && n !== null) return {
56
+ index: t,
57
+ revertData: n
58
+ };
59
+ }
60
+ if (t?.error !== "OperationFailed") return null;
61
+ let i = t.arguments;
62
+ if (Array.isArray(i)) {
63
+ let e = o(i[0]), t = s(i[1]);
64
+ return e !== null && t !== null ? {
65
+ index: e,
66
+ revertData: t
67
+ } : null;
68
+ }
69
+ let c = r(i) ?? r(t.decoded);
70
+ if (!c) return null;
71
+ let l = o(c.operationIndex ?? c.operation_index ?? c.index), u = s(c.revertData ?? c.revert_data);
72
+ return l !== null && u !== null ? {
73
+ index: l,
74
+ revertData: u
75
+ } : null;
76
+ }
77
+ function l(e) {
78
+ return typeof e == "object" && e && "responseData" in e ? e.responseData : e;
79
+ }
80
+ function u(n) {
81
+ let o = n instanceof e ? n.responseData : n instanceof t ? null : l(n);
82
+ if (o instanceof Error) return null;
83
+ let s = r(o);
84
+ if (!s) return null;
85
+ let u = typeof s.error == "string" ? s.error : null, d = Array.isArray(s.detail) ? i(s.detail) : [], f = d.length > 0 ? d : null, p = r(s.detail) ?? s, m = p.code ?? p.error_code, h = p.message ?? p.error_message, g = r(p.details), _ = r(a([p, g], "contract_revert", "contractRevert"));
86
+ if (m === void 0 && h === void 0 && !g && u === null && f === null) return null;
87
+ let v = _?.arguments, y = _ && typeof _.error == "string" ? {
88
+ selector: typeof _.selector == "string" ? _.selector : "0x",
89
+ error: _.error,
90
+ ...typeof _.signature == "string" ? { signature: _.signature } : {},
91
+ ...Array.isArray(v) || r(v) ? { arguments: v } : {},
92
+ ..._.decoded === void 0 ? {} : { decoded: _.decoded }
93
+ } : null, b = [p, g], x = a(b, "revert_message", "revertMessage");
94
+ return {
95
+ code: typeof m == "string" ? m : null,
96
+ message: typeof h == "string" ? h : null,
97
+ details: g,
98
+ contractRevert: y,
99
+ gatewayError: u,
100
+ validationErrors: f,
101
+ revertMessage: typeof x == "string" ? x : null,
102
+ decodedRevert: a(b, "decoded_revert", "decodedRevert"),
103
+ rpcError: r(a(b, "rpc_error", "rpcError")),
104
+ failedOperation: c(b, y)
105
+ };
106
+ }
107
+ //#endregion
108
+ export { n as gaslessRevertText, u as parseGaslessErrorDetail };
109
+
110
+ //# sourceMappingURL=errors.js.map