@aa-sdk/core 4.0.0-alpha.0 → 4.0.0-alpha.10

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 (342) hide show
  1. package/dist/cjs/account/smartContractAccount.d.ts +9 -3
  2. package/dist/cjs/account/smartContractAccount.js +13 -7
  3. package/dist/cjs/account/smartContractAccount.js.map +1 -1
  4. package/dist/cjs/actions/smartAccount/buildUserOperation.js.map +1 -1
  5. package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
  6. package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
  7. package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
  8. package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
  9. package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
  10. package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +1 -1
  11. package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
  12. package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
  13. package/dist/cjs/actions/smartAccount/sendTransaction.js.map +1 -1
  14. package/dist/cjs/actions/smartAccount/sendTransactions.js.map +1 -1
  15. package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
  16. package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
  17. package/dist/cjs/client/bundlerClient.js.map +1 -1
  18. package/dist/cjs/client/decorators/bundlerClient.js.map +1 -1
  19. package/dist/cjs/client/decorators/smartAccountClient.js.map +1 -1
  20. package/dist/cjs/client/isSmartAccountClient.js.map +1 -1
  21. package/dist/cjs/client/smartAccountClient.js.map +1 -1
  22. package/dist/cjs/client/types.d.ts +2 -7
  23. package/dist/cjs/client/types.js.map +1 -1
  24. package/dist/cjs/ens/utils.d.ts +1 -1
  25. package/dist/cjs/ens/utils.js +3 -3
  26. package/dist/cjs/ens/utils.js.map +1 -1
  27. package/dist/cjs/entrypoint/index.js.map +1 -1
  28. package/dist/cjs/errors/account.js.map +1 -1
  29. package/dist/cjs/errors/base.js.map +1 -1
  30. package/dist/cjs/errors/client.js.map +1 -1
  31. package/dist/cjs/errors/entrypoint.js.map +1 -1
  32. package/dist/cjs/errors/signer.js.map +1 -1
  33. package/dist/cjs/errors/transaction.js.map +1 -1
  34. package/dist/cjs/errors/useroperation.js.map +1 -1
  35. package/dist/cjs/index.d.ts +4 -7
  36. package/dist/cjs/index.js +38 -66
  37. package/dist/cjs/index.js.map +1 -1
  38. package/dist/cjs/logger.js.map +1 -1
  39. package/dist/cjs/middleware/actions.js +2 -18
  40. package/dist/cjs/middleware/actions.js.map +1 -1
  41. package/dist/cjs/middleware/defaults/feeEstimator.d.ts +1 -1
  42. package/dist/cjs/middleware/defaults/feeEstimator.js +17 -15
  43. package/dist/cjs/middleware/defaults/feeEstimator.js.map +1 -1
  44. package/dist/cjs/middleware/defaults/gasEstimator.js +4 -2
  45. package/dist/cjs/middleware/defaults/gasEstimator.js.map +1 -1
  46. package/dist/cjs/middleware/defaults/paymasterAndData.js.map +1 -1
  47. package/dist/cjs/middleware/defaults/userOpSigner.js.map +1 -1
  48. package/dist/cjs/middleware/erc7677middleware.d.ts +40 -0
  49. package/dist/cjs/middleware/erc7677middleware.js +77 -0
  50. package/dist/cjs/middleware/erc7677middleware.js.map +1 -0
  51. package/dist/cjs/middleware/noopMiddleware.d.ts +2 -1
  52. package/dist/cjs/middleware/noopMiddleware.js.map +1 -1
  53. package/dist/cjs/middleware/types.d.ts +3 -2
  54. package/dist/cjs/middleware/types.js.map +1 -1
  55. package/dist/cjs/signer/local-account.d.ts +44 -44
  56. package/dist/cjs/signer/local-account.js.map +1 -1
  57. package/dist/cjs/signer/schema.js.map +1 -1
  58. package/dist/cjs/signer/utils.d.ts +1 -9
  59. package/dist/cjs/signer/utils.js +1 -16
  60. package/dist/cjs/signer/utils.js.map +1 -1
  61. package/dist/cjs/signer/wallet-client.d.ts +44 -44
  62. package/dist/cjs/signer/wallet-client.js.map +1 -1
  63. package/dist/cjs/transport/split.js.map +1 -1
  64. package/dist/cjs/utils/bigint.js.map +1 -1
  65. package/dist/cjs/utils/bytes.js.map +1 -1
  66. package/dist/cjs/utils/defaults.d.ts +2 -4
  67. package/dist/cjs/utils/defaults.js +5 -45
  68. package/dist/cjs/utils/defaults.js.map +1 -1
  69. package/dist/cjs/utils/index.d.ts +0 -4
  70. package/dist/cjs/utils/index.js +1 -33
  71. package/dist/cjs/utils/index.js.map +1 -1
  72. package/dist/cjs/utils/types.js.map +1 -1
  73. package/dist/cjs/utils/userop.js.map +1 -1
  74. package/dist/cjs/version.d.ts +1 -1
  75. package/dist/cjs/version.js +1 -1
  76. package/dist/cjs/version.js.map +1 -1
  77. package/dist/esm/account/smartContractAccount.d.ts +9 -3
  78. package/dist/esm/account/smartContractAccount.js +8 -2
  79. package/dist/esm/account/smartContractAccount.js.map +1 -1
  80. package/dist/esm/actions/smartAccount/buildUserOperation.js.map +1 -1
  81. package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
  82. package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
  83. package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
  84. package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
  85. package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
  86. package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
  87. package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
  88. package/dist/esm/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
  89. package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -1
  90. package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -1
  91. package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
  92. package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
  93. package/dist/esm/client/bundlerClient.js.map +1 -1
  94. package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
  95. package/dist/esm/client/decorators/smartAccountClient.js.map +1 -1
  96. package/dist/esm/client/isSmartAccountClient.js.map +1 -1
  97. package/dist/esm/client/smartAccountClient.js.map +1 -1
  98. package/dist/esm/client/types.d.ts +2 -7
  99. package/dist/esm/client/types.js.map +1 -1
  100. package/dist/esm/ens/utils.d.ts +1 -1
  101. package/dist/esm/ens/utils.js +1 -1
  102. package/dist/esm/ens/utils.js.map +1 -1
  103. package/dist/esm/entrypoint/index.js.map +1 -1
  104. package/dist/esm/errors/account.js.map +1 -1
  105. package/dist/esm/errors/base.js.map +1 -1
  106. package/dist/esm/errors/client.js.map +1 -1
  107. package/dist/esm/errors/entrypoint.js.map +1 -1
  108. package/dist/esm/errors/signer.js.map +1 -1
  109. package/dist/esm/errors/transaction.js.map +1 -1
  110. package/dist/esm/errors/useroperation.js.map +1 -1
  111. package/dist/esm/index.d.ts +4 -7
  112. package/dist/esm/index.js +3 -5
  113. package/dist/esm/index.js.map +1 -1
  114. package/dist/esm/logger.js.map +1 -1
  115. package/dist/esm/middleware/actions.js +3 -18
  116. package/dist/esm/middleware/actions.js.map +1 -1
  117. package/dist/esm/middleware/defaults/feeEstimator.d.ts +1 -1
  118. package/dist/esm/middleware/defaults/feeEstimator.js +17 -15
  119. package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -1
  120. package/dist/esm/middleware/defaults/gasEstimator.js +4 -2
  121. package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
  122. package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -1
  123. package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -1
  124. package/dist/esm/middleware/erc7677middleware.d.ts +40 -0
  125. package/dist/esm/middleware/erc7677middleware.js +73 -0
  126. package/dist/esm/middleware/erc7677middleware.js.map +1 -0
  127. package/dist/esm/middleware/noopMiddleware.d.ts +2 -1
  128. package/dist/esm/middleware/noopMiddleware.js.map +1 -1
  129. package/dist/esm/middleware/types.d.ts +3 -2
  130. package/dist/esm/middleware/types.js.map +1 -1
  131. package/dist/esm/signer/local-account.d.ts +44 -44
  132. package/dist/esm/signer/local-account.js.map +1 -1
  133. package/dist/esm/signer/schema.js.map +1 -1
  134. package/dist/esm/signer/utils.d.ts +1 -9
  135. package/dist/esm/signer/utils.js +0 -14
  136. package/dist/esm/signer/utils.js.map +1 -1
  137. package/dist/esm/signer/wallet-client.d.ts +44 -44
  138. package/dist/esm/signer/wallet-client.js.map +1 -1
  139. package/dist/esm/transport/split.js.map +1 -1
  140. package/dist/esm/utils/bigint.js.map +1 -1
  141. package/dist/esm/utils/bytes.js.map +1 -1
  142. package/dist/esm/utils/defaults.d.ts +2 -4
  143. package/dist/esm/utils/defaults.js +1 -40
  144. package/dist/esm/utils/defaults.js.map +1 -1
  145. package/dist/esm/utils/index.d.ts +0 -4
  146. package/dist/esm/utils/index.js +0 -18
  147. package/dist/esm/utils/index.js.map +1 -1
  148. package/dist/esm/utils/types.js.map +1 -1
  149. package/dist/esm/utils/userop.js.map +1 -1
  150. package/dist/esm/version.d.ts +1 -1
  151. package/dist/esm/version.js +1 -1
  152. package/dist/esm/version.js.map +1 -1
  153. package/dist/types/account/smartContractAccount.d.ts +58 -3
  154. package/dist/types/account/smartContractAccount.d.ts.map +1 -1
  155. package/dist/types/actions/smartAccount/buildUserOperation.d.ts +23 -0
  156. package/dist/types/actions/smartAccount/buildUserOperation.d.ts.map +1 -1
  157. package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts +33 -33
  158. package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts +43 -59
  159. package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts.map +1 -1
  160. package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +18 -18
  161. package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts +22 -0
  162. package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -1
  163. package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts +3 -3
  164. package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts +3 -4
  165. package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts.map +1 -1
  166. package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts +0 -14
  167. package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts.map +1 -1
  168. package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts +0 -7
  169. package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts.map +1 -1
  170. package/dist/types/actions/smartAccount/sendTransaction.d.ts +24 -0
  171. package/dist/types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
  172. package/dist/types/actions/smartAccount/sendTransactions.d.ts +23 -0
  173. package/dist/types/actions/smartAccount/sendTransactions.d.ts.map +1 -1
  174. package/dist/types/actions/smartAccount/sendUserOperation.d.ts +17 -3
  175. package/dist/types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
  176. package/dist/types/actions/smartAccount/waitForUserOperationTransacation.d.ts +24 -0
  177. package/dist/types/actions/smartAccount/waitForUserOperationTransacation.d.ts.map +1 -1
  178. package/dist/types/client/bundlerClient.d.ts +17 -2
  179. package/dist/types/client/bundlerClient.d.ts.map +1 -1
  180. package/dist/types/client/decorators/bundlerClient.d.ts +17 -8
  181. package/dist/types/client/decorators/bundlerClient.d.ts.map +1 -1
  182. package/dist/types/client/decorators/smartAccountClient.d.ts +8 -0
  183. package/dist/types/client/decorators/smartAccountClient.d.ts.map +1 -1
  184. package/dist/types/client/isSmartAccountClient.d.ts +4 -4
  185. package/dist/types/client/smartAccountClient.d.ts.map +1 -1
  186. package/dist/types/client/types.d.ts +2 -7
  187. package/dist/types/client/types.d.ts.map +1 -1
  188. package/dist/types/ens/utils.d.ts +46 -1
  189. package/dist/types/ens/utils.d.ts.map +1 -1
  190. package/dist/types/entrypoint/index.d.ts +14 -0
  191. package/dist/types/entrypoint/index.d.ts.map +1 -1
  192. package/dist/types/errors/account.d.ts +87 -4
  193. package/dist/types/errors/account.d.ts.map +1 -1
  194. package/dist/types/errors/base.d.ts +5 -0
  195. package/dist/types/errors/base.d.ts.map +1 -1
  196. package/dist/types/errors/client.d.ts +24 -0
  197. package/dist/types/errors/client.d.ts.map +1 -1
  198. package/dist/types/errors/entrypoint.d.ts +18 -0
  199. package/dist/types/errors/entrypoint.d.ts.map +1 -1
  200. package/dist/types/errors/signer.d.ts +8 -0
  201. package/dist/types/errors/signer.d.ts.map +1 -1
  202. package/dist/types/errors/transaction.d.ts +14 -1
  203. package/dist/types/errors/transaction.d.ts.map +1 -1
  204. package/dist/types/errors/useroperation.d.ts +5 -5
  205. package/dist/types/errors/useroperation.d.ts.map +1 -1
  206. package/dist/types/index.d.ts +4 -7
  207. package/dist/types/index.d.ts.map +1 -1
  208. package/dist/types/logger.d.ts +91 -0
  209. package/dist/types/logger.d.ts.map +1 -1
  210. package/dist/types/middleware/actions.d.ts +3 -3
  211. package/dist/types/middleware/actions.d.ts.map +1 -1
  212. package/dist/types/middleware/defaults/feeEstimator.d.ts +21 -1
  213. package/dist/types/middleware/defaults/feeEstimator.d.ts.map +1 -1
  214. package/dist/types/middleware/defaults/gasEstimator.d.ts +2 -2
  215. package/dist/types/middleware/defaults/gasEstimator.d.ts.map +1 -1
  216. package/dist/types/middleware/defaults/paymasterAndData.d.ts +8 -0
  217. package/dist/types/middleware/defaults/paymasterAndData.d.ts.map +1 -1
  218. package/dist/types/middleware/defaults/userOpSigner.d.ts +10 -0
  219. package/dist/types/middleware/defaults/userOpSigner.d.ts.map +1 -1
  220. package/dist/types/middleware/erc7677middleware.d.ts +62 -0
  221. package/dist/types/middleware/erc7677middleware.d.ts.map +1 -0
  222. package/dist/types/middleware/noopMiddleware.d.ts +4 -4
  223. package/dist/types/middleware/noopMiddleware.d.ts.map +1 -1
  224. package/dist/types/middleware/types.d.ts +3 -2
  225. package/dist/types/middleware/types.d.ts.map +1 -1
  226. package/dist/types/signer/local-account.d.ts +140 -45
  227. package/dist/types/signer/local-account.d.ts.map +1 -1
  228. package/dist/types/signer/schema.d.ts +14 -0
  229. package/dist/types/signer/schema.d.ts.map +1 -1
  230. package/dist/types/signer/utils.d.ts +21 -9
  231. package/dist/types/signer/utils.d.ts.map +1 -1
  232. package/dist/types/signer/wallet-client.d.ts +136 -44
  233. package/dist/types/signer/wallet-client.d.ts.map +1 -1
  234. package/dist/types/transport/split.d.ts +2 -2
  235. package/dist/types/utils/bigint.d.ts +14 -14
  236. package/dist/types/utils/bigint.d.ts.map +1 -1
  237. package/dist/types/utils/bytes.d.ts +5 -5
  238. package/dist/types/utils/defaults.d.ts +2 -12
  239. package/dist/types/utils/defaults.d.ts.map +1 -1
  240. package/dist/types/utils/index.d.ts +66 -23
  241. package/dist/types/utils/index.d.ts.map +1 -1
  242. package/dist/types/utils/types.d.ts +2 -2
  243. package/dist/types/utils/userop.d.ts +33 -33
  244. package/dist/types/version.d.ts +1 -1
  245. package/dist/types/version.d.ts.map +1 -1
  246. package/package.json +4 -3
  247. package/src/account/smartContractAccount.ts +134 -23
  248. package/src/actions/smartAccount/buildUserOperation.ts +23 -0
  249. package/src/actions/smartAccount/buildUserOperationFromTx.ts +35 -35
  250. package/src/actions/smartAccount/buildUserOperationFromTxs.ts +44 -60
  251. package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +19 -19
  252. package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +22 -0
  253. package/src/actions/smartAccount/estimateUserOperationGas.ts +3 -3
  254. package/src/actions/smartAccount/internal/initUserOperation.ts +3 -4
  255. package/src/actions/smartAccount/internal/runMiddlewareStack.ts +0 -22
  256. package/src/actions/smartAccount/internal/sendUserOperation.ts +0 -7
  257. package/src/actions/smartAccount/sendTransaction.ts +24 -0
  258. package/src/actions/smartAccount/sendTransactions.ts +23 -0
  259. package/src/actions/smartAccount/sendUserOperation.ts +17 -3
  260. package/src/actions/smartAccount/waitForUserOperationTransacation.ts +24 -0
  261. package/src/client/bundlerClient.ts +34 -2
  262. package/src/client/decorators/bundlerClient.ts +17 -8
  263. package/src/client/decorators/smartAccountClient.ts +8 -0
  264. package/src/client/isSmartAccountClient.ts +4 -4
  265. package/src/client/smartAccountClient.ts +41 -0
  266. package/src/client/types.ts +2 -15
  267. package/src/ens/utils.ts +46 -2
  268. package/src/entrypoint/index.ts +30 -62
  269. package/src/errors/account.ts +98 -4
  270. package/src/errors/base.ts +5 -2
  271. package/src/errors/client.ts +27 -0
  272. package/src/errors/entrypoint.ts +18 -0
  273. package/src/errors/signer.ts +9 -0
  274. package/src/errors/transaction.ts +16 -1
  275. package/src/errors/useroperation.ts +5 -6
  276. package/src/index.ts +3 -36
  277. package/src/logger.ts +91 -0
  278. package/src/middleware/actions.ts +6 -27
  279. package/src/middleware/defaults/feeEstimator.ts +24 -4
  280. package/src/middleware/defaults/gasEstimator.ts +9 -5
  281. package/src/middleware/defaults/paymasterAndData.ts +8 -0
  282. package/src/middleware/defaults/userOpSigner.ts +10 -0
  283. package/src/middleware/erc7677middleware.ts +201 -0
  284. package/src/middleware/noopMiddleware.ts +6 -4
  285. package/src/middleware/types.ts +16 -7
  286. package/src/signer/local-account.ts +97 -2
  287. package/src/signer/schema.ts +14 -0
  288. package/src/signer/utils.ts +20 -32
  289. package/src/signer/wallet-client.ts +92 -0
  290. package/src/transport/split.ts +2 -2
  291. package/src/utils/bigint.ts +15 -15
  292. package/src/utils/bytes.ts +5 -5
  293. package/src/utils/defaults.ts +3 -76
  294. package/src/utils/index.ts +66 -48
  295. package/src/utils/types.ts +2 -2
  296. package/src/utils/userop.ts +33 -33
  297. package/src/version.ts +1 -1
  298. package/dist/cjs/account/base.d.ts +0 -49
  299. package/dist/cjs/account/base.js +0 -257
  300. package/dist/cjs/account/base.js.map +0 -1
  301. package/dist/cjs/account/schema.d.ts +0 -100
  302. package/dist/cjs/account/schema.js +0 -43
  303. package/dist/cjs/account/schema.js.map +0 -1
  304. package/dist/cjs/account/simple.d.ts +0 -14
  305. package/dist/cjs/account/simple.js +0 -119
  306. package/dist/cjs/account/simple.js.map +0 -1
  307. package/dist/cjs/account/types.d.ts +0 -30
  308. package/dist/cjs/account/types.js +0 -3
  309. package/dist/cjs/account/types.js.map +0 -1
  310. package/dist/cjs/chains/index.d.ts +0 -20
  311. package/dist/cjs/chains/index.js +0 -169
  312. package/dist/cjs/chains/index.js.map +0 -1
  313. package/dist/esm/account/base.d.ts +0 -49
  314. package/dist/esm/account/base.js +0 -253
  315. package/dist/esm/account/base.js.map +0 -1
  316. package/dist/esm/account/schema.d.ts +0 -100
  317. package/dist/esm/account/schema.js +0 -35
  318. package/dist/esm/account/schema.js.map +0 -1
  319. package/dist/esm/account/simple.d.ts +0 -14
  320. package/dist/esm/account/simple.js +0 -115
  321. package/dist/esm/account/simple.js.map +0 -1
  322. package/dist/esm/account/types.d.ts +0 -30
  323. package/dist/esm/account/types.js +0 -2
  324. package/dist/esm/account/types.js.map +0 -1
  325. package/dist/esm/chains/index.d.ts +0 -20
  326. package/dist/esm/chains/index.js +0 -166
  327. package/dist/esm/chains/index.js.map +0 -1
  328. package/dist/types/account/base.d.ts +0 -128
  329. package/dist/types/account/base.d.ts.map +0 -1
  330. package/dist/types/account/schema.d.ts +0 -101
  331. package/dist/types/account/schema.d.ts.map +0 -1
  332. package/dist/types/account/simple.d.ts +0 -15
  333. package/dist/types/account/simple.d.ts.map +0 -1
  334. package/dist/types/account/types.d.ts +0 -144
  335. package/dist/types/account/types.d.ts.map +0 -1
  336. package/dist/types/chains/index.d.ts +0 -21
  337. package/dist/types/chains/index.d.ts.map +0 -1
  338. package/src/account/base.ts +0 -415
  339. package/src/account/schema.ts +0 -51
  340. package/src/account/simple.ts +0 -215
  341. package/src/account/types.ts +0 -184
  342. package/src/chains/index.ts +0 -194
@@ -6,12 +6,8 @@ export { EntryPointAbi_v7 } from "./abis/EntryPointAbi_v7.js";
6
6
  export { SimpleAccountAbi_v6 } from "./abis/SimpleAccountAbi_v6.js";
7
7
  export { SimpleAccountAbi_v7 } from "./abis/SimpleAccountAbi_v7.js";
8
8
  export { SimpleAccountFactoryAbi } from "./abis/SimpleAccountFactoryAbi.js";
9
- export { BaseSmartContractAccount } from "./account/base.js";
10
- export { createSimpleSmartAccount } from "./account/simple.js";
11
- export type { SimpleSmartAccount } from "./account/simple.js";
12
9
  export type * from "./account/smartContractAccount.js";
13
10
  export { getAccountAddress, isSmartAccountWithSigner, parseFactoryAddressFromAccountInitCode, toSmartContractAccount, } from "./account/smartContractAccount.js";
14
- export type { BaseSmartAccountParams, SignTypedDataParams, } from "./account/types.js";
15
11
  export { buildUserOperation } from "./actions/smartAccount/buildUserOperation.js";
16
12
  export { buildUserOperationFromTx } from "./actions/smartAccount/buildUserOperationFromTx.js";
17
13
  export { buildUserOperationFromTxs } from "./actions/smartAccount/buildUserOperationFromTxs.js";
@@ -22,7 +18,6 @@ export { sendTransactions } from "./actions/smartAccount/sendTransactions.js";
22
18
  export { sendUserOperation } from "./actions/smartAccount/sendUserOperation.js";
23
19
  export type * from "./actions/smartAccount/types.js";
24
20
  export { waitForUserOperationTransaction } from "./actions/smartAccount/waitForUserOperationTransacation.js";
25
- export { arbitrum, arbitrumGoerli, arbitrumSepolia, base, baseGoerli, baseSepolia, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "./chains/index.js";
26
21
  export type * from "./client/bundlerClient.js";
27
22
  export { createBundlerClient, createBundlerClientFromExisting, } from "./client/bundlerClient.js";
28
23
  export type * from "./client/decorators/bundlerClient.js";
@@ -50,14 +45,16 @@ export { defaultFeeEstimator } from "./middleware/defaults/feeEstimator.js";
50
45
  export { defaultGasEstimator } from "./middleware/defaults/gasEstimator.js";
51
46
  export { defaultPaymasterAndData } from "./middleware/defaults/paymasterAndData.js";
52
47
  export { defaultUserOpSigner } from "./middleware/defaults/userOpSigner.js";
48
+ export type * from "./middleware/erc7677middleware.js";
49
+ export { erc7677Middleware } from "./middleware/erc7677middleware.js";
53
50
  export { noopMiddleware } from "./middleware/noopMiddleware.js";
54
51
  export type * from "./middleware/types.js";
55
52
  export { LocalAccountSigner } from "./signer/local-account.js";
56
53
  export { SignerSchema, isSigner } from "./signer/schema.js";
57
54
  export type { SmartAccountAuthenticator, SmartAccountSigner, } from "./signer/types.js";
58
- export { verifyEIP6492Signature, wrapSignatureWith6492, } from "./signer/utils.js";
55
+ export { wrapSignatureWith6492 } from "./signer/utils.js";
59
56
  export { WalletClientSigner } from "./signer/wallet-client.js";
60
57
  export { split, type SplitTransportParams } from "./transport/split.js";
61
58
  export type * from "./types.js";
62
59
  export type * from "./utils/index.js";
63
- export { AlchemyChainMap, BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, defineReadOnly, filterUndefined, getChain, getDefaultSimpleAccountFactoryAddress, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
60
+ export { BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, filterUndefined, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
package/dist/esm/index.js CHANGED
@@ -4,8 +4,6 @@ export { EntryPointAbi_v7 } from "./abis/EntryPointAbi_v7.js";
4
4
  export { SimpleAccountAbi_v6 } from "./abis/SimpleAccountAbi_v6.js";
5
5
  export { SimpleAccountAbi_v7 } from "./abis/SimpleAccountAbi_v7.js";
6
6
  export { SimpleAccountFactoryAbi } from "./abis/SimpleAccountFactoryAbi.js";
7
- export { BaseSmartContractAccount } from "./account/base.js";
8
- export { createSimpleSmartAccount } from "./account/simple.js";
9
7
  export { getAccountAddress, isSmartAccountWithSigner, parseFactoryAddressFromAccountInitCode, toSmartContractAccount, } from "./account/smartContractAccount.js";
10
8
  export { buildUserOperation } from "./actions/smartAccount/buildUserOperation.js";
11
9
  export { buildUserOperationFromTx } from "./actions/smartAccount/buildUserOperationFromTx.js";
@@ -16,7 +14,6 @@ export { sendTransaction } from "./actions/smartAccount/sendTransaction.js";
16
14
  export { sendTransactions } from "./actions/smartAccount/sendTransactions.js";
17
15
  export { sendUserOperation } from "./actions/smartAccount/sendUserOperation.js";
18
16
  export { waitForUserOperationTransaction } from "./actions/smartAccount/waitForUserOperationTransacation.js";
19
- export { arbitrum, arbitrumGoerli, arbitrumSepolia, base, baseGoerli, baseSepolia, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "./chains/index.js";
20
17
  export { createBundlerClient, createBundlerClientFromExisting, } from "./client/bundlerClient.js";
21
18
  export { bundlerActions } from "./client/decorators/bundlerClient.js";
22
19
  export { smartAccountClientActions } from "./client/decorators/smartAccountClient.js";
@@ -38,11 +35,12 @@ export { defaultFeeEstimator } from "./middleware/defaults/feeEstimator.js";
38
35
  export { defaultGasEstimator } from "./middleware/defaults/gasEstimator.js";
39
36
  export { defaultPaymasterAndData } from "./middleware/defaults/paymasterAndData.js";
40
37
  export { defaultUserOpSigner } from "./middleware/defaults/userOpSigner.js";
38
+ export { erc7677Middleware } from "./middleware/erc7677middleware.js";
41
39
  export { noopMiddleware } from "./middleware/noopMiddleware.js";
42
40
  export { LocalAccountSigner } from "./signer/local-account.js";
43
41
  export { SignerSchema, isSigner } from "./signer/schema.js";
44
- export { verifyEIP6492Signature, wrapSignatureWith6492, } from "./signer/utils.js";
42
+ export { wrapSignatureWith6492 } from "./signer/utils.js";
45
43
  export { WalletClientSigner } from "./signer/wallet-client.js";
46
44
  export { split } from "./transport/split.js";
47
- export { AlchemyChainMap, BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, defineReadOnly, filterUndefined, getChain, getDefaultSimpleAccountFactoryAddress, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
45
+ export { BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, filterUndefined, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
48
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AA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BAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK5D,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,KAAK,EAA6B,MAAM,sBAAsB,CAAC;AAGxE,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,8BAA8B,EAC9B,SAAS,EACT,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,WAAW,EACX,cAAc,EACd,eAAe,EACf,QAAQ,EACR,qCAAqC,EACrC,iCAAiC,EACjC,cAAc,EACd,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,IAAI,EACJ,iBAAiB,EACjB,SAAS,EACT,QAAQ,GACT,MAAM,kBAAkB,CAAC","sourcesContent":["export type { Abi } from \"abitype\";\nexport type { Address, HttpTransport } from \"viem\";\nexport * as chains from \"viem/chains\";\n\nexport { EntryPointAbi_v6 } from \"./abis/EntryPointAbi_v6.js\";\nexport { EntryPointAbi_v7 } from \"./abis/EntryPointAbi_v7.js\";\nexport { SimpleAccountAbi_v6 } from \"./abis/SimpleAccountAbi_v6.js\";\nexport { SimpleAccountAbi_v7 } from \"./abis/SimpleAccountAbi_v7.js\";\nexport { SimpleAccountFactoryAbi } from \"./abis/SimpleAccountFactoryAbi.js\";\nexport { BaseSmartContractAccount } from \"./account/base.js\";\nexport { createSimpleSmartAccount } from \"./account/simple.js\";\nexport type { SimpleSmartAccount } from \"./account/simple.js\";\nexport type * from \"./account/smartContractAccount.js\";\nexport {\n getAccountAddress,\n isSmartAccountWithSigner,\n parseFactoryAddressFromAccountInitCode,\n toSmartContractAccount,\n} from \"./account/smartContractAccount.js\";\nexport type {\n BaseSmartAccountParams,\n SignTypedDataParams,\n} from \"./account/types.js\";\nexport { buildUserOperation } from \"./actions/smartAccount/buildUserOperation.js\";\nexport { buildUserOperationFromTx } from \"./actions/smartAccount/buildUserOperationFromTx.js\";\nexport { buildUserOperationFromTxs } from \"./actions/smartAccount/buildUserOperationFromTxs.js\";\nexport { checkGasSponsorshipEligibility } from \"./actions/smartAccount/checkGasSponsorshipEligibility.js\";\nexport { dropAndReplaceUserOperation } from \"./actions/smartAccount/dropAndReplaceUserOperation.js\";\nexport { sendTransaction } from \"./actions/smartAccount/sendTransaction.js\";\nexport { sendTransactions } from \"./actions/smartAccount/sendTransactions.js\";\nexport { sendUserOperation } from \"./actions/smartAccount/sendUserOperation.js\";\nexport type * from \"./actions/smartAccount/types.js\";\nexport { waitForUserOperationTransaction } from \"./actions/smartAccount/waitForUserOperationTransacation.js\";\nexport {\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n goerli,\n mainnet,\n optimism,\n optimismGoerli,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"./chains/index.js\";\nexport type * from \"./client/bundlerClient.js\";\nexport {\n createBundlerClient,\n createBundlerClientFromExisting,\n} from \"./client/bundlerClient.js\";\nexport type * from \"./client/decorators/bundlerClient.js\";\nexport { bundlerActions } from \"./client/decorators/bundlerClient.js\";\nexport type * from \"./client/decorators/smartAccountClient.js\";\nexport { smartAccountClientActions } from \"./client/decorators/smartAccountClient.js\";\nexport { isSmartAccountClient } from \"./client/isSmartAccountClient.js\";\nexport {\n ConnectionConfigSchema,\n SmartAccountClientOptsSchema,\n} from \"./client/schema.js\";\nexport type * from \"./client/smartAccountClient.js\";\nexport {\n createSmartAccountClient,\n createSmartAccountClientFromExisting,\n} from \"./client/smartAccountClient.js\";\nexport type * from \"./client/types.js\";\nexport {\n convertChainIdToCoinType,\n convertCoinTypeToChain,\n convertCoinTypeToChainId,\n} from \"./ens/utils.js\";\nexport {\n defaultEntryPointVersion,\n entryPointRegistry,\n getEntryPoint,\n isEntryPointVersion,\n} from \"./entrypoint/index.js\";\nexport type * from \"./entrypoint/types.js\";\nexport {\n AccountNotFoundError,\n AccountRequiresOwnerError,\n BatchExecutionNotSupportedError,\n DefaultFactoryNotDefinedError,\n FailedToGetStorageSlotError,\n GetCounterFactualAddressError,\n IncorrectAccountType,\n SignTransactionNotSupportedError,\n SmartAccountWithSignerRequiredError,\n UpgradeToAndCallNotSupportedError,\n UpgradesNotSupportedError,\n} from \"./errors/account.js\";\nexport { BaseError } from \"./errors/base.js\";\nexport {\n ChainNotFoundError,\n IncompatibleClientError,\n InvalidRpcUrlError,\n} from \"./errors/client.js\";\nexport {\n EntryPointNotFoundError,\n InvalidEntryPointError,\n} from \"./errors/entrypoint.js\";\nexport { InvalidSignerTypeError } from \"./errors/signer.js\";\nexport {\n FailedToFindTransactionError,\n TransactionMissingToParamError,\n} from \"./errors/transaction.js\";\nexport {\n InvalidUserOperationError,\n WaitForUserOperationError,\n} from \"./errors/useroperation.js\";\nexport { LogLevel, Logger } from \"./logger.js\";\nexport { middlewareActions } from \"./middleware/actions.js\";\nexport { defaultFeeEstimator } from \"./middleware/defaults/feeEstimator.js\";\nexport { defaultGasEstimator } from \"./middleware/defaults/gasEstimator.js\";\nexport { defaultPaymasterAndData } from \"./middleware/defaults/paymasterAndData.js\";\nexport { defaultUserOpSigner } from \"./middleware/defaults/userOpSigner.js\";\nexport { noopMiddleware } from \"./middleware/noopMiddleware.js\";\nexport type * from \"./middleware/types.js\";\nexport { LocalAccountSigner } from \"./signer/local-account.js\";\nexport { SignerSchema, isSigner } from \"./signer/schema.js\";\nexport type {\n SmartAccountAuthenticator,\n SmartAccountSigner,\n} from \"./signer/types.js\";\nexport {\n verifyEIP6492Signature,\n wrapSignatureWith6492,\n} from \"./signer/utils.js\";\nexport { WalletClientSigner } from \"./signer/wallet-client.js\";\nexport { split, type SplitTransportParams } from \"./transport/split.js\";\nexport type * from \"./types.js\";\nexport type * from \"./utils/index.js\";\nexport {\n AlchemyChainMap,\n BigNumberishRangeSchema,\n BigNumberishSchema,\n ChainSchema,\n HexSchema,\n MultiplierSchema,\n allEqual,\n applyUserOpFeeOption,\n applyUserOpOverride,\n applyUserOpOverrideOrFeeOption,\n asyncPipe,\n bigIntMax,\n bigIntMultiply,\n bypassPaymasterAndData,\n bypassPaymasterAndDataEmptyHex,\n concatPaymasterAndData,\n deepHexlify,\n defineReadOnly,\n filterUndefined,\n getChain,\n getDefaultSimpleAccountFactoryAddress,\n getDefaultUserOperationFeeOptions,\n isBigNumberish,\n isMultiplier,\n isValidRequest,\n parsePaymasterAndData,\n pick,\n resolveProperties,\n takeBytes,\n toRecord,\n} from \"./utils/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,8BAA8B,EAAE,MAAM,0DAA0D,C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,MAAM,kBAAkB,CAAC","sourcesContent":["export type { Abi } from \"abitype\";\nexport type { Address, HttpTransport } from \"viem\";\nexport * as chains from \"viem/chains\";\n\nexport { EntryPointAbi_v6 } from \"./abis/EntryPointAbi_v6.js\";\nexport { EntryPointAbi_v7 } from \"./abis/EntryPointAbi_v7.js\";\nexport { SimpleAccountAbi_v6 } from \"./abis/SimpleAccountAbi_v6.js\";\nexport { SimpleAccountAbi_v7 } from \"./abis/SimpleAccountAbi_v7.js\";\nexport { SimpleAccountFactoryAbi } from \"./abis/SimpleAccountFactoryAbi.js\";\nexport type * from \"./account/smartContractAccount.js\";\nexport {\n getAccountAddress,\n isSmartAccountWithSigner,\n parseFactoryAddressFromAccountInitCode,\n toSmartContractAccount,\n} from \"./account/smartContractAccount.js\";\nexport { buildUserOperation } from \"./actions/smartAccount/buildUserOperation.js\";\nexport { buildUserOperationFromTx } from \"./actions/smartAccount/buildUserOperationFromTx.js\";\nexport { buildUserOperationFromTxs } from \"./actions/smartAccount/buildUserOperationFromTxs.js\";\nexport { checkGasSponsorshipEligibility } from \"./actions/smartAccount/checkGasSponsorshipEligibility.js\";\nexport { dropAndReplaceUserOperation } from \"./actions/smartAccount/dropAndReplaceUserOperation.js\";\nexport { sendTransaction } from \"./actions/smartAccount/sendTransaction.js\";\nexport { sendTransactions } from \"./actions/smartAccount/sendTransactions.js\";\nexport { sendUserOperation } from \"./actions/smartAccount/sendUserOperation.js\";\nexport type * from \"./actions/smartAccount/types.js\";\nexport { waitForUserOperationTransaction } from \"./actions/smartAccount/waitForUserOperationTransacation.js\";\nexport type * from \"./client/bundlerClient.js\";\nexport {\n createBundlerClient,\n createBundlerClientFromExisting,\n} from \"./client/bundlerClient.js\";\nexport type * from \"./client/decorators/bundlerClient.js\";\nexport { bundlerActions } from \"./client/decorators/bundlerClient.js\";\nexport type * from \"./client/decorators/smartAccountClient.js\";\nexport { smartAccountClientActions } from \"./client/decorators/smartAccountClient.js\";\nexport { isSmartAccountClient } from \"./client/isSmartAccountClient.js\";\nexport {\n ConnectionConfigSchema,\n SmartAccountClientOptsSchema,\n} from \"./client/schema.js\";\nexport type * from \"./client/smartAccountClient.js\";\nexport {\n createSmartAccountClient,\n createSmartAccountClientFromExisting,\n} from \"./client/smartAccountClient.js\";\nexport type * from \"./client/types.js\";\nexport {\n convertChainIdToCoinType,\n convertCoinTypeToChain,\n convertCoinTypeToChainId,\n} from \"./ens/utils.js\";\nexport {\n defaultEntryPointVersion,\n entryPointRegistry,\n getEntryPoint,\n isEntryPointVersion,\n} from \"./entrypoint/index.js\";\nexport type * from \"./entrypoint/types.js\";\nexport {\n AccountNotFoundError,\n AccountRequiresOwnerError,\n BatchExecutionNotSupportedError,\n DefaultFactoryNotDefinedError,\n FailedToGetStorageSlotError,\n GetCounterFactualAddressError,\n IncorrectAccountType,\n SignTransactionNotSupportedError,\n SmartAccountWithSignerRequiredError,\n UpgradeToAndCallNotSupportedError,\n UpgradesNotSupportedError,\n} from \"./errors/account.js\";\nexport { BaseError } from \"./errors/base.js\";\nexport {\n ChainNotFoundError,\n IncompatibleClientError,\n InvalidRpcUrlError,\n} from \"./errors/client.js\";\nexport {\n EntryPointNotFoundError,\n InvalidEntryPointError,\n} from \"./errors/entrypoint.js\";\nexport { InvalidSignerTypeError } from \"./errors/signer.js\";\nexport {\n FailedToFindTransactionError,\n TransactionMissingToParamError,\n} from \"./errors/transaction.js\";\nexport {\n InvalidUserOperationError,\n WaitForUserOperationError,\n} from \"./errors/useroperation.js\";\nexport { LogLevel, Logger } from \"./logger.js\";\nexport { middlewareActions } from \"./middleware/actions.js\";\nexport { defaultFeeEstimator } from \"./middleware/defaults/feeEstimator.js\";\nexport { defaultGasEstimator } from \"./middleware/defaults/gasEstimator.js\";\nexport { defaultPaymasterAndData } from \"./middleware/defaults/paymasterAndData.js\";\nexport { defaultUserOpSigner } from \"./middleware/defaults/userOpSigner.js\";\nexport type * from \"./middleware/erc7677middleware.js\";\nexport { erc7677Middleware } from \"./middleware/erc7677middleware.js\";\nexport { noopMiddleware } from \"./middleware/noopMiddleware.js\";\nexport type * from \"./middleware/types.js\";\nexport { LocalAccountSigner } from \"./signer/local-account.js\";\nexport { SignerSchema, isSigner } from \"./signer/schema.js\";\nexport type {\n SmartAccountAuthenticator,\n SmartAccountSigner,\n} from \"./signer/types.js\";\nexport { wrapSignatureWith6492 } from \"./signer/utils.js\";\nexport { WalletClientSigner } from \"./signer/wallet-client.js\";\nexport { split, type SplitTransportParams } from \"./transport/split.js\";\nexport type * from \"./types.js\";\nexport type * from \"./utils/index.js\";\nexport {\n BigNumberishRangeSchema,\n BigNumberishSchema,\n ChainSchema,\n HexSchema,\n MultiplierSchema,\n allEqual,\n applyUserOpFeeOption,\n applyUserOpOverride,\n applyUserOpOverrideOrFeeOption,\n asyncPipe,\n bigIntMax,\n bigIntMultiply,\n bypassPaymasterAndData,\n bypassPaymasterAndDataEmptyHex,\n concatPaymasterAndData,\n deepHexlify,\n filterUndefined,\n getDefaultUserOperationFeeOptions,\n isBigNumberish,\n isMultiplier,\n isValidRequest,\n parsePaymasterAndData,\n pick,\n resolveProperties,\n takeBytes,\n toRecord,\n} from \"./utils/index.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,6CAAW,CAAA;IACX,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;AACV,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB;AAED,MAAM,OAAO,MAAM;IAIjB,MAAM,CAAC,WAAW,CAAC,QAAkB;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAe;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,MAAM,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xC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;YAAE,OAAO,KAAK,CAAC;QAElE,OAAO,IAAI,CAAC;IACd,CAAC;;AA9CM;;;;WAAqB,QAAQ,CAAC,IAAI;GAAC","sourcesContent":["export enum LogLevel {\n VERBOSE = 5,\n DEBUG = 4,\n INFO = 3,\n WARN = 2,\n ERROR = 1,\n NONE = 0,\n}\n\nexport class Logger {\n static logLevel: LogLevel = LogLevel.INFO;\n static logFilter?: string;\n\n static setLogLevel(logLevel: LogLevel) {\n this.logLevel = logLevel;\n }\n\n static setLogFilter(pattern: string) {\n this.logFilter = pattern;\n }\n\n static error(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.ERROR)) return;\n\n console.error(msg, ...args);\n }\n\n static warn(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.WARN)) return;\n\n console.warn(msg, ...args);\n }\n\n static debug(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.DEBUG)) return;\n\n console.debug(msg, ...args);\n }\n\n static info(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.INFO)) return;\n\n console.info(msg, ...args);\n }\n\n static verbose(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.VERBOSE)) return;\n\n console.log(msg, ...args);\n }\n\n private static shouldLog(msg: string, level: LogLevel) {\n if (this.logLevel < level) return false;\n if (this.logFilter && !msg.includes(this.logFilter)) return false;\n\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,6CAAW,CAAA;IACX,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;AACV,CAAC,EAPW,QAAQ,KAAR,QAAQ,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AAQ,CAAC,OAAO,CAAC;YAAE,OAAO;QAEnD,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,GAAW,EAAE,KAAe;QACnD,IAAI,IAAI,CAAC,QAAQ,GAAG,KAAK;YAAE,OAAO,KAAK,CAAC;QACxC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;YAAE,OAAO,KAAK,CAAC;QAElE,OAAO,IAAI,CAAC;IACd,CAAC;;AAtIM;;;;WAAqB,QAAQ,CAAC,IAAI;GAAC","sourcesContent":["export enum LogLevel {\n VERBOSE = 5,\n DEBUG = 4,\n INFO = 3,\n WARN = 2,\n ERROR = 1,\n NONE = 0,\n}\n\n/**\n * Logger class provides static methods for logging at different levels such as error, warn, debug, info, and verbose. This class allows setting log levels and log filters to control the logging behavior.\n */\nexport class Logger {\n static logLevel: LogLevel = LogLevel.INFO;\n static logFilter?: string;\n\n /**\n * Sets the log level for logging purposes.\n *\n * @example\n * ```ts\n * import { Logger, LogLevel } from \"@aa-sdk/core\";\n * Logger.setLogLevel(LogLevel.DEBUG);\n * ```\n *\n * @param {LogLevel} logLevel The desired log level\n */\n static setLogLevel(logLevel: LogLevel) {\n this.logLevel = logLevel;\n }\n\n /**\n * Sets the log filter pattern.\n *\n * @example\n * ```ts\n * import { Logger } from \"@aa-sdk/core\";\n *\n * Logger.setLogFilter(\"error\");\n * ```\n *\n * @param {string} pattern The pattern to set as the log filter\n */\n static setLogFilter(pattern: string) {\n this.logFilter = pattern;\n }\n\n /**\n * Logs an error message to the console if the logging condition is met.\n *\n * @example\n * ```ts\n * import { Logger } from \"@aa-sdk/core\";\n *\n * Logger.error(\"An error occurred while processing the request\");\n * ```\n *\n * @param {string} msg The primary error message to be logged\n * @param {...any[]} args Additional arguments to be logged along with the error message\n */\n static error(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.ERROR)) return;\n\n console.error(msg, ...args);\n }\n\n /**\n * Logs a warning message if the logging conditions are met.\n *\n * @example\n * ```ts\n * import { Logger } from \"@aa-sdk/core\";\n *\n * Logger.warn(\"Careful...\");\n * ```\n *\n * @param {string} msg The message to log as a warning\n * @param {...any[]} args Additional parameters to log along with the message\n */\n static warn(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.WARN)) return;\n\n console.warn(msg, ...args);\n }\n\n /**\n * Logs a debug message to the console if the log level allows it.\n *\n * @example\n * ```ts\n * import { Logger } from \"@aa-sdk/core\";\n *\n * Logger.debug(\"Something is happening\");\n * ```\n *\n * @param {string} msg The message to log\n * @param {...any[]} args Additional arguments to pass to the console.debug method\n */\n static debug(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.DEBUG)) return;\n\n console.debug(msg, ...args);\n }\n\n /**\n * Logs an informational message to the console if the logging level is set to INFO.\n *\n * @example\n * ```ts\n * import { Logger } from \"@aa-sdk/core\";\n *\n * Logger.info(\"Something is happening\");\n * ```\n *\n * @param {string} msg the message to log\n * @param {...any[]} args additional arguments to log alongside the message\n */\n static info(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.INFO)) return;\n\n console.info(msg, ...args);\n }\n\n /**\n * Logs a message with additional arguments if the logging level permits it.\n *\n * @example\n * ```ts\n * import { Logger } from \"@aa-sdk/core\";\n *\n * Logger.verbose(\"Something is happening\");\n * ```\n *\n * @param {string} msg The message to log\n * @param {...any[]} args Additional arguments to be logged\n */\n static verbose(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.VERBOSE)) return;\n\n console.log(msg, ...args);\n }\n\n private static shouldLog(msg: string, level: LogLevel) {\n if (this.logLevel < level) return false;\n if (this.logFilter && !msg.includes(this.logFilter)) return false;\n\n return true;\n }\n}\n"]}
@@ -1,5 +1,4 @@
1
- import { isHex, } from "viem";
2
- import { concatPaymasterAndData, parsePaymasterAndData, } from "../utils/userop.js";
1
+ import {} from "viem";
3
2
  import { defaultFeeEstimator } from "./defaults/feeEstimator.js";
4
3
  import { defaultGasEstimator } from "./defaults/gasEstimator.js";
5
4
  import { defaultPaymasterAndData } from "./defaults/paymasterAndData.js";
@@ -8,24 +7,10 @@ import { noopMiddleware } from "./noopMiddleware.js";
8
7
  export const middlewareActions = (overrides) => (client) => ({
9
8
  middleware: {
10
9
  customMiddleware: overrides.customMiddleware ?? noopMiddleware,
11
- dummyPaymasterAndData: overrides.paymasterAndData?.dummyPaymasterAndData
12
- ? async (struct, { account }) => {
13
- const data = overrides.paymasterAndData.dummyPaymasterAndData();
14
- const paymasterOverrides = account.getEntryPoint().version === "0.7.0"
15
- ? isHex(data)
16
- ? parsePaymasterAndData(data)
17
- : data
18
- : {
19
- paymasterAndData: isHex(data)
20
- ? data
21
- : concatPaymasterAndData(data),
22
- };
23
- return { ...struct, ...paymasterOverrides };
24
- }
25
- : defaultPaymasterAndData,
10
+ dummyPaymasterAndData: overrides.dummyPaymasterAndData ?? defaultPaymasterAndData,
26
11
  feeEstimator: overrides.feeEstimator ?? defaultFeeEstimator(client),
27
12
  gasEstimator: overrides.gasEstimator ?? defaultGasEstimator(client),
28
- paymasterAndData: overrides.paymasterAndData?.paymasterAndData ?? defaultPaymasterAndData,
13
+ paymasterAndData: overrides.paymasterAndData ?? defaultPaymasterAndData,
29
14
  userOperationSimulator: overrides.userOperationSimulator ?? noopMiddleware,
30
15
  signUserOperation: overrides.signUserOperation ?? defaultUserOpSigner,
31
16
  },
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/middleware/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAMN,MAAM,MAAM,CAAC;AAOd,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,E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AS,CAAC,sBAAsB,IAAI,cAAc;QACpD,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,IAAI,mBAAmB;KACtE;CACF,CAAC,CAAC","sourcesContent":["import {\n isHex,\n type Chain,\n type Client,\n type PublicActions,\n type PublicRpcSchema,\n type Transport,\n} from \"viem\";\nimport type { SmartContractAccount } from \"../account/smartContractAccount.js\";\nimport type {\n BundlerActions,\n BundlerRpcSchema,\n} from \"../client/decorators/bundlerClient.js\";\nimport type { ClientMiddlewareConfig } from \"../client/types.js\";\nimport {\n concatPaymasterAndData,\n parsePaymasterAndData,\n} from \"../utils/userop.js\";\nimport { defaultFeeEstimator } from \"./defaults/feeEstimator.js\";\nimport { defaultGasEstimator } from \"./defaults/gasEstimator.js\";\nimport { defaultPaymasterAndData } from \"./defaults/paymasterAndData.js\";\nimport { defaultUserOpSigner } from \"./defaults/userOpSigner.js\";\nimport { noopMiddleware } from \"./noopMiddleware.js\";\nimport type { ClientMiddleware } from \"./types.js\";\n\n/**\n * Middleware client type\n *\n * @template {Transport} TTransport\n * @template {Chain | undefined} TChain\n * @template {SmartContractAccount | undefined} TAccount\n */\nexport type MiddlewareClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = Client<\n TTransport,\n TChain,\n TAccount,\n [...BundlerRpcSchema, ...PublicRpcSchema],\n PublicActions & BundlerActions\n>;\n\n/**\n * export function that takes in {@link ClientMiddlewareConfig} used during client initiation\n * and returns the middleware actions object that the smart account client extends with\n *\n * @param overrides - {@link ClientMiddlewareConfig} used during client initiation for overriding default middlewares\n * @returns middleware actions object\n */\nexport const middlewareActions =\n (overrides: ClientMiddlewareConfig) =>\n <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n >(\n client: MiddlewareClient<TTransport, TChain, TAccount>\n ): { middleware: ClientMiddleware } => ({\n middleware: {\n customMiddleware: overrides.customMiddleware ?? noopMiddleware,\n dummyPaymasterAndData: overrides.paymasterAndData?.dummyPaymasterAndData\n ? async (struct, { account }) => {\n const data = overrides.paymasterAndData!.dummyPaymasterAndData();\n const paymasterOverrides =\n account.getEntryPoint().version === \"0.7.0\"\n ? isHex(data)\n ? parsePaymasterAndData(data)\n : data\n : {\n paymasterAndData: isHex(data)\n ? data\n : concatPaymasterAndData(data),\n };\n return { ...struct, ...paymasterOverrides };\n }\n : defaultPaymasterAndData,\n\n feeEstimator: overrides.feeEstimator ?? defaultFeeEstimator(client),\n gasEstimator: overrides.gasEstimator ?? defaultGasEstimator(client),\n paymasterAndData:\n overrides.paymasterAndData?.paymasterAndData ?? defaultPaymasterAndData,\n userOperationSimulator:\n overrides.userOperationSimulator ?? noopMiddleware,\n signUserOperation: overrides.signUserOperation ?? defaultUserOpSigner,\n },\n });\n"]}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/middleware/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,MAAM,MAAM,CAAC;AAOd,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA+BrD,MAAM,CAAC,MAAM,iBAAiB,GAC5B,CAAC,SAAiC,EAAE,EAAE,CACtC,CAOE,MAAsD,EACpB,EAAE,CAAC,CAAC;IACtC,UAAU,EAAE;QACV,gBAAgB,EAAE,SAAS,CAAC,gBAAgB,IAAI,cAAc;QAC9D,qBAAqB,EACnB,SAAS,CAAC,qBAAqB,IAAI,uBAAuB;QAC5D,YAAY,EAAE,SAAS,CAAC,YAAY,IAAI,mBAAmB,CAAC,MAAM,CAAC;QACnE,YAAY,EAAE,SAAS,CAAC,YAAY,IAAI,mBAAmB,CAAC,MAAM,CAAC;QACnE,gBAAgB,EAAE,SAAS,CAAC,gBAAgB,IAAI,uBAAuB;QACvE,sBAAsB,EACpB,SAAS,CAAC,sBAAsB,IAAI,cAAc;QACpD,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,IAAI,mBAAmB;KACtE;CACF,CAAC,CAAC","sourcesContent":["import {\n type Chain,\n type Client,\n type PublicActions,\n type PublicRpcSchema,\n type Transport,\n} from \"viem\";\nimport type { SmartContractAccount } from \"../account/smartContractAccount.js\";\nimport type {\n BundlerActions,\n BundlerRpcSchema,\n} from \"../client/decorators/bundlerClient.js\";\nimport type { ClientMiddlewareConfig } from \"../client/types.js\";\nimport { defaultFeeEstimator } from \"./defaults/feeEstimator.js\";\nimport { defaultGasEstimator } from \"./defaults/gasEstimator.js\";\nimport { defaultPaymasterAndData } from \"./defaults/paymasterAndData.js\";\nimport { defaultUserOpSigner } from \"./defaults/userOpSigner.js\";\nimport { noopMiddleware } from \"./noopMiddleware.js\";\nimport type { ClientMiddleware } from \"./types.js\";\n\n/**\n * Middleware client type\n *\n * @template {Transport} TTransport\n * @template {Chain | undefined} TChain\n * @template {SmartContractAccount | undefined} TAccount\n */\nexport type MiddlewareClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = Client<\n TTransport,\n TChain,\n TAccount,\n [...BundlerRpcSchema, ...PublicRpcSchema],\n PublicActions & BundlerActions\n>;\n\n/**\n * function that takes in ClientMiddlewareConfig used during client initiation\n * and returns the middleware actions object that the smart account client extends with\n *\n * @param {ClientMiddlewareConfig} overrides config used during client initiation for overriding default middlewares\n * @returns {(client: MiddlewareClient<TTransport, TChain, TAccount>) => { middleware: ClientMiddleware }} middleware actions object\n */\nexport const middlewareActions =\n (overrides: ClientMiddlewareConfig) =>\n <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n >(\n client: MiddlewareClient<TTransport, TChain, TAccount>\n ): { middleware: ClientMiddleware } => ({\n middleware: {\n customMiddleware: overrides.customMiddleware ?? noopMiddleware,\n dummyPaymasterAndData:\n overrides.dummyPaymasterAndData ?? defaultPaymasterAndData,\n feeEstimator: overrides.feeEstimator ?? defaultFeeEstimator(client),\n gasEstimator: overrides.gasEstimator ?? defaultGasEstimator(client),\n paymasterAndData: overrides.paymasterAndData ?? defaultPaymasterAndData,\n userOperationSimulator:\n overrides.userOperationSimulator ?? noopMiddleware,\n signUserOperation: overrides.signUserOperation ?? defaultUserOpSigner,\n },\n });\n"]}
@@ -1,3 +1,3 @@
1
1
  import type { MiddlewareClient } from "../actions";
2
2
  import type { ClientMiddlewareFn } from "../types";
3
- export declare const defaultFeeEstimator: <C extends MiddlewareClient>(client: C) => ClientMiddlewareFn;
3
+ export declare function defaultFeeEstimator<C extends MiddlewareClient>(client: C): ClientMiddlewareFn;
@@ -1,17 +1,19 @@
1
1
  import { applyUserOpOverrideOrFeeOption } from "../../utils/index.js";
2
- export const defaultFeeEstimator = (client) => async (struct, { overrides, feeOptions }) => {
3
- const feeData = await client.estimateFeesPerGas();
4
- if (!feeData.maxFeePerGas || feeData.maxPriorityFeePerGas == null) {
5
- throw new Error("feeData is missing maxFeePerGas or maxPriorityFeePerGas");
6
- }
7
- let maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas();
8
- maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(maxPriorityFeePerGas, overrides?.maxPriorityFeePerGas, feeOptions?.maxPriorityFeePerGas);
9
- let maxFeePerGas = feeData.maxFeePerGas -
10
- feeData.maxPriorityFeePerGas +
11
- BigInt(maxPriorityFeePerGas);
12
- maxFeePerGas = applyUserOpOverrideOrFeeOption(maxFeePerGas, overrides?.maxFeePerGas, feeOptions?.maxFeePerGas);
13
- struct.maxFeePerGas = maxFeePerGas;
14
- struct.maxPriorityFeePerGas = maxPriorityFeePerGas;
15
- return struct;
16
- };
2
+ export function defaultFeeEstimator(client) {
3
+ return async (struct, { overrides, feeOptions }) => {
4
+ const feeData = await client.estimateFeesPerGas();
5
+ if (!feeData.maxFeePerGas || feeData.maxPriorityFeePerGas == null) {
6
+ throw new Error("feeData is missing maxFeePerGas or maxPriorityFeePerGas");
7
+ }
8
+ let maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas();
9
+ maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(maxPriorityFeePerGas, overrides?.maxPriorityFeePerGas, feeOptions?.maxPriorityFeePerGas);
10
+ let maxFeePerGas = feeData.maxFeePerGas -
11
+ feeData.maxPriorityFeePerGas +
12
+ BigInt(maxPriorityFeePerGas);
13
+ maxFeePerGas = applyUserOpOverrideOrFeeOption(maxFeePerGas, overrides?.maxFeePerGas, feeOptions?.maxFeePerGas);
14
+ struct.maxFeePerGas = maxFeePerGas;
15
+ struct.maxPriorityFeePerGas = maxPriorityFeePerGas;
16
+ return struct;
17
+ };
18
+ }
17
19
  //# sourceMappingURL=feeEstimator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"feeEstimator.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/feeEstimator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAItE,MAAM,CAAC,MAAM,mBAAmB,GAG9B,CAAC,MAAM,EAAE,EAAE,CACX,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;IAU1C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAClD,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,oBAAoB,IAAI,IAAI,EAAE,CAAC;QAClE,MAAM,IAAI,KAAK,CACb,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IAED,IAAI,oBAAoB,GACtB,MAAM,MAAM,CAAC,4BAA4B,EAAE,CAAC;IAE9C,oBAAoB,GAAG,8BAA8B,CACnD,oBAAoB,EACpB,SAAS,EAAE,oBAAoB,EAC/B,UAAU,EAAE,oBAAoB,CACjC,CAAC;IAEF,IAAI,YAAY,GACd,OAAO,CAAC,YAAY;QACpB,OAAO,CAAC,oBAAoB;QAC5B,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAE/B,YAAY,GAAG,8BAA8B,CAC3C,YAAY,EACZ,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,YAAY,CACzB,CAAC;IAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,MAAM,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import type { BigNumberish } from \"../../types\";\nimport { applyUserOpOverrideOrFeeOption } from \"../../utils/index.js\";\nimport type { MiddlewareClient } from \"../actions\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\nexport const defaultFeeEstimator: <C extends MiddlewareClient>(\n client: C\n) => ClientMiddlewareFn =\n (client) =>\n async (struct, { overrides, feeOptions }) => {\n // maxFeePerGas must be at least the sum of maxPriorityFeePerGas and baseFee\n // so we need to accommodate for the fee option applied maxPriorityFeePerGas for the maxFeePerGas\n //\n // Note that if maxFeePerGas is not at least the sum of maxPriorityFeePerGas and required baseFee\n // after applying the fee options, then the transaction will fail\n //\n // Refer to https://docs.alchemy.com/docs/maxpriorityfeepergas-vs-maxfeepergas\n // for more information about maxFeePerGas and maxPriorityFeePerGas\n\n const feeData = await client.estimateFeesPerGas();\n if (!feeData.maxFeePerGas || feeData.maxPriorityFeePerGas == null) {\n throw new Error(\n \"feeData is missing maxFeePerGas or maxPriorityFeePerGas\"\n );\n }\n\n let maxPriorityFeePerGas: BigNumberish =\n await client.estimateMaxPriorityFeePerGas();\n\n maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(\n maxPriorityFeePerGas,\n overrides?.maxPriorityFeePerGas,\n feeOptions?.maxPriorityFeePerGas\n );\n\n let maxFeePerGas: BigNumberish =\n feeData.maxFeePerGas -\n feeData.maxPriorityFeePerGas +\n BigInt(maxPriorityFeePerGas);\n\n maxFeePerGas = applyUserOpOverrideOrFeeOption(\n maxFeePerGas,\n overrides?.maxFeePerGas,\n feeOptions?.maxFeePerGas\n );\n\n struct.maxFeePerGas = maxFeePerGas;\n struct.maxPriorityFeePerGas = maxPriorityFeePerGas;\n return struct;\n };\n"]}
1
+ {"version":3,"file":"feeEstimator.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/feeEstimator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAwBtE,MAAM,UAAU,mBAAmB,CACjC,MAAS;IAET,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;QAUjD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAClD,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,oBAAoB,IAAI,IAAI,EAAE,CAAC;YAClE,MAAM,IAAI,KAAK,CACb,yDAAyD,CAC1D,CAAC;QACJ,CAAC;QAED,IAAI,oBAAoB,GACtB,MAAM,MAAM,CAAC,4BAA4B,EAAE,CAAC;QAE9C,oBAAoB,GAAG,8BAA8B,CACnD,oBAAoB,EACpB,SAAS,EAAE,oBAAoB,EAC/B,UAAU,EAAE,oBAAoB,CACjC,CAAC;QAEF,IAAI,YAAY,GACd,OAAO,CAAC,YAAY;YACpB,OAAO,CAAC,oBAAoB;YAC5B,MAAM,CAAC,oBAAoB,CAAC,CAAC;QAE/B,YAAY,GAAG,8BAA8B,CAC3C,YAAY,EACZ,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,YAAY,CACzB,CAAC;QAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;QACnC,MAAM,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;QACnD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { BigNumberish } from \"../../types\";\nimport { applyUserOpOverrideOrFeeOption } from \"../../utils/index.js\";\nimport type { MiddlewareClient } from \"../actions\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\n/**\n * Default fee estimator middleware function that estimates the maximum fee per gas and maximum priority fee per gas for a given client and applies the necessary overrides and fee options.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient, defaultFeeEstimator, createBundlerClient } from \"@aa-sdk/core\";\n *\n * const bundlerClient = createBundlerClient(...);\n *\n * // NOTE: this is already provided by the smart account client\n * const client = createSmartAccountClient({\n * feeEstimator: defaultFeeEstimator(bundlerClient),\n * ...otherParams\n * });\n * ```\n *\n * @template {MiddlewareClient} C The type of the client\n * @param {C} client The client to perform the fee estimation\n * @returns {ClientMiddlewareFn} A middleware function that takes in the struct and options, estimates the fees, and updates the struct with the estimated fees\n */\nexport function defaultFeeEstimator<C extends MiddlewareClient>(\n client: C\n): ClientMiddlewareFn {\n return async (struct, { overrides, feeOptions }) => {\n // maxFeePerGas must be at least the sum of maxPriorityFeePerGas and baseFee\n // so we need to accommodate for the fee option applied maxPriorityFeePerGas for the maxFeePerGas\n //\n // Note that if maxFeePerGas is not at least the sum of maxPriorityFeePerGas and required baseFee\n // after applying the fee options, then the transaction will fail\n //\n // Refer to https://docs.alchemy.com/docs/maxpriorityfeepergas-vs-maxfeepergas\n // for more information about maxFeePerGas and maxPriorityFeePerGas\n\n const feeData = await client.estimateFeesPerGas();\n if (!feeData.maxFeePerGas || feeData.maxPriorityFeePerGas == null) {\n throw new Error(\n \"feeData is missing maxFeePerGas or maxPriorityFeePerGas\"\n );\n }\n\n let maxPriorityFeePerGas: BigNumberish =\n await client.estimateMaxPriorityFeePerGas();\n\n maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(\n maxPriorityFeePerGas,\n overrides?.maxPriorityFeePerGas,\n feeOptions?.maxPriorityFeePerGas\n );\n\n let maxFeePerGas: BigNumberish =\n feeData.maxFeePerGas -\n feeData.maxPriorityFeePerGas +\n BigInt(maxPriorityFeePerGas);\n\n maxFeePerGas = applyUserOpOverrideOrFeeOption(\n maxFeePerGas,\n overrides?.maxFeePerGas,\n feeOptions?.maxFeePerGas\n );\n\n struct.maxFeePerGas = maxFeePerGas;\n struct.maxPriorityFeePerGas = maxPriorityFeePerGas;\n return struct;\n };\n}\n"]}
@@ -14,8 +14,10 @@ export const defaultGasEstimator = (client) => async (struct, { account, overrid
14
14
  const paymasterVerificationGasLimit = applyUserOpOverrideOrFeeOption(estimates.paymasterVerificationGasLimit, overrides
15
15
  ?.paymasterVerificationGasLimit, feeOptions
16
16
  ?.paymasterVerificationGasLimit);
17
- struct.paymasterVerificationGasLimit =
18
- paymasterVerificationGasLimit;
17
+ const uo_v7 = struct;
18
+ uo_v7.paymasterVerificationGasLimit = paymasterVerificationGasLimit;
19
+ uo_v7.paymasterPostOpGasLimit =
20
+ uo_v7.paymasterPostOpGasLimit ?? (uo_v7.paymaster ? "0x0" : undefined);
19
21
  }
20
22
  return struct;
21
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"gasEstimator.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/gasEstimator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAYvE,MAAM,CAAC,MAAM,mBAAmB,GAG9B,CAAC,MAAM,EAAE,EAAE,CACX,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;IACnD,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7D,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,wBAAwB,CACrD,OAAO,EACP,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO,EAC/B,SAAS,EAAE,aAAa,CACzB,CAAC;IAEF,MAAM,YAAY,GAAG,8BAA8B,CACjD,SAAS,CAAC,YAAY,EACtB,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,YAAY,CACzB,CAAC;IACF,MAAM,oBAAoB,GAAG,8BAA8B,CACzD,SAAS,CAAC,oBAAoB,EAC9B,SAAS,EAAE,oBAAoB,EAC/B,UAAU,EAAE,oBAAoB,CACjC,CAAC;IACF,MAAM,kBAAkB,GAAG,8BAA8B,CACvD,SAAS,CAAC,kBAAkB,EAC5B,SAAS,EAAE,kBAAkB,EAC7B,UAAU,EAAE,kBAAkB,CAC/B,CAAC;IAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,MAAM,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,MAAM,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAE/C,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAC3C,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QACnC,MAAM,6BAA6B,GAAG,8BAA8B,CAClE,SAAS,CAAC,6BAA6B,EACtC,SAA6C;YAC5C,EAAE,6BAA6B,EAChC,UAA+C;YAC9C,EAAE,6BAA6B,CAClC,CAAC;QACD,MAAuC,CAAC,6BAA6B;YACpE,6BAA6B,CAAC;IAClC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import type {\n UserOperationFeeOptions,\n UserOperationOverrides,\n UserOperationStruct,\n} from \"../../types.js\";\nimport { deepHexlify, resolveProperties } from \"../../utils/index.js\";\nimport { applyUserOpOverrideOrFeeOption } from \"../../utils/userop.js\";\nimport type { MiddlewareClient } from \"../actions.js\";\nimport type { ClientMiddlewareFn } from \"../types.js\";\n\n/**\n * Description default gas estimator middleware for `SmartAccountClient`\n * You can override this middleware with your custom gas estimator middleware\n * by passing it to the client constructor\n *\n * @param client smart account client instance to apply the middleware to\n * @returns middleware execution function used to estimate gas for user operations\n */\nexport const defaultGasEstimator: <C extends MiddlewareClient>(\n client: C\n) => ClientMiddlewareFn =\n (client) =>\n async (struct, { account, overrides, feeOptions }) => {\n const request = deepHexlify(await resolveProperties(struct));\n\n const estimates = await client.estimateUserOperationGas(\n request,\n account.getEntryPoint().address,\n overrides?.stateOverride\n );\n\n const callGasLimit = applyUserOpOverrideOrFeeOption(\n estimates.callGasLimit,\n overrides?.callGasLimit,\n feeOptions?.callGasLimit\n );\n const verificationGasLimit = applyUserOpOverrideOrFeeOption(\n estimates.verificationGasLimit,\n overrides?.verificationGasLimit,\n feeOptions?.verificationGasLimit\n );\n const preVerificationGas = applyUserOpOverrideOrFeeOption(\n estimates.preVerificationGas,\n overrides?.preVerificationGas,\n feeOptions?.preVerificationGas\n );\n\n struct.callGasLimit = callGasLimit;\n struct.verificationGasLimit = verificationGasLimit;\n struct.preVerificationGas = preVerificationGas;\n\n const entryPoint = account.getEntryPoint();\n if (entryPoint.version === \"0.7.0\") {\n const paymasterVerificationGasLimit = applyUserOpOverrideOrFeeOption(\n estimates.paymasterVerificationGasLimit,\n (overrides as UserOperationOverrides<\"0.7.0\">)\n ?.paymasterVerificationGasLimit,\n (feeOptions as UserOperationFeeOptions<\"0.7.0\">)\n ?.paymasterVerificationGasLimit\n );\n (struct as UserOperationStruct<\"0.7.0\">).paymasterVerificationGasLimit =\n paymasterVerificationGasLimit;\n }\n\n return struct;\n };\n"]}
1
+ {"version":3,"file":"gasEstimator.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/gasEstimator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAYvE,MAAM,CAAC,MAAM,mBAAmB,GAG9B,CAAC,MAAwB,EAAsB,EAAE,CACjD,KAAK,EA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AC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import type {\n UserOperationFeeOptions,\n UserOperationOverrides,\n UserOperationStruct,\n} from \"../../types.js\";\nimport { deepHexlify, resolveProperties } from \"../../utils/index.js\";\nimport { applyUserOpOverrideOrFeeOption } from \"../../utils/userop.js\";\nimport type { MiddlewareClient } from \"../actions.js\";\nimport type { ClientMiddlewareFn } from \"../types.js\";\n\n/**\n * Description default gas estimator middleware for `SmartAccountClient`\n * You can override this middleware with your custom gas estimator middleware\n * by passing it to the client constructor\n *\n * @param {MiddlewareClient} client smart account client instance to apply the middleware to\n * @returns {ClientMiddlewareFn} middleware execution function used to estimate gas for user operations\n */\nexport const defaultGasEstimator: <C extends MiddlewareClient>(\n client: C\n) => ClientMiddlewareFn =\n (client: MiddlewareClient): ClientMiddlewareFn =>\n async (struct, { account, overrides, feeOptions }) => {\n const request = deepHexlify(await resolveProperties(struct));\n\n const estimates = await client.estimateUserOperationGas(\n request,\n account.getEntryPoint().address,\n overrides?.stateOverride\n );\n\n const callGasLimit = applyUserOpOverrideOrFeeOption(\n estimates.callGasLimit,\n overrides?.callGasLimit,\n feeOptions?.callGasLimit\n );\n const verificationGasLimit = applyUserOpOverrideOrFeeOption(\n estimates.verificationGasLimit,\n overrides?.verificationGasLimit,\n feeOptions?.verificationGasLimit\n );\n const preVerificationGas = applyUserOpOverrideOrFeeOption(\n estimates.preVerificationGas,\n overrides?.preVerificationGas,\n feeOptions?.preVerificationGas\n );\n\n struct.callGasLimit = callGasLimit;\n struct.verificationGasLimit = verificationGasLimit;\n struct.preVerificationGas = preVerificationGas;\n\n const entryPoint = account.getEntryPoint();\n if (entryPoint.version === \"0.7.0\") {\n const paymasterVerificationGasLimit = applyUserOpOverrideOrFeeOption(\n estimates.paymasterVerificationGasLimit,\n (overrides as UserOperationOverrides<\"0.7.0\">)\n ?.paymasterVerificationGasLimit,\n (feeOptions as UserOperationFeeOptions<\"0.7.0\">)\n ?.paymasterVerificationGasLimit\n );\n const uo_v7 = struct as UserOperationStruct<\"0.7.0\">;\n\n uo_v7.paymasterVerificationGasLimit = paymasterVerificationGasLimit;\n\n uo_v7.paymasterPostOpGasLimit =\n uo_v7.paymasterPostOpGasLimit ?? (uo_v7.paymaster ? \"0x0\" : undefined);\n }\n\n return struct;\n };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"paymasterAndData.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/paymasterAndData.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,uBAAuB,GAAuB,KAAK,EAC9D,MAAM,EACN,EAAE,OAAO,EAAE,EACX,EAAE;IACF,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAC3C,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAClC,MAAuC,CAAC,gBAAgB,GAAG,IAAI,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import type { UserOperationStruct } from \"../../types\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\nexport const defaultPaymasterAndData: ClientMiddlewareFn = async (\n struct,\n { account }\n) => {\n const entryPoint = account.getEntryPoint();\n if (entryPoint.version === \"0.6.0\") {\n (struct as UserOperationStruct<\"0.6.0\">).paymasterAndData = \"0x\";\n }\n return struct;\n};\n"]}
1
+ {"version":3,"file":"paymasterAndData.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/paymasterAndData.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAuB,KAAK,EAC9D,MAAM,EACN,EAAE,OAAO,EAAE,EACX,EAAE;IACF,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAC3C,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAClC,MAAuC,CAAC,gBAAgB,GAAG,IAAI,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import type { UserOperationStruct } from \"../../types\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\n/**\n * Middleware function that sets the `paymasterAndData` field in the given struct based on the entry point version of the account.\n * This is the default used by `createSmartAccountClient` and is not necessary to be used directly.\n *\n * @param {UserOperationStruct} struct the user operation structure to be modified\n * @param {{ account: Account }} context an object containing the account information\n * @returns {Promise<UserOperationStruct>} a promise that resolves to the modified user operation structure\n */\nexport const defaultPaymasterAndData: ClientMiddlewareFn = async (\n struct,\n { account }\n) => {\n const entryPoint = account.getEntryPoint();\n if (entryPoint.version === \"0.6.0\") {\n (struct as UserOperationStruct<\"0.6.0\">).paymasterAndData = \"0x\";\n }\n return struct;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"userOpSigner.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/userOpSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,CAAC,MAAM,mBAAmB,GAAuB,KAAK,EAC1D,MAAM,EACN,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EACpC,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,yBAAyB,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IAED,OAAO;QACL,GAAG,cAAc;QACjB,SAAS,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAC5C,OAAO,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CACtD;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { AccountNotFoundError } from \"../../errors/account.js\";\nimport { ChainNotFoundError } from \"../../errors/client.js\";\nimport { InvalidUserOperationError } from \"../../errors/useroperation.js\";\nimport {\n deepHexlify,\n isValidRequest,\n resolveProperties,\n} from \"../../utils/index.js\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\nexport const defaultUserOpSigner: ClientMiddlewareFn = async (\n struct,\n { client, account = client.account }\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!client?.chain) {\n throw new ChainNotFoundError();\n }\n\n const resolvedStruct = await resolveProperties(struct);\n const request = deepHexlify(resolvedStruct);\n if (!isValidRequest(request)) {\n throw new InvalidUserOperationError(resolvedStruct);\n }\n\n return {\n ...resolvedStruct,\n signature: await account.signUserOperationHash(\n account.getEntryPoint().getUserOperationHash(request)\n ),\n };\n};\n"]}
1
+ {"version":3,"file":"userOpSigner.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/userOpSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAa9B,MAAM,CAAC,MAAM,mBAAmB,GAAuB,KAAK,EAC1D,MAAM,EACN,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EACpC,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,yBAAyB,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IAED,OAAO;QACL,GAAG,cAAc;QACjB,SAAS,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAC5C,OAAO,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CACtD;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { AccountNotFoundError } from \"../../errors/account.js\";\nimport { ChainNotFoundError } from \"../../errors/client.js\";\nimport { InvalidUserOperationError } from \"../../errors/useroperation.js\";\nimport {\n deepHexlify,\n isValidRequest,\n resolveProperties,\n} from \"../../utils/index.js\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\n/**\n * Provides a default middleware function for signing user operations with a client account. This function validates the request and adds the signature to it.\n * This is already included in the client returned from `createSmartAccountClient`\n *\n * @param {UserOperationStruct} struct The user operation structure to be signed\n * @param {*} context The middleware context containing the client and account information\n * @param {Client} context.client The client object, which should include account and chain information\n * @param {Account} [context.account] Optional, the account used for signing, defaults to the client's account if not provided\n * @returns {Promise<UserOperationStruct>} A promise that resolves to the signed user operation structure\n */\nexport const defaultUserOpSigner: ClientMiddlewareFn = async (\n struct,\n { client, account = client.account }\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!client?.chain) {\n throw new ChainNotFoundError();\n }\n\n const resolvedStruct = await resolveProperties(struct);\n const request = deepHexlify(resolvedStruct);\n if (!isValidRequest(request)) {\n throw new InvalidUserOperationError(resolvedStruct);\n }\n\n return {\n ...resolvedStruct,\n signature: await account.signUserOperationHash(\n account.getEntryPoint().getUserOperationHash(request)\n ),\n };\n};\n"]}
@@ -0,0 +1,40 @@
1
+ import { type Address, type Chain, type Client, type Hex, type Transport } from "viem";
2
+ import type { ClientMiddlewareConfig } from "../client/types";
3
+ import type { EntryPointVersion } from "../entrypoint/types";
4
+ import type { UserOperationFeeOptions, UserOperationOverrides, UserOperationRequest, UserOperationStruct } from "../types";
5
+ import { type Deferrable } from "../utils/index.js";
6
+ export type Erc7677RpcSchema = [
7
+ {
8
+ Method: "pm_getPaymasterStubData";
9
+ Parameters: [UserOperationRequest, Address, Hex, Record<string, any>];
10
+ ReturnType: {
11
+ sponsor?: {
12
+ name: string;
13
+ icon?: string;
14
+ };
15
+ paymaster?: Address;
16
+ paymasterData?: Hex;
17
+ paymasterVerificationGasLimit?: Hex;
18
+ paymasterPostOpGasLimit?: Hex;
19
+ paymasterAndData?: Hex;
20
+ isFinal?: boolean;
21
+ };
22
+ },
23
+ {
24
+ Method: "pm_getPaymasterData";
25
+ Parameters: [UserOperationRequest, Address, Hex, Record<string, any>];
26
+ ReturnType: {
27
+ paymaster?: Address;
28
+ paymasterData?: Hex;
29
+ paymasterAndData?: Hex;
30
+ };
31
+ }
32
+ ];
33
+ export type Erc7677Client<T extends Transport = Transport> = Client<T, Chain, undefined, Erc7677RpcSchema>;
34
+ export type Erc7677MiddlewareParams<TContext extends Record<string, any> | undefined = Record<string, any> | undefined, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = {
35
+ context?: ((struct: Deferrable<UserOperationStruct<TEntryPointVersion>>, args: {
36
+ overrides?: UserOperationOverrides<TEntryPointVersion>;
37
+ feeOptions?: UserOperationFeeOptions;
38
+ }) => Promise<TContext>) | TContext;
39
+ };
40
+ export declare function erc7677Middleware<TContext extends Record<string, any> | undefined = Record<string, any> | undefined>(params?: Erc7677MiddlewareParams<TContext>): Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">;
@@ -0,0 +1,73 @@
1
+ import { toHex, } from "viem";
2
+ import { ChainNotFoundError } from "../errors/client.js";
3
+ import { deepHexlify, resolveProperties, } from "../utils/index.js";
4
+ export function erc7677Middleware(params) {
5
+ const dummyPaymasterAndData = async (uo, { client, account, feeOptions, overrides }) => {
6
+ const userOp = deepHexlify(await resolveProperties(uo));
7
+ userOp.maxFeePerGas = "0x0";
8
+ userOp.maxPriorityFeePerGas = "0x0";
9
+ userOp.callGasLimit = "0x0";
10
+ userOp.verificationGasLimit = "0x0";
11
+ userOp.preVerificationGas = "0x0";
12
+ const entrypoint = account.getEntryPoint();
13
+ if (entrypoint.version === "0.7.0") {
14
+ userOp.paymasterVerificationGasLimit = "0x0";
15
+ userOp.paymasterPostOpGasLimit = "0x0";
16
+ }
17
+ const context = (typeof params?.context === "function"
18
+ ? await params?.context(userOp, { overrides, feeOptions })
19
+ : params?.context) ?? {};
20
+ if (!client.chain) {
21
+ throw new ChainNotFoundError();
22
+ }
23
+ const erc7677client = client;
24
+ const { paymaster, paymasterAndData, paymasterData, paymasterPostOpGasLimit, paymasterVerificationGasLimit, } = await erc7677client.request({
25
+ method: "pm_getPaymasterStubData",
26
+ params: [userOp, entrypoint.address, toHex(client.chain.id), context],
27
+ });
28
+ if (entrypoint.version === "0.6.0") {
29
+ return {
30
+ ...uo,
31
+ paymasterAndData,
32
+ };
33
+ }
34
+ return {
35
+ ...uo,
36
+ paymaster,
37
+ paymasterData,
38
+ paymasterPostOpGasLimit,
39
+ paymasterVerificationGasLimit,
40
+ };
41
+ };
42
+ const paymasterAndData = async (uo, { client, account, feeOptions, overrides }) => {
43
+ const userOp = deepHexlify(await resolveProperties(uo));
44
+ const context = (typeof params?.context === "function"
45
+ ? await params?.context(userOp, { overrides, feeOptions })
46
+ : params?.context) ?? {};
47
+ if (!client.chain) {
48
+ throw new ChainNotFoundError();
49
+ }
50
+ const erc7677client = client;
51
+ const entrypoint = account.getEntryPoint();
52
+ const { paymaster, paymasterAndData, paymasterData } = await erc7677client.request({
53
+ method: "pm_getPaymasterData",
54
+ params: [userOp, entrypoint.address, toHex(client.chain.id), context],
55
+ });
56
+ if (entrypoint.version === "0.6.0") {
57
+ return {
58
+ ...uo,
59
+ paymasterAndData,
60
+ };
61
+ }
62
+ return {
63
+ ...uo,
64
+ paymaster,
65
+ paymasterData,
66
+ };
67
+ };
68
+ return {
69
+ dummyPaymasterAndData,
70
+ paymasterAndData,
71
+ };
72
+ }
73
+ //# sourceMappingURL=erc7677middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc7677middleware.js","sourceRoot":"","sources":["../../../src/middleware/erc7677middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAMN,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAOzD,OAAO,EACL,WAAW,EACX,iBAAiB,GAElB,MAAM,mBAAmB,CAAC;AAyE3B,MAAM,UAAU,iBAAiB,CAK/B,MAA0C;IAE1C,MAAM,qBAAqB,GAAuB,KAAK,EACrD,EAAE,EACF,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,EAC1C,EAAE;QACF,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC;QAGxD,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,oBAAoB,GAAG,KAAK,CAAC;QACpC,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,oBAAoB,GAAG,KAAK,CAAC;QACpC,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAElC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAE3C,I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D,MAAM,OAAO,GACX,CAAC,OAAO,MAAM,EAAE,OAAO,KAAK,UAAU;YACpC,CAAC,CAAC,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;YAC1D,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QAE7B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;QACjC,CAAC;QAED,MAAM,aAAa,GAAG,MAAuB,CAAC;QAE9C,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAClD,MAAM,aAAa,CAAC,OAAO,CAAC;YAC1B,MAAM,EAAE,qBAAqB;YAC7B,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC;SACtE,CAAC,CAAC;QAEL,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;YACnC,OAAO;gBACL,GAAG,EAAE;gBACL,gBAAgB;aACjB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,GAAG,EAAE;YACL,SAAS;YACT,aAAa;SACd,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO;QACL,qBAAqB;QACrB,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import {\n toHex,\n type Address,\n type Chain,\n type Client,\n type Hex,\n type Transport,\n} from \"viem\";\nimport type { ClientMiddlewareConfig } from \"../client/types\";\nimport type { EntryPointVersion } from \"../entrypoint/types\";\nimport { ChainNotFoundError } from \"../errors/client.js\";\nimport type {\n UserOperationFeeOptions,\n UserOperationOverrides,\n UserOperationRequest,\n UserOperationStruct,\n} from \"../types\";\nimport {\n deepHexlify,\n resolveProperties,\n type Deferrable,\n} from \"../utils/index.js\";\nimport type { ClientMiddlewareFn } from \"./types\";\n\nexport type Erc7677RpcSchema = [\n {\n Method: \"pm_getPaymasterStubData\";\n Parameters: [UserOperationRequest, Address, Hex, Record<string, any>];\n ReturnType: {\n sponsor?: { name: string; icon?: string }; // Sponsor info\n paymaster?: Address; // Paymaster address (entrypoint v0.7)\n paymasterData?: Hex; // Paymaster data (entrypoint v0.7)\n paymasterVerificationGasLimit?: Hex; // Paymaster validation gas (entrypoint v0.7)\n paymasterPostOpGasLimit?: Hex; // Paymaster post-op gas (entrypoint v0.7)\n paymasterAndData?: Hex; // Paymaster and data (entrypoint v0.6)\n isFinal?: boolean; // Indicates that the caller does not need to call pm_getPaymasterData\n };\n },\n {\n Method: \"pm_getPaymasterData\";\n Parameters: [UserOperationRequest, Address, Hex, Record<string, any>];\n ReturnType: {\n paymaster?: Address; // Paymaster address (entrypoint v0.7)\n paymasterData?: Hex; // Paymaster data (entrypoint v0.7)\n paymasterAndData?: Hex; // Paymaster and data (entrypoint v0.6)\n };\n }\n];\n\nexport type Erc7677Client<T extends Transport = Transport> = Client<\n T,\n Chain,\n undefined,\n Erc7677RpcSchema\n>;\n\nexport type Erc7677MiddlewareParams<\n TContext extends Record<string, any> | undefined =\n | Record<string, any>\n | undefined,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = {\n context?:\n | ((\n struct: Deferrable<UserOperationStruct<TEntryPointVersion>>,\n args: {\n overrides?: UserOperationOverrides<TEntryPointVersion>;\n feeOptions?: UserOperationFeeOptions;\n }\n ) => Promise<TContext>)\n | TContext;\n};\n\n/**\n * Middleware function for interacting with ERC-7677 enabled clients. It supports resolving paymaster and data fields for user operations.\n * This middleware assumes that your RPC provider supports the ERC-7677 methods (pm_getPaymasterStubData and pm_getPaymasterData).\n *\n * @example\n * ```ts\n * import { createSmartAccountClient, erc7677Middleware } from \"@aa-sdk/core\";\n * import { http } from \"viem\";\n * import { sepolia } from \"viem/chains\";\n *\n * const client = createSmartAccountClient({\n * transport: http(\"rpc-url\"),\n * chain: sepolia,\n * // this assumes that your RPC provider supports the ERC-7677 methods AND takes no context\n * ...erc7677Middleware(),\n * })\n * ```\n *\n * @param {Erc7677MiddlewareParams<TContext>} params Middleware parameters including context function or object. Context can be resolved dynamically by passing in a function which takes in the context at the time of sending a user op\n * @returns {Pick<ClientMiddlewareConfig, \"dummyPaymasterAndData\" | \"paymasterAndData\">} An object containing middleware functions `dummyPaymasterAndData` and `paymasterAndData` for processing user operations with the paymaster data\n */\nexport function erc7677Middleware<\n TContext extends Record<string, any> | undefined =\n | Record<string, any>\n | undefined\n>(\n params?: Erc7677MiddlewareParams<TContext>\n): Pick<ClientMiddlewareConfig, \"dummyPaymasterAndData\" | \"paymasterAndData\"> {\n const dummyPaymasterAndData: ClientMiddlewareFn = async (\n uo,\n { client, account, feeOptions, overrides }\n ) => {\n const userOp = deepHexlify(await resolveProperties(uo));\n\n // Those values will be set after fee estimation.\n userOp.maxFeePerGas = \"0x0\";\n userOp.maxPriorityFeePerGas = \"0x0\";\n userOp.callGasLimit = \"0x0\";\n userOp.verificationGasLimit = \"0x0\";\n userOp.preVerificationGas = \"0x0\";\n\n const entrypoint = account.getEntryPoint();\n\n if (entrypoint.version === \"0.7.0\") {\n userOp.paymasterVerificationGasLimit = \"0x0\";\n userOp.paymasterPostOpGasLimit = \"0x0\";\n }\n\n const context =\n (typeof params?.context === \"function\"\n ? await params?.context(userOp, { overrides, feeOptions })\n : params?.context) ?? {};\n\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n const erc7677client = client as Erc7677Client;\n // TODO: probably need to handle the sponsor and isFinal fields\n const {\n paymaster,\n paymasterAndData,\n paymasterData,\n paymasterPostOpGasLimit,\n paymasterVerificationGasLimit,\n } = await erc7677client.request({\n method: \"pm_getPaymasterStubData\",\n params: [userOp, entrypoint.address, toHex(client.chain.id), context],\n });\n\n if (entrypoint.version === \"0.6.0\") {\n return {\n ...uo,\n paymasterAndData,\n };\n }\n\n return {\n ...uo,\n paymaster,\n paymasterData,\n paymasterPostOpGasLimit,\n paymasterVerificationGasLimit,\n };\n };\n\n const paymasterAndData: ClientMiddlewareFn = async (\n uo,\n { client, account, feeOptions, overrides }\n ) => {\n const userOp = deepHexlify(await resolveProperties(uo));\n const context =\n (typeof params?.context === \"function\"\n ? await params?.context(userOp, { overrides, feeOptions })\n : params?.context) ?? {};\n\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n const erc7677client = client as Erc7677Client;\n\n const entrypoint = account.getEntryPoint();\n const { paymaster, paymasterAndData, paymasterData } =\n await erc7677client.request({\n method: \"pm_getPaymasterData\",\n params: [userOp, entrypoint.address, toHex(client.chain.id), context],\n });\n\n if (entrypoint.version === \"0.6.0\") {\n return {\n ...uo,\n paymasterAndData,\n };\n }\n\n return {\n ...uo,\n paymaster,\n paymasterData,\n };\n };\n\n return {\n dummyPaymasterAndData,\n paymasterAndData,\n };\n}\n"]}
@@ -1,2 +1,3 @@
1
+ import type { UserOperationContext } from "../actions/smartAccount/types";
1
2
  import type { ClientMiddlewareFn } from "./types";
2
- export declare const noopMiddleware: ClientMiddlewareFn;
3
+ export declare const noopMiddleware: ClientMiddlewareFn<UserOperationContext | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"noopMiddleware.js","sourceRoot":"","sources":["../../../src/middleware/noopMiddleware.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,cAAc,GAAuB,KAAK,EAAE,IAAI,EAAE,EAAE;IAC/D,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import type { ClientMiddlewareFn } from \"./types\";\n\n/**\n * Noop middleware that does nothing and passes the arguments through\n *\n * @async\n * @param args the client middleware arguments passed to the middleware\n * @returns the arguments passed to the middleware and returned as is without modification\n */\nexport const noopMiddleware: ClientMiddlewareFn = async (args) => {\n return args;\n};\n"]}
1
+ {"version":3,"file":"noopMiddleware.js","sourceRoot":"","sources":["../../../src/middleware/noopMiddleware.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,cAAc,GAEvB,KAAK,EAAE,IAAI,EAAE,EAAE;IACjB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import type { UserOperationContext } from \"../actions/smartAccount/types\";\nimport type { ClientMiddlewareFn } from \"./types\";\n\n/**\n * Noop middleware that does nothing and passes the arguments through\n *\n * @param {Deferrable<UserOperationStruct<TEntryPointVersion>>} args the client middleware arguments passed to the middleware\n * @returns {Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>} the arguments passed to the middleware and returned as is without modification\n */\nexport const noopMiddleware: ClientMiddlewareFn<\n UserOperationContext | undefined\n> = async (args) => {\n return args;\n};\n"]}
@@ -3,13 +3,14 @@ import type { UserOperationContext } from "../actions/smartAccount/types";
3
3
  import type { UserOperationFeeOptions, UserOperationOverrides, UserOperationStruct } from "../types";
4
4
  import type { Deferrable } from "../utils";
5
5
  import type { MiddlewareClient } from "./actions";
6
- export type ClientMiddlewareFn<TContext extends UserOperationContext | undefined = UserOperationContext | undefined> = <TAccount extends SmartContractAccount, C extends MiddlewareClient, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(struct: Deferrable<UserOperationStruct<TEntryPointVersion>>, args: {
6
+ export type ClientMiddlewareArgs<TAccount extends SmartContractAccount, C extends MiddlewareClient, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>> = {
7
7
  overrides?: UserOperationOverrides<TEntryPointVersion>;
8
8
  context?: TContext;
9
9
  feeOptions?: UserOperationFeeOptions;
10
10
  account: TAccount;
11
11
  client: C;
12
- }) => Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>;
12
+ };
13
+ export type ClientMiddlewareFn<TContext extends UserOperationContext | undefined = UserOperationContext | undefined> = <TAccount extends SmartContractAccount, C extends MiddlewareClient, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(struct: Deferrable<UserOperationStruct<TEntryPointVersion>>, args: ClientMiddlewareArgs<TAccount, C, TContext, TEntryPointVersion>) => Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>;
13
14
  export type ClientMiddleware<TContext extends UserOperationContext | undefined = UserOperationContext | undefined> = {
14
15
  dummyPaymasterAndData: ClientMiddlewareFn<TContext>;
15
16
  feeEstimator: ClientMiddlewareFn<TContext>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/middleware/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../account/smartContractAccount\";\nimport type { UserOperationContext } from \"../actions/smartAccount/types\";\nimport type {\n UserOperationFeeOptions,\n UserOperationOverrides,\n UserOperationStruct,\n} from \"../types\";\nimport type { Deferrable } from \"../utils\";\nimport type { MiddlewareClient } from \"./actions\";\n\n// [!region ClientMiddlewareFn]\nexport type ClientMiddlewareFn<\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = <\n TAccount extends SmartContractAccount,\n C extends MiddlewareClient,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n>(\n struct: Deferrable<UserOperationStruct<TEntryPointVersion>>,\n args: {\n overrides?: UserOperationOverrides<TEntryPointVersion>;\n context?: TContext;\n feeOptions?: UserOperationFeeOptions;\n account: TAccount;\n client: C;\n }\n) => Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>;\n// [!endregion ClientMiddlewareFn]\n\n// [!region ClientMiddleware]\nexport type ClientMiddleware<\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = {\n dummyPaymasterAndData: ClientMiddlewareFn<TContext>;\n feeEstimator: ClientMiddlewareFn<TContext>;\n gasEstimator: ClientMiddlewareFn<TContext>;\n customMiddleware: ClientMiddlewareFn<TContext>;\n paymasterAndData: ClientMiddlewareFn<TContext>;\n userOperationSimulator: ClientMiddlewareFn<TContext>;\n signUserOperation: ClientMiddlewareFn<TContext>;\n};\n// [!endregion ClientMiddleware]\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/middleware/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../account/smartContractAccount\";\nimport type { UserOperationContext } from \"../actions/smartAccount/types\";\nimport type {\n UserOperationFeeOptions,\n UserOperationOverrides,\n UserOperationStruct,\n} from \"../types\";\nimport type { Deferrable } from \"../utils\";\nimport type { MiddlewareClient } from \"./actions\";\n\nexport type ClientMiddlewareArgs<\n TAccount extends SmartContractAccount,\n C extends MiddlewareClient,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n overrides?: UserOperationOverrides<TEntryPointVersion>;\n context?: TContext;\n feeOptions?: UserOperationFeeOptions;\n account: TAccount;\n client: C;\n};\n\n// [!region ClientMiddlewareFn]\nexport type ClientMiddlewareFn<\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = <\n TAccount extends SmartContractAccount,\n C extends MiddlewareClient,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n>(\n struct: Deferrable<UserOperationStruct<TEntryPointVersion>>,\n args: ClientMiddlewareArgs<TAccount, C, TContext, TEntryPointVersion>\n) => Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>;\n// [!endregion ClientMiddlewareFn]\n\n// [!region ClientMiddleware]\nexport type ClientMiddleware<\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = {\n dummyPaymasterAndData: ClientMiddlewareFn<TContext>;\n feeEstimator: ClientMiddlewareFn<TContext>;\n gasEstimator: ClientMiddlewareFn<TContext>;\n customMiddleware: ClientMiddlewareFn<TContext>;\n paymasterAndData: ClientMiddlewareFn<TContext>;\n userOperationSimulator: ClientMiddlewareFn<TContext>;\n signUserOperation: ClientMiddlewareFn<TContext>;\n};\n// [!endregion ClientMiddleware]\n"]}