@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
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["// borrowed from viem\n\n/**\n * @description Constructs a type by excluding `undefined` from `T`.\n *\n * @example\n * NoUndefined<string | undefined>\n * => string\n */\nexport type NoUndefined<T> = T extends undefined ? never : T;\n// borrowed from viem\n/**\n * @description Checks if {@link T} is `undefined`\n * @param T - Type to check\n * @example\n * type Result = IsUndefined<undefined>\n * // ^? type Result = true\n */\n\nexport type IsUndefined<T> = [undefined] extends [T] ? true : false;\n\nexport type RequiredBy<TType, TKeys extends keyof TType> = Required<\n Pick<TType, TKeys>\n> &\n Omit<TType, TKeys>;\n\n/**\n * @description Combines members of an intersection into a readable type.\n *\n * @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}\n * @example\n * Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>\n * => { a: string, b: string, c: number, d: bigint }\n */\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\n\nexport type WithRequired<T, K extends keyof T> = Required<Pick<T, K>>;\nexport type WithOptional<T, K extends keyof T> = Pick<Partial<T>, K>;\n\n// Checks for type equivalence, evaluates always to either `true` or `false`.\n// Semantics: (EQ<A, B> = true) <==> (A <==> B)\nexport type EQ<A, B> = [A] extends [B]\n ? [B] extends [A]\n ? true\n : false\n : false;\n\n// Auxiliary type for `IsMemberOrSubtypeOfAComponent`\n// Evaluates to `true` or `boolean` if one of the explicit components (according to the TypeScript distribution\n// mechanism for union types) of the union type equals the other given type.\n// Examples:\n// EqualsOneOfTheComponents<string, string | boolean> ⟶ boolean\n// EqualsOneOfTheComponents<string, string> ⟶ true\n// EqualsOneOfTheComponents<number, string | boolean> ⟶ false\nexport type EqualsOneOfTheComponents<T, Union> = Union extends infer Component // enforce distribution\n ? EQ<T, Component>\n : never;\n\n// Auxiliary type for `IsOneOf`\nexport type IsMemberOrSubtypeOfAComponent<\n T,\n Union,\n ConjunctionOfExplicitComponentChecks extends boolean\n> = [T] extends [Union]\n ? true extends ConjunctionOfExplicitComponentChecks\n ? true\n : false\n : false;\n\n// Checks whether the given type equals one of the explicit components of the union type. Note that in this respect we\n// consider the members of the infinite types number and string as implicit since the inbuilt distribution mechanism of\n// TypeScript does not (cannot) distribute over the infinite number of strings or numbers. However, `boolean` is treated\n// by TypeScript (and accordingly here) as the explicit union `true | false`.\n//\n// In particular, the evaluation result is `false` if the type is a proper union of components of the union type. It also\n// evaluates to false if the given type is a proper subtype of one of its explicit components.\n// It always evaluates to either `true` or `false`.\n// Examples:\n// IsOneOf<number, string | number | boolean> ⟶ true\n// IsOneOf<2 | 4, 0 | 1 | 2 | 3 | 4 | 5 | 6> ⟶ false\n// IsOneOf<'text', string> ⟶ false // only implicit but not explicit component\nexport type IsOneOf<T, Union> = IsMemberOrSubtypeOfAComponent<\n T,\n Union,\n EqualsOneOfTheComponents<T, Union>\n>;\n\nexport type OneOf<T1, T2> = IsOneOf<T1, T2> extends true ? T1 : never;\n\nexport type RecordableKeys<T> = {\n [K in keyof T]: T[K] extends string | number | symbol ? K : never;\n}[keyof T];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["// borrowed from viem\n\n/**\n * @description Constructs a type by excluding `undefined` from `T`.\n *\n * @example\n * NoUndefined<string | undefined>\n * => string\n */\nexport type NoUndefined<T> = T extends undefined ? never : T;\n// borrowed from viem\n/**\n * @description Checks if T is `undefined`\n * @param T - Type to check\n * @example\n * type Result = IsUndefined<undefined>\n * // ^? type Result = true\n */\n\nexport type IsUndefined<T> = [undefined] extends [T] ? true : false;\n\nexport type RequiredBy<TType, TKeys extends keyof TType> = Required<\n Pick<TType, TKeys>\n> &\n Omit<TType, TKeys>;\n\n/**\n * @description Combines members of an intersection into a readable type.\n *\n * @see https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg\n * @example\n * Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>\n * => { a: string, b: string, c: number, d: bigint }\n */\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\n\nexport type WithRequired<T, K extends keyof T> = Required<Pick<T, K>>;\nexport type WithOptional<T, K extends keyof T> = Pick<Partial<T>, K>;\n\n// Checks for type equivalence, evaluates always to either `true` or `false`.\n// Semantics: (EQ<A, B> = true) <==> (A <==> B)\nexport type EQ<A, B> = [A] extends [B]\n ? [B] extends [A]\n ? true\n : false\n : false;\n\n// Auxiliary type for `IsMemberOrSubtypeOfAComponent`\n// Evaluates to `true` or `boolean` if one of the explicit components (according to the TypeScript distribution\n// mechanism for union types) of the union type equals the other given type.\n// Examples:\n// EqualsOneOfTheComponents<string, string | boolean> ⟶ boolean\n// EqualsOneOfTheComponents<string, string> ⟶ true\n// EqualsOneOfTheComponents<number, string | boolean> ⟶ false\nexport type EqualsOneOfTheComponents<T, Union> = Union extends infer Component // enforce distribution\n ? EQ<T, Component>\n : never;\n\n// Auxiliary type for `IsOneOf`\nexport type IsMemberOrSubtypeOfAComponent<\n T,\n Union,\n ConjunctionOfExplicitComponentChecks extends boolean\n> = [T] extends [Union]\n ? true extends ConjunctionOfExplicitComponentChecks\n ? true\n : false\n : false;\n\n// Checks whether the given type equals one of the explicit components of the union type. Note that in this respect we\n// consider the members of the infinite types number and string as implicit since the inbuilt distribution mechanism of\n// TypeScript does not (cannot) distribute over the infinite number of strings or numbers. However, `boolean` is treated\n// by TypeScript (and accordingly here) as the explicit union `true | false`.\n//\n// In particular, the evaluation result is `false` if the type is a proper union of components of the union type. It also\n// evaluates to false if the given type is a proper subtype of one of its explicit components.\n// It always evaluates to either `true` or `false`.\n// Examples:\n// IsOneOf<number, string | number | boolean> ⟶ true\n// IsOneOf<2 | 4, 0 | 1 | 2 | 3 | 4 | 5 | 6> ⟶ false\n// IsOneOf<'text', string> ⟶ false // only implicit but not explicit component\nexport type IsOneOf<T, Union> = IsMemberOrSubtypeOfAComponent<\n T,\n Union,\n EqualsOneOfTheComponents<T, Union>\n>;\n\nexport type OneOf<T1, T2> = IsOneOf<T1, T2> extends true ? T1 : never;\n\nexport type RecordableKeys<T> = {\n [K in keyof T]: T[K] extends string | number | symbol ? K : never;\n}[keyof T];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"userop.js","sourceRoot":"","sources":["../../../src/utils/userop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,MAAM,CAAC;AAYtD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAQtD,MAAM,UAAU,cAAc,CAG5B,OAAgD;IAGhD,OAAO,CACL,MAAM,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC,GAAG,EAAE;QACvC,MAAM,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC,GAAG,EAAE;QACvC,MAAM,CAAC,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC,GAAG,EAAE;QAC7C,MAAM,CAAC,OAAO,CAAC,oBAAoB,IAAI,EAAE,CAAC,GAAG,EAAE;QAC/C,OAAO,CAAC,oBAAoB,IAAI,IAAI;QACpC,uBAAuB,CAAC,OAAO,CAAC;QAChC,qBAAqB,CAAC,OAAO,CAAC,CAC/B,CAAC;AACJ,CAAC;AAQD,MAAM,UAAU,uBAAuB,CAErC,OAAgD;IAChD,IAAI,kBAAkB,IAAI,OAAO,EAAE,CAAC;QAClC,OAAQ,OAAkC,CAAC,gBAAgB,IAAI,IAAI,CAAC;IACtE,CAAC;IAGD,OAAO,QAAQ,CACZ,OAAkC,CAAC,SAAS,IAAI,IAAI,EACpD,OAAkC,CAAC,aAAa,IAAI,IAAI,EACxD,OAAkC,CAAC,uBAAuB,IAAI,IAAI,EAClE,OAAkC,CAAC,6BAA6B,IAAI,IAAI,CAC1E,CAAC;AACJ,CAAC;AAQD,MAAM,UAAU,qBAAqB,CAEnC,OAAgD;IAChD,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,EAAE,QAAQ,E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CAAC;AAWD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAGpC,SAAiE,EACxD,EAAE,CACX,CAAC,CAAC,SAAS;IACX,CAAC,kBAAkB,IAAI,SAAS,IAAI,eAAe,IAAI,SAAS,CAAC,CAAC;AAWpE,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAG5C,SAAiE,EACxD,EAAE,CACX,SAAS,KAAK,SAAS;IACvB,CAAC,CAAC,kBAAkB,IAAI,SAAS,IAAI,SAAS,CAAC,gBAAgB,KAAK,IAAI,CAAC;QACvE,CAAC,eAAe,IAAI,SAAS,IAAI,SAAS,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC;AASxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,gBAAqB,EAC+C,EAAE,CAAC,CAAC;IACxE,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAY;IACvD,aAAa,EAAE,KAAK,gBAAgB,CAAC,SAAS,CAAC,EAAE,CAAC,EAAS;CAC5D,CAAC,CAAC;AAYH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,SAAS,GAAG,IAAI,EAChB,aAAa,GAAG,IAAI,GAC+C,EAAO,EAAE,CAC5E,MAAM,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC","sourcesContent":["import { concat, type Address, type Hex } from \"viem\";\nimport type { EntryPointVersion } from \"../entrypoint/types\";\nimport type {\n BigNumberish,\n Multiplier,\n UserOperationFeeOptionsField,\n UserOperationOverrides,\n UserOperationRequest,\n UserOperationStruct,\n UserOperationStruct_v6,\n UserOperationStruct_v7,\n} from \"../types\";\nimport { bigIntClamp, bigIntMultiply } from \"./bigint.js\";\nimport { allEqual, isBigNumberish } from \"./index.js\";\n\n/**\n * Utility method for asserting a {@link UserOperationStruct} has valid fields for the given entry point version\n *\n * @param request a {@link UserOperationStruct} to validate\n * @returns a type guard that asserts the {@link UserOperationRequest} is valid\n */\nexport function isValidRequest<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(\n request: UserOperationStruct<TEntryPointVersion>\n): request is UserOperationRequest<TEntryPointVersion> {\n // These are the only ones marked as optional in the interface above\n return (\n BigInt(request.callGasLimit || 0n) > 0n &&\n BigInt(request.maxFeePerGas || 0n) > 0n &&\n BigInt(request.preVerificationGas || 0n) > 0n &&\n BigInt(request.verificationGasLimit || 0n) > 0n &&\n request.maxPriorityFeePerGas != null &&\n isValidPaymasterAndData(request) &&\n isValidFactoryAndData(request)\n );\n}\n\n/**\n * Utility method for asserting a {@link UserOperationRequest} has valid fields for the paymaster data\n *\n * @param request a {@link UserOperationRequest} to validate\n * @returns a type guard that asserts the {@link UserOperationRequest} is a {@link UserOperationRequest}\n */\nexport function isValidPaymasterAndData<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(request: UserOperationStruct<TEntryPointVersion>): boolean {\n if (\"paymasterAndData\" in request) {\n return (request as UserOperationStruct_v6).paymasterAndData != null;\n }\n\n // either all exist, or none.\n return allEqual(\n (request as UserOperationStruct_v7).paymaster == null,\n (request as UserOperationStruct_v7).paymasterData == null,\n (request as UserOperationStruct_v7).paymasterPostOpGasLimit == null,\n (request as UserOperationStruct_v7).paymasterVerificationGasLimit == null\n );\n}\n\n/**\n * Utility method for asserting a {@link UserOperationStruct} has valid fields for the paymaster data\n *\n * @param request a {@link UserOperationRequest} to validate\n * @returns a type guard that asserts the {@link UserOperationStruct} is a {@link UserOperationRequest}\n */\nexport function isValidFactoryAndData<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(request: UserOperationStruct<TEntryPointVersion>): boolean {\n if (\"initCode\" in request) {\n const { initCode } = request as UserOperationStruct_v6;\n return initCode != null;\n }\n\n // either all exist, or none.\n return allEqual(\n (request as UserOperationStruct_v7).factory == null,\n (request as UserOperationStruct_v7).factoryData == null\n );\n}\n\n/**\n * Utility method for applying a {@link UserOperationOverrides} field value\n * over the current value set for the field\n *\n * @param value the current value of the field\n * @param override the override value to apply\n * @returns the new value of the field after applying the override\n */\nexport function applyUserOpOverride<TValue extends BigNumberish | undefined>(\n value: TValue,\n override?: BigNumberish | Multiplier\n): TValue | BigNumberish {\n if (override == null) {\n return value;\n }\n\n if (isBigNumberish(override)) {\n return override;\n }\n\n // multiplier override\n else {\n return value != null ? bigIntMultiply(value, override.multiplier) : value;\n }\n}\n\n/**\n * Utility method for applying a {@link UserOperationFeeOptionsField} value\n * over the current value set for the field\n *\n * @param value the current value of the field\n * @param feeOption the fee option field value to apply\n * @returns the new value of the field after applying the fee option\n */\nexport function applyUserOpFeeOption<TValue extends BigNumberish | undefined>(\n value: TValue,\n feeOption?: UserOperationFeeOptionsField\n): TValue | BigNumberish {\n if (feeOption == null) {\n return value;\n }\n\n return value != null\n ? bigIntClamp(\n feeOption.multiplier\n ? bigIntMultiply(value, feeOption.multiplier)\n : value,\n feeOption.min,\n feeOption.max\n )\n : feeOption.min ?? 0n;\n}\n\n/**\n * Utility method for applying a {@link UserOperationOverrides} field value and\n * a {@link UserOperationFeeOptionsField} value over the current value set for the field,\n * with the override taking precedence over the fee option\n *\n * @param value the current value of the field\n * @param [override] the override value to apply\n * @param [feeOption] the fee option field value to apply\n * @returns the new value of the field after applying the override or fee option\n */\nexport function applyUserOpOverrideOrFeeOption<\n TValue extends BigNumberish | undefined\n>(\n value: TValue,\n override?: BigNumberish | Multiplier,\n feeOption?: UserOperationFeeOptionsField\n): TValue | BigNumberish {\n return value != null && override != null\n ? applyUserOpOverride(value, override)!\n : applyUserOpFeeOption(value, feeOption);\n}\n\n/**\n * Utility method for checking whether the middleware pipeline should\n * bypass the paymaster middleware for the user operation with the given overrides,\n * either because the UserOp is paying for its own gas, or passing a specific paymaster\n *\n * @template EntryPointVersion TEntryPointVersion\n * @param overrides the user operation overrides to check\n * @returns whether the paymaster middleware should be bypassed\n */\nexport const bypassPaymasterAndData = <\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(\n overrides: UserOperationOverrides<TEntryPointVersion> | undefined\n): boolean =>\n !!overrides &&\n (\"paymasterAndData\" in overrides || \"paymasterData\" in overrides);\n\n/**\n * An alternative to `bypassPaymasterAndData` which only returns true if the data parameter\n * is \"0x,\" this is useful for cases when middleware should be bypassed ONLY IF the UserOp will\n * pay for its own gas\n *\n * @template EntryPointVersion TEntryPointVersion\n * @param overrides the user operation overrides to check\n * @returns whether the paymaster middleware should be bypassed\n */\nexport const bypassPaymasterAndDataEmptyHex = <\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(\n overrides: UserOperationOverrides<TEntryPointVersion> | undefined\n): boolean =>\n overrides !== undefined &&\n ((\"paymasterAndData\" in overrides && overrides.paymasterAndData === \"0x\") ||\n (\"paymasterData\" in overrides && overrides.paymasterData === \"0x\"));\n\n/**\n * Utility method for parsing the paymaster address and paymasterData from the paymasterAndData hex string\n *\n * @param paymasterAndData the paymaster and data hex string to parse.\n * The hex string refers to the paymasterAndData field of entrypoint v0.6 user operation request\n * @returns the parsed paymaster and paymasterData fields of entrypoint v0.7 user operation request paymaster and paymasterData field\n */\nexport const parsePaymasterAndData = (\n paymasterAndData: Hex\n): Pick<UserOperationRequest<\"0.7.0\">, \"paymaster\" | \"paymasterData\"> => ({\n paymaster: paymasterAndData.substring(0, 42) as Address,\n paymasterData: `0x${paymasterAndData.substring(42)}` as Hex,\n});\n\n/**\n * Utility method for converting the object containing the paymaster address and paymaster data\n * to the paymaster and data concatenated hex string\n *\n * @param paymasterAndData the object containing the picked paymaster and paymasterData fields of\n * entrypoint v0.7 user operation request\n * @param paymasterAndData.paymaster the paymaster address\n * @param paymasterAndData.paymasterData the paymaster data\n * @returns the paymasterAndData hex value of entrypoint v0.6 user operation request paymasterAndData field\n */\nexport const concatPaymasterAndData = ({\n paymaster = \"0x\",\n paymasterData = \"0x\",\n}: Pick<UserOperationRequest<\"0.7.0\">, \"paymaster\" | \"paymasterData\">): Hex =>\n concat([paymaster, paymasterData]);\n"]}
1
+ {"version":3,"file":"userop.js","sour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,kBAAkB,IAAI,SAAS,IAAI,eAAe,IAAI,SAAS,CAAC,CAAC;AAWpE,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAG5C,SAAiE,EACxD,EAAE,CACX,SAAS,KAAK,SAAS;IACvB,CAAC,CAAC,kBAAkB,IAAI,SAAS,IAAI,SAAS,CAAC,gBAAgB,KAAK,IAAI,CAAC;QACvE,CAAC,eAAe,IAAI,SAAS,IAAI,SAAS,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC;AASxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,gBAAqB,EAC+C,EAAE,CAAC,CAAC;IACxE,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAY;IACvD,aAAa,EAAE,KAAK,gBAAgB,CAAC,SAAS,CAAC,EAAE,CAAC,EAAS;CAC5D,CAAC,CAAC;AAYH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,SAAS,GAAG,IAAI,EAChB,aAAa,GAAG,IAAI,GAC+C,EAAO,EAAE,CAC5E,MAAM,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC","sourcesContent":["import { concat, type Address, type Hex } from \"viem\";\nimport type { EntryPointVersion } from \"../entrypoint/types\";\nimport type {\n BigNumberish,\n Multiplier,\n UserOperationFeeOptionsField,\n UserOperationOverrides,\n UserOperationRequest,\n UserOperationStruct,\n UserOperationStruct_v6,\n UserOperationStruct_v7,\n} from \"../types\";\nimport { bigIntClamp, bigIntMultiply } from \"./bigint.js\";\nimport { allEqual, isBigNumberish } from \"./index.js\";\n\n/**\n * Utility method for asserting a UserOperationStruct has valid fields for the given entry point version\n *\n * @param {UserOperationStruct} request a UserOperationStruct to validate\n * @returns {boolean} a type guard that asserts the UserOperationRequest is valid\n */\nexport function isValidRequest<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(\n request: UserOperationStruct<TEntryPointVersion>\n): request is UserOperationRequest<TEntryPointVersion> {\n // These are the only ones marked as optional in the interface above\n return (\n BigInt(request.callGasLimit || 0n) > 0n &&\n BigInt(request.maxFeePerGas || 0n) > 0n &&\n BigInt(request.preVerificationGas || 0n) > 0n &&\n BigInt(request.verificationGasLimit || 0n) > 0n &&\n request.maxPriorityFeePerGas != null &&\n isValidPaymasterAndData(request) &&\n isValidFactoryAndData(request)\n );\n}\n\n/**\n * Utility method for asserting a UserOperationRequest has valid fields for the paymaster data\n *\n * @param {UserOperationRequest} request a UserOperationRequest to validate\n * @returns {boolean} a type guard that asserts the UserOperationRequest is a UserOperationRequest\n */\nexport function isValidPaymasterAndData<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(request: UserOperationStruct<TEntryPointVersion>): boolean {\n if (\"paymasterAndData\" in request) {\n return (request as UserOperationStruct_v6).paymasterAndData != null;\n }\n\n // either all exist, or none.\n return allEqual(\n (request as UserOperationStruct_v7).paymaster == null,\n (request as UserOperationStruct_v7).paymasterData == null,\n (request as UserOperationStruct_v7).paymasterPostOpGasLimit == null,\n (request as UserOperationStruct_v7).paymasterVerificationGasLimit == null\n );\n}\n\n/**\n * Utility method for asserting a UserOperationStruct has valid fields for the paymaster data\n *\n * @param {UserOperationRequest} request a UserOperationRequest to validate\n * @returns {boolean} a type guard that asserts the UserOperationStruct is a UserOperationRequest\n */\nexport function isValidFactoryAndData<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(request: UserOperationStruct<TEntryPointVersion>): boolean {\n if (\"initCode\" in request) {\n const { initCode } = request as UserOperationStruct_v6;\n return initCode != null;\n }\n\n // either all exist, or none.\n return allEqual(\n (request as UserOperationStruct_v7).factory == null,\n (request as UserOperationStruct_v7).factoryData == null\n );\n}\n\n/**\n * Utility method for applying a UserOperationOverrides field value\n * over the current value set for the field\n *\n * @param {BigNumberish} value the current value of the field\n * @param {BigNumberish | Multiplier} override the override value to apply\n * @returns {BigNumberish} the new value of the field after applying the override\n */\nexport function applyUserOpOverride<TValue extends BigNumberish | undefined>(\n value: TValue,\n override?: BigNumberish | Multiplier\n): TValue | BigNumberish {\n if (override == null) {\n return value;\n }\n\n if (isBigNumberish(override)) {\n return override;\n }\n\n // multiplier override\n else {\n return value != null ? bigIntMultiply(value, override.multiplier) : value;\n }\n}\n\n/**\n * Utility method for applying a UserOperationFeeOptionsField value\n * over the current value set for the field\n *\n * @param {BigNumberish} value the current value of the field\n * @param {UserOperationFeeOptionsField} feeOption the override value to apply\n * @returns {BigNumberish} the new value of the field after applying the override\n */\nexport function applyUserOpFeeOption<TValue extends BigNumberish | undefined>(\n value: TValue,\n feeOption?: UserOperationFeeOptionsField\n): TValue | BigNumberish {\n if (feeOption == null) {\n return value;\n }\n\n return value != null\n ? bigIntClamp(\n feeOption.multiplier\n ? bigIntMultiply(value, feeOption.multiplier)\n : value,\n feeOption.min,\n feeOption.max\n )\n : feeOption.min ?? 0n;\n}\n\n/**\n * Utility method for applying a UserOperationOverrides field value and\n * a UserOperationFeeOptionsField value over the current value set for the field,\n * with the override taking precedence over the fee option\n *\n * @param {BigNumberish} value the current value of the field\n * @param {BigNumberish | Multiplier} [override] the override value to apply\n * @param {UserOperationFeeOptionsField} [feeOption] the fee option field value to apply\n * @returns {BigNumberish} the new value of the field after applying the override or fee option\n */\nexport function applyUserOpOverrideOrFeeOption<\n TValue extends BigNumberish | undefined\n>(\n value: TValue,\n override?: BigNumberish | Multiplier,\n feeOption?: UserOperationFeeOptionsField\n): TValue | BigNumberish {\n return value != null && override != null\n ? applyUserOpOverride(value, override)!\n : applyUserOpFeeOption(value, feeOption);\n}\n\n/**\n * Utility method for checking whether the middleware pipeline should\n * bypass the paymaster middleware for the user operation with the given overrides,\n * either because the UserOp is paying for its own gas, or passing a specific paymaster\n *\n * @template EntryPointVersion TEntryPointVersion\n * @param {UserOperationOverrides<TEntryPointVersion> | undefined} overrides the user operation overrides to check\n * @returns {boolean} whether the paymaster middleware should be bypassed\n */\nexport const bypassPaymasterAndData = <\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(\n overrides: UserOperationOverrides<TEntryPointVersion> | undefined\n): boolean =>\n !!overrides &&\n (\"paymasterAndData\" in overrides || \"paymasterData\" in overrides);\n\n/**\n * An alternative to `bypassPaymasterAndData` which only returns true if the data parameter\n * is \"0x,\" this is useful for cases when middleware should be bypassed ONLY IF the UserOp will\n * pay for its own gas\n *\n * @template EntryPointVersion TEntryPointVersion\n * @param {UserOperationOverrides<TEntryPointVersion> | undefined} overrides the user operation overrides to check\n * @returns {boolean} whether the paymaster middleware should be bypassed\n */\nexport const bypassPaymasterAndDataEmptyHex = <\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(\n overrides: UserOperationOverrides<TEntryPointVersion> | undefined\n): boolean =>\n overrides !== undefined &&\n ((\"paymasterAndData\" in overrides && overrides.paymasterAndData === \"0x\") ||\n (\"paymasterData\" in overrides && overrides.paymasterData === \"0x\"));\n\n/**\n * Utility method for parsing the paymaster address and paymasterData from the paymasterAndData hex string\n *\n * @param {Hex} paymasterAndData the paymaster and data hex string to parse.\n * The hex string refers to the paymasterAndData field of entrypoint v0.6 user operation request\n * @returns {{ paymaster: Hex; paymasterData: Hex}} the parsed paymaster and paymasterData fields of entrypoint v0.7 user operation request paymaster and paymasterData field\n */\nexport const parsePaymasterAndData = (\n paymasterAndData: Hex\n): Pick<UserOperationRequest<\"0.7.0\">, \"paymaster\" | \"paymasterData\"> => ({\n paymaster: paymasterAndData.substring(0, 42) as Address,\n paymasterData: `0x${paymasterAndData.substring(42)}` as Hex,\n});\n\n/**\n * Utility method for converting the object containing the paymaster address and paymaster data\n * to the paymaster and data concatenated hex string\n *\n * @param {{ paymaster: Hex; paymasterData: Hex}} paymasterAndData the object containing the picked paymaster and paymasterData fields of\n * entrypoint v0.7 user operation request\n * @param {Hex} paymasterAndData.paymaster the paymaster address\n * @param {Hex} paymasterAndData.paymasterData the paymaster data\n * @returns {Hex} the paymasterAndData hex value of entrypoint v0.6 user operation request paymasterAndData field\n */\nexport const concatPaymasterAndData = ({\n paymaster = \"0x\",\n paymasterData = \"0x\",\n}: Pick<UserOperationRequest<\"0.7.0\">, \"paymaster\" | \"paymasterData\">): Hex =>\n concat([paymaster, paymasterData]);\n"]}
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.0-alpha.0";
1
+ export declare const VERSION = "4.0.0-alpha.10";
@@ -1,2 +1,2 @@
1
- export const VERSION = "4.0.0-alpha.0";
1
+ export const VERSION = "4.0.0-alpha.10";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.0.0-alpha.0\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.0.0-alpha.10\";\n"]}
@@ -8,6 +8,11 @@ export type AccountOp = {
8
8
  value?: bigint;
9
9
  data: Hex | "0x";
10
10
  };
11
+ export declare enum DeploymentState {
12
+ UNDEFINED = "0x0",
13
+ NOT_DEPLOYED = "0x1",
14
+ DEPLOYED = "0x2"
15
+ }
11
16
  export type GetEntryPointFromAccount<TAccount extends SmartContractAccount | undefined, TAccountOverride extends SmartContractAccount = SmartContractAccount> = GetAccountParameter<TAccount, TAccountOverride> extends SmartContractAccount<string, infer TEntryPointVersion> ? TEntryPointVersion : EntryPointVersion;
12
17
  export type GetAccountParameter<TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TAccountOverride extends SmartContractAccount = SmartContractAccount> = IsUndefined<TAccount> extends true ? {
13
18
  account: TAccountOverride;
@@ -21,6 +26,21 @@ export type UpgradeToAndCallParams = {
21
26
  export type SmartContractAccountWithSigner<Name extends string = string, TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = SmartContractAccount<Name, TEntryPointVersion> & {
22
27
  getSigner: () => TSigner;
23
28
  };
29
+ /**
30
+ * Determines if the given SmartContractAccount has a signer associated with it.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * import { toSmartContractAccount } from "@aa-sdk/core";
35
+ *
36
+ * const account = await toSmartContractAccount(...);
37
+ *
38
+ * console.log(isSmartAccountWithSigner(account)); // false: the base account does not have a publicly accessible signer
39
+ * ```
40
+ *
41
+ * @param {SmartContractAccount} account The account to check.
42
+ * @returns {boolean} true if the account has a signer, otherwise false.
43
+ */
24
44
  export declare const isSmartAccountWithSigner: (account: SmartContractAccount) => account is SmartContractAccountWithSigner<string, SmartAccountSigner<any>, keyof EntryPointRegistryBase<unknown>>;
25
45
  export type SmartContractAccount<Name extends string = string, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = LocalAccount<Name> & {
26
46
  source: Name;
@@ -58,12 +78,47 @@ export type ToSmartContractAccountParams<Name extends string = string, TTranspor
58
78
  signUserOperationHash?: (uoHash: Hex) => Promise<Hex>;
59
79
  encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise<Hex>;
60
80
  } & Omit<CustomSource, "signTransaction" | "address">;
81
+ /**
82
+ * Parses the factory address and factory calldata from the provided account initialization code (initCode).
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * import { parseFactoryAddressFromAccountInitCode } from "@aa-sdk/core";
87
+ *
88
+ * const [address, calldata] = parseFactoryAddressFromAccountInitCode("0xAddressCalldata");
89
+ * ```
90
+ *
91
+ * @param {Hex} initCode The initialization code from which to parse the factory address and calldata
92
+ * @returns {[Address, Hex]} A tuple containing the parsed factory address and factory calldata
93
+ */
61
94
  export declare const parseFactoryAddressFromAccountInitCode: (initCode: Hex) => [Address, Hex];
62
- export declare const getAccountAddress: ({ client, entryPoint, accountAddress, getAccountInitCode, }: {
95
+ export type GetAccountAddressParams = {
63
96
  client: PublicClient;
64
97
  entryPoint: EntryPointDef;
65
- accountAddress?: `0x${string}` | undefined;
98
+ accountAddress?: Address;
66
99
  getAccountInitCode: () => Promise<Hex>;
67
- }) => Promise<`0x${string}`>;
100
+ };
101
+ /**
102
+ * Retrieves the account address. Uses a provided `accountAddress` if available; otherwise, it computes the address using the entry point contract and the initial code.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * import { getEntryPoint, getAccountAddress } from "@aa-sdk/core";
107
+ *
108
+ * const accountAddress = await getAccountAddress({
109
+ * client,
110
+ * entryPoint: getEntryPoint(chain),
111
+ * getAccountInitCode: async () => "0x{factoryAddress}{factoryCallData}",
112
+ * });
113
+ * ```
114
+ *
115
+ * @param {GetAccountAddressParams} params The configuration object
116
+ * @param {PublicClient} params.client A public client instance to interact with the blockchain
117
+ * @param {EntryPointDef} params.entryPoint The entry point definition which includes the address and ABI
118
+ * @param {Address} params.accountAddress Optional existing account address
119
+ * @param {() => Promise<Hex>} params.getAccountInitCode A function that returns a Promise resolving to a Hex string representing the initial code of the account
120
+ * @returns {Promise<Address>} A promise that resolves to the account address
121
+ */
122
+ export declare const getAccountAddress: ({ client, entryPoint, accountAddress, getAccountInitCode, }: GetAccountAddressParams) => Promise<`0x${string}`>;
68
123
  export declare function toSmartContractAccount<Name extends string = string, TTransport extends Transport = Transport, TChain extends Chain = Chain, TEntryPointVersion extends EntryPointVersion = EntryPointVersion>({ transport, chain, entryPoint, source, accountAddress, getAccountInitCode, signMessage, signTypedData, encodeBatchExecute, encodeExecute, getDummySignature, signUserOperationHash, encodeUpgradeToAndCall, }: ToSmartContractAccountParams<Name, TTransport, TChain, TEntryPointVersion>): Promise<SmartContractAccount<Name, TEntryPointVersion>>;
69
124
  //# sourceMappingURL=smartContractAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"smartContractAccount.d.ts","sourceRoot":"","sources":["../../../src/account/smartContractAccount.ts"],"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ClB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,GACvB,EAAE,4BAA4B,CAC7B,IAAI,EACJ,UAAU,EACV,MAAM,EACN,kBAAkB,CACnB,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC"}
@@ -2,5 +2,28 @@ import type { Chain, Client, Transport } from "viem";
2
2
  import { type GetEntryPointFromAccount, type SmartContractAccount } from "../../account/smartContractAccount.js";
3
3
  import type { UserOperationStruct } from "../../types.js";
4
4
  import type { BuildUserOperationParameters, UserOperationContext } from "./types";
5
+ /**
6
+ * Builds a user operation using the provided client and operation parameters. Ensures that the account exists and the client is compatible.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import { createSmartAccountClient } from "@aa-sdk/core";
11
+ *
12
+ * // smart account client is already extended with buildUserOperation
13
+ * const client = createSmartAccountClient(...);
14
+ * const result = await client.buildUserOperation({
15
+ * uo: {
16
+ * target: "0x...",
17
+ * data: "0x...", // or "0x",
18
+ * value: 0n, // optional
19
+ * },
20
+ * account, // only required if the client above is not connected to an account
21
+ * });
22
+ * ```
23
+ *
24
+ * @param {Client<TTransport, TChain, TAccount>} client the client instance used to build the user operation
25
+ * @param {BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>} args the parameters required to build the user operation, including account, overrides, and context
26
+ * @returns {Promise<UserOperationStruct<TEntryPointVersion>>} a promise that resolves to a `UserOperationStruct` object containing the built user operation details
27
+ */
5
28
  export declare function buildUserOperation<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<TTransport, TChain, TAccount>, args: BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>): Promise<UserOperationStruct<TEntryPointVersion>>;
6
29
  //# sourceMappingURL=buildUserOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/buildUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAI/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EACV,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,wBAAsB,kBAAkB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACzE,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAsBlD"}
1
+ {"version":3,"file":"buildUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/buildUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAI/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EACV,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACzE,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAsBlD"}
@@ -3,43 +3,43 @@ import type { GetEntryPointFromAccount, SmartContractAccount } from "../../accou
3
3
  import type { UserOperationOverrides, UserOperationStruct } from "../../types.js";
4
4
  import type { UserOperationContext } from "./types.js";
5
5
  /**
6
- * Performs [`buildUserOperationFromTx`](./buildUserOperationFromTx.md) in batch and builds into a single, yet to be signed `UserOperation` (UO) struct. The output user operation struct will be filled with all gas fields (and paymaster data if a paymaster is used) based on the transactions data (`to`, `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas`) computed using the configured [`ClientMiddlewares`](/packages/aa-core/smart-account-client/middleware/index) on the `SmartAccountClient`
6
+ * Performs `buildUserOperationFromTx` in batch and builds into a single, yet to be signed `UserOperation` (UO) struct. The output user operation struct will be filled with all gas fields (and paymaster data if a paymaster is used) based on the transactions data (`to`, `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas`) computed using the configured `ClientMiddlewares` on the `SmartAccountClient`
7
7
  *
8
8
  * @example
9
9
  * ```ts
10
- import type { RpcTransactionRequest } from "viem";
11
- import { smartAccountClient } from "./smartAccountClient";
12
- // [!code focus:99]
13
- // buildUserOperationFromTx converts a traditional Ethereum transaction and returns
14
- // the unsigned user operation struct after constructing the user operation struct
15
- // through the middleware pipeline
16
- const tx: RpcTransactionRequest = {
17
- from, // ignored
18
- to,
19
- data: encodeFunctionData({
20
- abi: ContractABI.abi,
21
- functionName: "func",
22
- args: [arg1, arg2, ...],
23
- }),
24
- };
25
- const uoStruct = await smartAccountClient.buildUserOperationFromTx(tx);
26
-
27
- // signUserOperation signs the above unsigned user operation struct built
28
- // using the account connected to the smart account client
29
- const request = await smartAccountClient.signUserOperation({ uoStruct });
30
-
31
- // You can use the BundlerAction `sendRawUserOperation` (packages/core/src/actions/bundler/sendRawUserOperation.ts)
32
- // to send the signed user operation request to the bundler, requesting the bundler to send the signed uo to the
33
- // EntryPoint contract pointed at by the entryPoint address parameter
34
- const entryPointAddress = client.account.getEntryPoint().address;
35
- const uoHash = await smartAccountClient.sendRawUserOperation({ request, entryPoint: entryPointAddress });
36
- ```
10
+ * import type { RpcTransactionRequest } from "viem";
11
+ * import { smartAccountClient } from "./smartAccountClient";
12
+ * // [!code focus:99]
13
+ * // buildUserOperationFromTx converts a traditional Ethereum transaction and returns
14
+ * // the unsigned user operation struct after constructing the user operation struct
15
+ * // through the middleware pipeline
16
+ * const tx: RpcTransactionRequest = {
17
+ * from, // ignored
18
+ * to,
19
+ * data: encodeFunctionData({
20
+ * abi: ContractABI.abi,
21
+ * functionName: "func",
22
+ * args: [arg1, arg2, ...],
23
+ * }),
24
+ * };
25
+ * const uoStruct = await smartAccountClient.buildUserOperationFromTx(tx);
37
26
  *
38
- * @param client the smart account client to use for RPC requests
39
- * @param args {@link SendTransactionParameters}
40
- * @param overrides optional {@link UserOperationOverrides} to use for any of the fields
41
- * @param context if the smart account client requires additinoal context for building UOs
42
- * @returns a Promise containing the built user operation
27
+ * // signUserOperation signs the above unsigned user operation struct built
28
+ * // using the account connected to the smart account client
29
+ * const request = await smartAccountClient.signUserOperation({ uoStruct });
30
+ *
31
+ * // You can use the BundlerAction `sendRawUserOperation` (packages/core/src/actions/bundler/sendRawUserOperation.ts)
32
+ * // to send the signed user operation request to the bundler, requesting the bundler to send the signed uo to the
33
+ * // EntryPoint contract pointed at by the entryPoint address parameter
34
+ * const entryPointAddress = client.account.getEntryPoint().address;
35
+ * const uoHash = await smartAccountClient.sendRawUserOperation({ request, entryPoint: entryPointAddress });
36
+ * ```
37
+ *
38
+ * @param {Client<Transport, TChain, TAccount>} client the smart account client to use for RPC requests
39
+ * @param {SendTransactionParameters} args the send tx parameters
40
+ * @param {UserOperationOverrides} overrides optional overrides to use for any of the fields
41
+ * @param {TContext} context if the smart account client requires additinoal context for building UOs
42
+ * @returns {Promise<UserOperationStruct<TEntryPointVersion>>} a Promise containing the built user operation
43
43
  */
44
44
  export declare function buildUserOperationFromTx<TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TChainOverride extends Chain | undefined = Chain | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<Transport, TChain, TAccount>, args: SendTransactionParameters<TChain, TAccount, TChainOverride>, overrides?: UserOperationOverrides<TEntryPointVersion>, context?: TContext): Promise<UserOperationStruct<TEntryPointVersion>>;
45
45
  //# sourceMappingURL=buildUserOperationFromTx.d.ts.map
@@ -2,74 +2,58 @@ import { type Chain, type Client, type Transport } from "viem";
2
2
  import type { GetEntryPointFromAccount, SmartContractAccount } from "../../account/smartContractAccount";
3
3
  import type { BuildTransactionParameters, BuildUserOperationFromTransactionsResult, UserOperationContext } from "./types";
4
4
  /**
5
- * Performs {@link buildUserOperationFromTx} in batch and builds into a single,
5
+ * Performs `buildUserOperationFromTx` in batch and builds into a single,
6
6
  * yet to be signed `UserOperation` (UO) struct. The output user operation struct
7
7
  * will be filled with all gas fields (and paymaster data if a paymaster is used)
8
8
  * based on the transactions data (`to`, `data`, `value`, `maxFeePerGas`,
9
- * `maxPriorityFeePerGas`) computed using the configured
10
- * [`ClientMiddlewares`](/packages/aa-core/smart-account-client/middleware/index) on the `SmartAccountClient`
9
+ * `maxPriorityFeePerGas`) computed using the configured ClientMiddlewares on the SmartAccountClient.
11
10
  *
12
11
  * @example
13
12
  * ```ts
14
13
  * import type { RpcTransactionRequest } from "viem";
15
- import { smartAccountClient } from "./smartAccountClient";
16
- // [!code focus:99]
17
- // buildUserOperationFromTxs converts traditional Ethereum transactions in batch and returns
18
- // the unsigned user operation struct after constructing the user operation struct
19
- // through the middleware pipeline
20
- const requests: RpcTransactionRequest[] = [
21
- {
22
- from, // ignored
23
- to,
24
- data: encodeFunctionData({
25
- abi: ContractABI.abi,
26
- functionName: "func",
27
- args: [arg1, arg2, ...],
28
- }),
29
- },
30
- {
31
- from, // ignored
32
- to,
33
- data: encodeFunctionData({
34
- abi: ContractABI.abi,
35
- functionName: "func",
36
- args: [arg1, arg2, ...],
37
- }),
38
- },
39
- ...
40
- {
41
- from, // ignored
42
- to,
43
- data: encodeFunctionData({
44
- abi: ContractABI.abi,
45
- functionName: "func",
46
- args: [arg1, arg2, ...],
47
- }),
48
- },
49
- ];
50
- const uoStruct = await smartAccountClient.buildUserOperationFromTxs({
51
- requests,
52
- });
53
-
54
- // signUserOperation signs the above unsigned user operation struct built
55
- // using the account connected to the smart account client
56
- const request = await smartAccountClient.signUserOperation({ uoStruct });
57
-
58
- // You can use the BundlerAction `sendRawUserOperation` (packages/core/src/actions/bundler/sendRawUserOperation.ts)
59
- // to send the signed user operation request to the bundler, requesting the bundler to send the signed uo to the
60
- // EntryPoint contract pointed at by the entryPoint address parameter
61
- const entryPointAddress = client.account.getEntryPoint().address;
62
- const uoHash = await smartAccountClient.sendRawUserOperation({
63
- request,
64
- entryPoint: entryPointAddress,
65
- });
14
+ * import { smartAccountClient } from "./smartAccountClient";
15
+ *
16
+ * const requests: RpcTransactionRequest[] = [
17
+ * {
18
+ * from, // ignored
19
+ * to,
20
+ * data: encodeFunctionData({
21
+ * abi: ContractABI.abi,
22
+ * functionName: "func",
23
+ * args: [arg1, arg2, ...],
24
+ * }),
25
+ * },
26
+ * {
27
+ * from, // ignored
28
+ * to,
29
+ * data: encodeFunctionData({
30
+ * abi: ContractABI.abi,
31
+ * functionName: "func",
32
+ * args: [arg1, arg2, ...],
33
+ * }),
34
+ * },
35
+ * ];
36
+ * const uoStruct = await smartAccountClient.buildUserOperationFromTxs({
37
+ * requests,
38
+ * });
39
+ *
40
+ * // signUserOperation signs the above unsigned user operation struct built
41
+ * // using the account connected to the smart account client
42
+ * const request = await smartAccountClient.signUserOperation({ uoStruct });
43
+ *
44
+ * // You can use the BundlerAction `sendRawUserOperation` (packages/core/src/actions/bundler/sendRawUserOperation.ts)
45
+ * // to send the signed user operation request to the bundler, requesting the bundler to send the signed uo to the
46
+ * // EntryPoint contract pointed at by the entryPoint address parameter
47
+ * const entryPointAddress = client.account.getEntryPoint().address;
48
+ * const uoHash = await smartAccountClient.sendRawUserOperation({
49
+ * request,
50
+ * entryPoint: entryPointAddress,
51
+ * });
66
52
  * ```
67
53
  *
68
- * @param client the smart account client to use to make RPC calls
69
- * @param args {@link BuildTransactionParameters} an object containing the requests
70
- * to build as well as, the account if not hoisted, the context, the overrides, and
71
- * optionally a flag to enable signing of the UO via the underlying middleware
72
- * @returns a Promise containing the built user operation
54
+ * @param {Client<TTransport, TChain, TAccount>} client the smart account client to use to make RPC calls
55
+ * @param {BuildTransactionParameters} args an object containing the requests to build as well as, the account if not hoisted, the context, the overrides, and optionally a flag to enable signing of the UO via the underlying middleware
56
+ * @returns {Promise<BuildUserOperationFromTransactionsResult<TEntryPointVersion>>} a Promise containing the built user operation
73
57
  */
74
58
  export declare function buildUserOperationFromTxs<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(client: Client<TTransport, TChain, TAccount>, args: BuildTransactionParameters<TAccount, TContext, TEntryPointVersion>): Promise<BuildUserOperationFromTransactionsResult<TEntryPointVersion>>;
75
59
  //# sourceMappingURL=buildUserOperationFromTxs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildUserOperationFromTxs.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/buildUserOperationFromTxs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oCAAoC,CAAC;AAQ5C,OAAO,KAAK,EACV,0BAA0B,EAC1B,wCAAwC,EACxC,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAClG,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EAEb,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACvE,OAAO,CAAC,wCAAwC,CAAC,kBAAkB,CAAC,CAAC,CAkEvE"}
1
+ {"version":3,"file":"buildUserOperationFromTxs.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/buildUserOperationFromTxs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oCAAoC,CAAC;AAQ5C,OAAO,KAAK,EACV,0BAA0B,EAC1B,wCAAwC,EACxC,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAClG,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EAEb,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACvE,OAAO,CAAC,wCAAwC,CAAC,kBAAkB,CAAC,CAAC,CAkEvE"}
@@ -3,31 +3,31 @@ import type { SmartContractAccount } from "../../account/smartContractAccount.js
3
3
  import type { SendUserOperationParameters, UserOperationContext } from "./types";
4
4
  /**
5
5
  * This function verifies the eligibility of the connected account for gas sponsorship concerning the upcoming `UserOperation` (UO) that is intended to be sent.
6
- * Internally, this method invokes [`buildUserOperation`](./buildUserOperation.md), which navigates through the middleware pipeline, including the `PaymasterMiddleware`. Its purpose is to construct the UO struct meant for transmission to the bundler. Following the construction of the UO struct, this function verifies if the resulting structure contains a non-empty `paymasterAndData` field.
6
+ * Internally, this method invokes `buildUserOperation`, which navigates through the middleware pipeline, including the `PaymasterMiddleware`. Its purpose is to construct the UO struct meant for transmission to the bundler. Following the construction of the UO struct, this function verifies if the resulting structure contains a non-empty `paymasterAndData` field.
7
7
  * You can utilize this method before sending the user operation to confirm its eligibility for gas sponsorship. Depending on the outcome, it allows you to tailor the user experience accordingly, based on eligibility.
8
8
  *
9
9
  * @example
10
10
  * ```ts
11
11
  * import { smartAccountClient } from "./smartAccountClient";
12
- // [!code focus:99]
13
- const eligible = await smartAccountClient.checkGasSponsorshipEligibility({
14
- uo: {
15
- data: "0xCalldata",
16
- target: "0xTarget",
17
- value: 0n,
18
- },
19
- });
20
-
21
- console.log(
22
- `User Operation is ${
23
- eligible ? "eligible" : "ineligible"
24
- } for gas sponsorship.`
25
- );
12
+ * // [!code focus:99]
13
+ * const eligible = await smartAccountClient.checkGasSponsorshipEligibility({
14
+ * uo: {
15
+ * data: "0xCalldata",
16
+ * target: "0xTarget",
17
+ * value: 0n,
18
+ * },
19
+ * });
20
+ *
21
+ * console.log(
22
+ * `User Operation is ${
23
+ * eligible ? "eligible" : "ineligible"
24
+ * } for gas sponsorship.`
25
+ * );
26
26
  * ```
27
27
  *
28
- * @param client the smart account client to use for making RPC calls
29
- * @param args {@link SendUserOperationParameters} containing the user operation, account, context, and overrides
30
- * @returns a Promise containing a boolean indicating if the account is elgibile for sponsorship
28
+ * @param {Client<TTransport, TChain, TAccount>} client the smart account client to use for making RPC calls
29
+ * @param {SendUserOperationParameters} args containing the user operation, account, context, and overrides
30
+ * @returns {Promise<boolean>} a Promise containing a boolean indicating if the account is elgibile for sponsorship
31
31
  */
32
32
  export declare function checkGasSponsorshipEligibility<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(client: Client<TTransport, TChain, TAccount>, args: SendUserOperationParameters<TAccount, TContext>): Promise<boolean>;
33
33
  //# sourceMappingURL=checkGasSponsorshipEligibility.d.ts.map
@@ -2,5 +2,27 @@ import type { Chain, Client, Transport } from "viem";
2
2
  import type { GetEntryPointFromAccount, SmartContractAccount } from "../../account/smartContractAccount";
3
3
  import type { SendUserOperationResult } from "../../client/types";
4
4
  import type { DropAndReplaceUserOperationParameters, UserOperationContext } from "./types";
5
+ /**
6
+ * Drops an existing user operation and replaces it with a new one while ensuring the appropriate fees and overrides are applied.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import {
11
+ * createSmartAccountClient,
12
+ * } from "@aa-sdk/core";
13
+ *
14
+ * // smart account client is already extended with dropAndReplaceUserOperation
15
+ * const client = createSmartAccountClient(...);
16
+ * const { request } = await client.sendUserOperation(...);
17
+ * const result = await client.dropAndReplaceUserOperation({
18
+ * uoToDrop: request,
19
+ * account, // only required if the client above is not connected to an account
20
+ * });
21
+ * ```
22
+ *
23
+ * @param {Client<TTransport, TChain, TAccount>} client The client instance with the transport, chain, and account information
24
+ * @param {DropAndReplaceUserOperationParameters<TAccount, TContext>} args The parameters required for dropping and replacing the user operation including the account, operation to drop, overrides, and context
25
+ * @returns {Promise<SendUserOperationResult<TEntryPointVersion>>} A promise that resolves to the result of sending the new user operation
26
+ */
5
27
  export declare function dropAndReplaceUserOperation<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<TTransport, TChain, TAccount>, args: DropAndReplaceUserOperationParameters<TAccount, TContext>): Promise<SendUserOperationResult<TEntryPointVersion>>;
6
28
  //# sourceMappingURL=dropAndReplaceUserOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropAndReplaceUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/dropAndReplaceUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAWlE,OAAO,KAAK,EACV,qCAAqC,EACrC,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,wBAAsB,2BAA2B,CAC/C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,qCAAqC,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC9D,OAAO,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC,CA2EtD"}
1
+ {"version":3,"file":"dropAndReplaceUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/dropAndReplaceUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAWlE,OAAO,KAAK,EACV,qCAAqC,EACrC,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,2BAA2B,CAC/C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,qCAAqC,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC9D,OAAO,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC,CA2EtD"}
@@ -11,9 +11,9 @@ import type { SendUserOperationParameters, UserOperationContext } from "./types.
11
11
  * @template {SmartContractAccount | undefined} TAccount
12
12
  * @template {UserOperationContext | undefined} TContext
13
13
  * @template {GetEntryPointFromAccount<TAccount>} TEntryPointVersion
14
- * @param client smart account client
15
- * @param args send user operation parameters
16
- * @returns user operation gas estimate response
14
+ * @param {Client<TTransport, TChain, TAccount>} client smart account client
15
+ * @param {SendUserOperationParameters<TAccount, TContext>} args send user operation parameters
16
+ * @returns {Promise<UserOperationEstimateGasResponse<TEntryPointVersion>>}user operation gas estimate response
17
17
  */
18
18
  export declare function estimateUserOperationGas<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<TTransport, TChain, TAccount>, args: SendUserOperationParameters<TAccount, TContext>): Promise<UserOperationEstimateGasResponse<TEntryPointVersion>>;
19
19
  //# sourceMappingURL=estimateUserOperationGas.d.ts.map
@@ -8,15 +8,14 @@ import type { BuildUserOperationParameters, SendUserOperationParameters, UserOpe
8
8
  * Description internal action function of SmartAccountClient for initializing
9
9
  * a user operation for the sender account
10
10
  *
11
- * @async
12
11
  * @template {Transport} TTransport
13
12
  * @template {Chain | undefined} TChain
14
13
  * @template {SmartContractAccount | undefined} TAccount
15
14
  * @template {UserOperationContext | undefined} TContext
16
15
  * @template {GetEntryPointFromAccount} TEntryPointVersion
17
- * @param client smart account client
18
- * @param args send user operation parameters
19
- * @returns initialized user operation struct
16
+ * @param {BaseSmartAccountClient<TTransport, TChain, TAccount>} client smart account client
17
+ * @param {SendUserOperationParameters<TAccount, TContext, TEntryPointVersion> | BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>} args send user operation parameters
18
+ * @returns {Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>} initialized user operation struct
20
19
  */
21
20
  export declare function _initUserOperation<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: BaseSmartAccountClient<TTransport, TChain, TAccount>, args: SendUserOperationParameters<TAccount, TContext, TEntryPointVersion> | BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>): Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>;
22
21
  //# sourceMappingURL=initUserOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"initUserOperation.d.ts","sourceRoot":"","sources":["../../../../../src/actions/smartAccount/internal/initUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAGpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5D,IAAI,EACA,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACnE,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACvE,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CA+C9D"}
1
+ {"version":3,"file":"initUserOperation.d.ts","sourceRoot":"","sources":["../../../../../src/actions/smartAccount/internal/initUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAGpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5D,IAAI,EACA,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACnE,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACvE,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CA+C9D"}
@@ -4,20 +4,6 @@ import type { BaseSmartAccountClient } from "../../../client/smartAccountClient"
4
4
  import type { UserOperationOverridesParameter, UserOperationStruct } from "../../../types";
5
5
  import { type Deferrable } from "../../../utils/index.js";
6
6
  import type { UserOperationContext } from "../types";
7
- /**
8
- * Internal method of {@link SmartAccountClient} running the middleware stack for a user operation
9
- *
10
- * @async
11
- * @template TTransport
12
- * @template TChain
13
- * @template TAccount
14
- * @template TContext the {@link UserOperationContext} passed to the middleware
15
- * @template TEntryPointVersion
16
- * @param client the smart account client instance that runs the middleware pipeline with
17
- * @param args the Deferrable {@link UserOperationStruct} to run the middleware pipeline on
18
- *
19
- * @returns the resolved {@link UserOperationStruct} after running the middleware pipeline
20
- */
21
7
  export declare function _runMiddlewareStack<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: BaseSmartAccountClient<TTransport, TChain, TAccount>, args: {
22
8
  uo: Deferrable<UserOperationStruct<TEntryPointVersion>>;
23
9
  context?: TContext;