@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
@@ -3,11 +3,30 @@ import { applyUserOpOverrideOrFeeOption } from "../../utils/index.js";
3
3
  import type { MiddlewareClient } from "../actions";
4
4
  import type { ClientMiddlewareFn } from "../types";
5
5
 
6
- export const defaultFeeEstimator: <C extends MiddlewareClient>(
6
+ /**
7
+ * 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.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import { createSmartAccountClient, defaultFeeEstimator, createBundlerClient } from "@aa-sdk/core";
12
+ *
13
+ * const bundlerClient = createBundlerClient(...);
14
+ *
15
+ * // NOTE: this is already provided by the smart account client
16
+ * const client = createSmartAccountClient({
17
+ * feeEstimator: defaultFeeEstimator(bundlerClient),
18
+ * ...otherParams
19
+ * });
20
+ * ```
21
+ *
22
+ * @template {MiddlewareClient} C The type of the client
23
+ * @param {C} client The client to perform the fee estimation
24
+ * @returns {ClientMiddlewareFn} A middleware function that takes in the struct and options, estimates the fees, and updates the struct with the estimated fees
25
+ */
26
+ export function defaultFeeEstimator<C extends MiddlewareClient>(
7
27
  client: C
8
- ) => ClientMiddlewareFn =
9
- (client) =>
10
- async (struct, { overrides, feeOptions }) => {
28
+ ): ClientMiddlewareFn {
29
+ return async (struct, { overrides, feeOptions }) => {
11
30
  // maxFeePerGas must be at least the sum of maxPriorityFeePerGas and baseFee
12
31
  // so we need to accommodate for the fee option applied maxPriorityFeePerGas for the maxFeePerGas
13
32
  //
@@ -48,3 +67,4 @@ export const defaultFeeEstimator: <C extends MiddlewareClient>(
48
67
  struct.maxPriorityFeePerGas = maxPriorityFeePerGas;
49
68
  return struct;
50
69
  };
70
+ }
@@ -13,13 +13,13 @@ import type { ClientMiddlewareFn } from "../types.js";
13
13
  * You can override this middleware with your custom gas estimator middleware
14
14
  * by passing it to the client constructor
15
15
  *
16
- * @param client smart account client instance to apply the middleware to
17
- * @returns middleware execution function used to estimate gas for user operations
16
+ * @param {MiddlewareClient} client smart account client instance to apply the middleware to
17
+ * @returns {ClientMiddlewareFn} middleware execution function used to estimate gas for user operations
18
18
  */
19
19
  export const defaultGasEstimator: <C extends MiddlewareClient>(
20
20
  client: C
21
21
  ) => ClientMiddlewareFn =
22
- (client) =>
22
+ (client: MiddlewareClient): ClientMiddlewareFn =>
23
23
  async (struct, { account, overrides, feeOptions }) => {
24
24
  const request = deepHexlify(await resolveProperties(struct));
25
25
 
@@ -58,8 +58,12 @@ export const defaultGasEstimator: <C extends MiddlewareClient>(
58
58
  (feeOptions as UserOperationFeeOptions<"0.7.0">)
59
59
  ?.paymasterVerificationGasLimit
60
60
  );
61
- (struct as UserOperationStruct<"0.7.0">).paymasterVerificationGasLimit =
62
- paymasterVerificationGasLimit;
61
+ const uo_v7 = struct as UserOperationStruct<"0.7.0">;
62
+
63
+ uo_v7.paymasterVerificationGasLimit = paymasterVerificationGasLimit;
64
+
65
+ uo_v7.paymasterPostOpGasLimit =
66
+ uo_v7.paymasterPostOpGasLimit ?? (uo_v7.paymaster ? "0x0" : undefined);
63
67
  }
64
68
 
65
69
  return struct;
@@ -1,6 +1,14 @@
1
1
  import type { UserOperationStruct } from "../../types";
2
2
  import type { ClientMiddlewareFn } from "../types";
3
3
 
4
+ /**
5
+ * Middleware function that sets the `paymasterAndData` field in the given struct based on the entry point version of the account.
6
+ * This is the default used by `createSmartAccountClient` and is not necessary to be used directly.
7
+ *
8
+ * @param {UserOperationStruct} struct the user operation structure to be modified
9
+ * @param {{ account: Account }} context an object containing the account information
10
+ * @returns {Promise<UserOperationStruct>} a promise that resolves to the modified user operation structure
11
+ */
4
12
  export const defaultPaymasterAndData: ClientMiddlewareFn = async (
5
13
  struct,
6
14
  { account }
@@ -8,6 +8,16 @@ import {
8
8
  } from "../../utils/index.js";
9
9
  import type { ClientMiddlewareFn } from "../types";
10
10
 
11
+ /**
12
+ * Provides a default middleware function for signing user operations with a client account. This function validates the request and adds the signature to it.
13
+ * This is already included in the client returned from `createSmartAccountClient`
14
+ *
15
+ * @param {UserOperationStruct} struct The user operation structure to be signed
16
+ * @param {*} context The middleware context containing the client and account information
17
+ * @param {Client} context.client The client object, which should include account and chain information
18
+ * @param {Account} [context.account] Optional, the account used for signing, defaults to the client's account if not provided
19
+ * @returns {Promise<UserOperationStruct>} A promise that resolves to the signed user operation structure
20
+ */
11
21
  export const defaultUserOpSigner: ClientMiddlewareFn = async (
12
22
  struct,
13
23
  { client, account = client.account }
@@ -0,0 +1,201 @@
1
+ import {
2
+ toHex,
3
+ type Address,
4
+ type Chain,
5
+ type Client,
6
+ type Hex,
7
+ type Transport,
8
+ } from "viem";
9
+ import type { ClientMiddlewareConfig } from "../client/types";
10
+ import type { EntryPointVersion } from "../entrypoint/types";
11
+ import { ChainNotFoundError } from "../errors/client.js";
12
+ import type {
13
+ UserOperationFeeOptions,
14
+ UserOperationOverrides,
15
+ UserOperationRequest,
16
+ UserOperationStruct,
17
+ } from "../types";
18
+ import {
19
+ deepHexlify,
20
+ resolveProperties,
21
+ type Deferrable,
22
+ } from "../utils/index.js";
23
+ import type { ClientMiddlewareFn } from "./types";
24
+
25
+ export type Erc7677RpcSchema = [
26
+ {
27
+ Method: "pm_getPaymasterStubData";
28
+ Parameters: [UserOperationRequest, Address, Hex, Record<string, any>];
29
+ ReturnType: {
30
+ sponsor?: { name: string; icon?: string }; // Sponsor info
31
+ paymaster?: Address; // Paymaster address (entrypoint v0.7)
32
+ paymasterData?: Hex; // Paymaster data (entrypoint v0.7)
33
+ paymasterVerificationGasLimit?: Hex; // Paymaster validation gas (entrypoint v0.7)
34
+ paymasterPostOpGasLimit?: Hex; // Paymaster post-op gas (entrypoint v0.7)
35
+ paymasterAndData?: Hex; // Paymaster and data (entrypoint v0.6)
36
+ isFinal?: boolean; // Indicates that the caller does not need to call pm_getPaymasterData
37
+ };
38
+ },
39
+ {
40
+ Method: "pm_getPaymasterData";
41
+ Parameters: [UserOperationRequest, Address, Hex, Record<string, any>];
42
+ ReturnType: {
43
+ paymaster?: Address; // Paymaster address (entrypoint v0.7)
44
+ paymasterData?: Hex; // Paymaster data (entrypoint v0.7)
45
+ paymasterAndData?: Hex; // Paymaster and data (entrypoint v0.6)
46
+ };
47
+ }
48
+ ];
49
+
50
+ export type Erc7677Client<T extends Transport = Transport> = Client<
51
+ T,
52
+ Chain,
53
+ undefined,
54
+ Erc7677RpcSchema
55
+ >;
56
+
57
+ export type Erc7677MiddlewareParams<
58
+ TContext extends Record<string, any> | undefined =
59
+ | Record<string, any>
60
+ | undefined,
61
+ TEntryPointVersion extends EntryPointVersion = EntryPointVersion
62
+ > = {
63
+ context?:
64
+ | ((
65
+ struct: Deferrable<UserOperationStruct<TEntryPointVersion>>,
66
+ args: {
67
+ overrides?: UserOperationOverrides<TEntryPointVersion>;
68
+ feeOptions?: UserOperationFeeOptions;
69
+ }
70
+ ) => Promise<TContext>)
71
+ | TContext;
72
+ };
73
+
74
+ /**
75
+ * Middleware function for interacting with ERC-7677 enabled clients. It supports resolving paymaster and data fields for user operations.
76
+ * This middleware assumes that your RPC provider supports the ERC-7677 methods (pm_getPaymasterStubData and pm_getPaymasterData).
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * import { createSmartAccountClient, erc7677Middleware } from "@aa-sdk/core";
81
+ * import { http } from "viem";
82
+ * import { sepolia } from "viem/chains";
83
+ *
84
+ * const client = createSmartAccountClient({
85
+ * transport: http("rpc-url"),
86
+ * chain: sepolia,
87
+ * // this assumes that your RPC provider supports the ERC-7677 methods AND takes no context
88
+ * ...erc7677Middleware(),
89
+ * })
90
+ * ```
91
+ *
92
+ * @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
93
+ * @returns {Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">} An object containing middleware functions `dummyPaymasterAndData` and `paymasterAndData` for processing user operations with the paymaster data
94
+ */
95
+ export function erc7677Middleware<
96
+ TContext extends Record<string, any> | undefined =
97
+ | Record<string, any>
98
+ | undefined
99
+ >(
100
+ params?: Erc7677MiddlewareParams<TContext>
101
+ ): Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData"> {
102
+ const dummyPaymasterAndData: ClientMiddlewareFn = async (
103
+ uo,
104
+ { client, account, feeOptions, overrides }
105
+ ) => {
106
+ const userOp = deepHexlify(await resolveProperties(uo));
107
+
108
+ // Those values will be set after fee estimation.
109
+ userOp.maxFeePerGas = "0x0";
110
+ userOp.maxPriorityFeePerGas = "0x0";
111
+ userOp.callGasLimit = "0x0";
112
+ userOp.verificationGasLimit = "0x0";
113
+ userOp.preVerificationGas = "0x0";
114
+
115
+ const entrypoint = account.getEntryPoint();
116
+
117
+ if (entrypoint.version === "0.7.0") {
118
+ userOp.paymasterVerificationGasLimit = "0x0";
119
+ userOp.paymasterPostOpGasLimit = "0x0";
120
+ }
121
+
122
+ const context =
123
+ (typeof params?.context === "function"
124
+ ? await params?.context(userOp, { overrides, feeOptions })
125
+ : params?.context) ?? {};
126
+
127
+ if (!client.chain) {
128
+ throw new ChainNotFoundError();
129
+ }
130
+
131
+ const erc7677client = client as Erc7677Client;
132
+ // TODO: probably need to handle the sponsor and isFinal fields
133
+ const {
134
+ paymaster,
135
+ paymasterAndData,
136
+ paymasterData,
137
+ paymasterPostOpGasLimit,
138
+ paymasterVerificationGasLimit,
139
+ } = await erc7677client.request({
140
+ method: "pm_getPaymasterStubData",
141
+ params: [userOp, entrypoint.address, toHex(client.chain.id), context],
142
+ });
143
+
144
+ if (entrypoint.version === "0.6.0") {
145
+ return {
146
+ ...uo,
147
+ paymasterAndData,
148
+ };
149
+ }
150
+
151
+ return {
152
+ ...uo,
153
+ paymaster,
154
+ paymasterData,
155
+ paymasterPostOpGasLimit,
156
+ paymasterVerificationGasLimit,
157
+ };
158
+ };
159
+
160
+ const paymasterAndData: ClientMiddlewareFn = async (
161
+ uo,
162
+ { client, account, feeOptions, overrides }
163
+ ) => {
164
+ const userOp = deepHexlify(await resolveProperties(uo));
165
+ const context =
166
+ (typeof params?.context === "function"
167
+ ? await params?.context(userOp, { overrides, feeOptions })
168
+ : params?.context) ?? {};
169
+
170
+ if (!client.chain) {
171
+ throw new ChainNotFoundError();
172
+ }
173
+
174
+ const erc7677client = client as Erc7677Client;
175
+
176
+ const entrypoint = account.getEntryPoint();
177
+ const { paymaster, paymasterAndData, paymasterData } =
178
+ await erc7677client.request({
179
+ method: "pm_getPaymasterData",
180
+ params: [userOp, entrypoint.address, toHex(client.chain.id), context],
181
+ });
182
+
183
+ if (entrypoint.version === "0.6.0") {
184
+ return {
185
+ ...uo,
186
+ paymasterAndData,
187
+ };
188
+ }
189
+
190
+ return {
191
+ ...uo,
192
+ paymaster,
193
+ paymasterData,
194
+ };
195
+ };
196
+
197
+ return {
198
+ dummyPaymasterAndData,
199
+ paymasterAndData,
200
+ };
201
+ }
@@ -1,12 +1,14 @@
1
+ import type { UserOperationContext } from "../actions/smartAccount/types";
1
2
  import type { ClientMiddlewareFn } from "./types";
2
3
 
3
4
  /**
4
5
  * Noop middleware that does nothing and passes the arguments through
5
6
  *
6
- * @async
7
- * @param args the client middleware arguments passed to the middleware
8
- * @returns the arguments passed to the middleware and returned as is without modification
7
+ * @param {Deferrable<UserOperationStruct<TEntryPointVersion>>} args the client middleware arguments passed to the middleware
8
+ * @returns {Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>} the arguments passed to the middleware and returned as is without modification
9
9
  */
10
- export const noopMiddleware: ClientMiddlewareFn = async (args) => {
10
+ export const noopMiddleware: ClientMiddlewareFn<
11
+ UserOperationContext | undefined
12
+ > = async (args) => {
11
13
  return args;
12
14
  };
@@ -11,6 +11,21 @@ import type {
11
11
  import type { Deferrable } from "../utils";
12
12
  import type { MiddlewareClient } from "./actions";
13
13
 
14
+ export type ClientMiddlewareArgs<
15
+ TAccount extends SmartContractAccount,
16
+ C extends MiddlewareClient,
17
+ TContext extends UserOperationContext | undefined =
18
+ | UserOperationContext
19
+ | undefined,
20
+ TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
21
+ > = {
22
+ overrides?: UserOperationOverrides<TEntryPointVersion>;
23
+ context?: TContext;
24
+ feeOptions?: UserOperationFeeOptions;
25
+ account: TAccount;
26
+ client: C;
27
+ };
28
+
14
29
  // [!region ClientMiddlewareFn]
15
30
  export type ClientMiddlewareFn<
16
31
  TContext extends UserOperationContext | undefined =
@@ -22,13 +37,7 @@ export type ClientMiddlewareFn<
22
37
  TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
23
38
  >(
24
39
  struct: Deferrable<UserOperationStruct<TEntryPointVersion>>,
25
- args: {
26
- overrides?: UserOperationOverrides<TEntryPointVersion>;
27
- context?: TContext;
28
- feeOptions?: UserOperationFeeOptions;
29
- account: TAccount;
30
- client: C;
31
- }
40
+ args: ClientMiddlewareArgs<TAccount, C, TContext, TEntryPointVersion>
32
41
  ) => Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>;
33
42
  // [!endregion ClientMiddlewareFn]
34
43
 
@@ -11,6 +11,9 @@ import {
11
11
  import { mnemonicToAccount, privateKeyToAccount } from "viem/accounts";
12
12
  import type { SmartAccountSigner } from "./types.js";
13
13
 
14
+ /**
15
+ * Represents a local account signer and provides methods to sign messages and transactions, as well as static methods to create the signer from mnemonic or private key.
16
+ */
14
17
  export class LocalAccountSigner<
15
18
  T extends HDAccount | PrivateKeyAccount | LocalAccount
16
19
  > implements SmartAccountSigner<T>
@@ -18,17 +21,67 @@ export class LocalAccountSigner<
18
21
  inner: T;
19
22
  signerType: string;
20
23
 
24
+ /**
25
+ * A function to initialize an object with an inner parameter and derive a signerType from it.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * import { LocalAccountSigner } from "@aa-sdk/core";
30
+ * import { privateKeyToAccount, generatePrivateKey } from "viem";
31
+ *
32
+ * const signer = new LocalAccountSigner(
33
+ * privateKeyToAccount(generatePrivateKey()),
34
+ * );
35
+ * ```
36
+ *
37
+ * @param {T} inner The inner parameter containing the necessary data
38
+ */
21
39
  constructor(inner: T) {
22
40
  this.inner = inner;
23
41
  this.signerType = inner.type; // type: "local"
24
42
  }
25
43
 
44
+ /**
45
+ * Signs the provided message using the inner signMessage function.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * import { LocalAccountSigner } from "@aa-sdk/core";
50
+ * import { generatePrivateKey } from "viem";
51
+ *
52
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
53
+ * const signature = await signer.signMessage("Hello, world!");
54
+ * ```
55
+ *
56
+ * @param {string} message The message to be signed
57
+ * @returns {Promise<any>} A promise that resolves to the signed message
58
+ */
26
59
  readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> = (
27
60
  message
28
61
  ) => {
29
62
  return this.inner.signMessage({ message });
30
63
  };
31
64
 
65
+ /**
66
+ * Signs typed data using the given parameters.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * import { LocalAccountSigner } from "@aa-sdk/core";
71
+ * import { generatePrivateKey } from "viem";
72
+ *
73
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
74
+ * const signature = await signer.signTypedData({
75
+ * domain: {},
76
+ * types: {},
77
+ * primaryType: "",
78
+ * message: {},
79
+ * });
80
+ * ```
81
+ *
82
+ * @param {TypedDataDefinition<TTypedData, TPrimaryType>} params The parameters defining the typed data and primary type
83
+ * @returns {Promise<Hex>} A promise that resolves to the signed data in hexadecimal format
84
+ */
32
85
  readonly signTypedData = async <
33
86
  const TTypedData extends TypedData | { [key: string]: unknown },
34
87
  TPrimaryType extends string = string
@@ -38,10 +91,39 @@ export class LocalAccountSigner<
38
91
  return this.inner.signTypedData(params);
39
92
  };
40
93
 
41
- readonly getAddress: () => Promise<`0x${string}`> = async () => {
94
+ /**
95
+ * Returns the address of the inner object in a specific hexadecimal format.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * import { LocalAccountSigner } from "@aa-sdk/core";
100
+ * import { generatePrivateKey } from "viem";
101
+ *
102
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
103
+ * const address = await signer.getAddress();
104
+ * ```
105
+ *
106
+ * @returns {Promise<Hex>} A promise that resolves to the address in the format `0x{string}`
107
+ */
108
+ readonly getAddress = async (): Promise<`0x${string}`> => {
42
109
  return this.inner.address;
43
110
  };
44
111
 
112
+ /**
113
+ * Creates a LocalAccountSigner using the provided mnemonic key and optional HD options.
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * import { LocalAccountSigner } from "@aa-sdk/core";
118
+ * import { generateMnemonic } from "viem";
119
+ *
120
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generateMnemonic());
121
+ * ```
122
+ *
123
+ * @param {string} key The mnemonic key to derive the account from.
124
+ * @param {HDOptions} [opts] Optional HD options for deriving the account.
125
+ * @returns {LocalAccountSigner<HDAccount>} A LocalAccountSigner object for the derived account.
126
+ */
45
127
  static mnemonicToAccountSigner(
46
128
  key: string,
47
129
  opts?: HDOptions
@@ -50,7 +132,20 @@ export class LocalAccountSigner<
50
132
  return new LocalAccountSigner(signer);
51
133
  }
52
134
 
53
- static privateKeyToAccountSigner(
135
+ /**
136
+ * Creates a `LocalAccountSigner` instance using the provided private key.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * import { LocalAccountSigner } from "@aa-sdk/core";
141
+ * import { generatePrivateKey } from "viem";
142
+ *
143
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
144
+ * ```
145
+ *
146
+ * @param {Hex} key The private key in hexadecimal format
147
+ * @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key
148
+ */ static privateKeyToAccountSigner(
54
149
  key: Hex
55
150
  ): LocalAccountSigner<PrivateKeyAccount> {
56
151
  const signer = privateKeyToAccount(key);
@@ -1,6 +1,20 @@
1
1
  import { z } from "zod";
2
2
  import type { SmartAccountSigner } from "./types";
3
3
 
4
+ /**
5
+ * Checks if the provided object is a `SmartAccountSigner`.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { isSigner, LocalAccountSigner } from "@aa-sdk/core";
10
+ *
11
+ * const signer = new LocalAccountSigner(...);
12
+ * console.log(isSigner(signer)); // true
13
+ * ```
14
+ *
15
+ * @param {any} signer the object to check
16
+ * @returns {boolean} A boolean indicating whether the object is a `SmartAccountSigner`
17
+ */
4
18
  export const isSigner = (signer: any): signer is SmartAccountSigner => {
5
19
  return (
6
20
  signer != null &&
@@ -5,7 +5,6 @@ import {
5
5
  type Address,
6
6
  type Hash,
7
7
  type Hex,
8
- type PublicClient,
9
8
  } from "viem";
10
9
 
11
10
  export type SignWith6492Params = {
@@ -14,13 +13,26 @@ export type SignWith6492Params = {
14
13
  signature: Hash;
15
14
  };
16
15
 
17
- type VerifyEIP6492SignatureParams = {
18
- signer: Address;
19
- hash: Hash;
20
- signature: Hash;
21
- client: PublicClient;
22
- };
23
-
16
+ /**
17
+ * Wraps a given signature with additional data following the EIP-6492 standard.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * import { wrapSignatureWith6492 } from "@aa-sdk/core";
22
+ *
23
+ * const signature = wrapSignatureWith6492({
24
+ * factoryAddress: "0x...",
25
+ * factoryCalldata: "0x...",
26
+ * signature: "0x...",
27
+ * });
28
+ * ```
29
+ *
30
+ * @param {SignWith6492Params} params The parameters to wrap the signature
31
+ * @param {Hex} params.factoryAddress The address of the factory
32
+ * @param {Hex} params.factoryCalldata The calldata for the factory
33
+ * @param {Hex} params.signature The original signature that needs to be wrapped
34
+ * @returns {Hash} The wrapped signature
35
+ */
24
36
  export const wrapSignatureWith6492 = ({
25
37
  factoryAddress,
26
38
  factoryCalldata,
@@ -42,27 +54,3 @@ export const wrapSignatureWith6492 = ({
42
54
  "0x6492649264926492649264926492649264926492649264926492649264926492",
43
55
  ]);
44
56
  };
45
-
46
- // defined in https://github.com/AmbireTech/signature-validator/blob/main/index.ts#L13C17-L13C17
47
- const universalValidatorByteCode =
48
- "0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
49
-
50
- export const verifyEIP6492Signature = async ({
51
- signer,
52
- hash,
53
- signature,
54
- client,
55
- }: VerifyEIP6492SignatureParams): Promise<boolean> => {
56
- const result = await client.call({
57
- data: concat([
58
- universalValidatorByteCode,
59
- encodeAbiParameters(parseAbiParameters("address, bytes32, bytes"), [
60
- signer,
61
- hash,
62
- signature,
63
- ]),
64
- ]),
65
- });
66
-
67
- return result.data === "0x01";
68
- };