@aa-sdk/core 4.0.0-alpha.9 → 4.0.0-beta.1

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 (425) hide show
  1. package/dist/esm/abis/EntryPointAbi_v7.js +1 -0
  2. package/dist/esm/abis/EntryPointAbi_v7.js.map +1 -1
  3. package/dist/esm/account/smartContractAccount.d.ts +50 -1
  4. package/dist/esm/account/smartContractAccount.js +111 -2
  5. package/dist/esm/account/smartContractAccount.js.map +1 -1
  6. package/dist/esm/actions/smartAccount/buildUserOperation.d.ts +23 -0
  7. package/dist/esm/actions/smartAccount/buildUserOperation.js +23 -0
  8. package/dist/esm/actions/smartAccount/buildUserOperation.js.map +1 -1
  9. package/dist/esm/actions/smartAccount/buildUserOperationFromTx.d.ts +39 -0
  10. package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js +39 -0
  11. package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
  12. package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.d.ts +54 -0
  13. package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js +55 -0
  14. package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
  15. package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +28 -0
  16. package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js +28 -0
  17. package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
  18. package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.d.ts +22 -0
  19. package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js +27 -6
  20. package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
  21. package/dist/esm/actions/smartAccount/estimateUserOperationGas.d.ts +13 -0
  22. package/dist/esm/actions/smartAccount/estimateUserOperationGas.js +13 -0
  23. package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
  24. package/dist/esm/actions/smartAccount/internal/initUserOperation.d.ts +13 -0
  25. package/dist/esm/actions/smartAccount/internal/initUserOperation.js +14 -1
  26. package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
  27. package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js +2 -1
  28. package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
  29. package/dist/esm/actions/smartAccount/sendTransaction.d.ts +24 -0
  30. package/dist/esm/actions/smartAccount/sendTransaction.js +24 -0
  31. package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -1
  32. package/dist/esm/actions/smartAccount/sendTransactions.d.ts +23 -0
  33. package/dist/esm/actions/smartAccount/sendTransactions.js +23 -0
  34. package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -1
  35. package/dist/esm/actions/smartAccount/sendUserOperation.d.ts +21 -0
  36. package/dist/esm/actions/smartAccount/sendUserOperation.js +21 -0
  37. package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
  38. package/dist/esm/actions/smartAccount/types.d.ts +14 -0
  39. package/dist/esm/actions/smartAccount/types.js +1 -0
  40. package/dist/esm/actions/smartAccount/types.js.map +1 -1
  41. package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.d.ts +24 -0
  42. package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js +24 -0
  43. package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
  44. package/dist/esm/client/bundlerClient.d.ts +21 -0
  45. package/dist/esm/client/bundlerClient.js +32 -0
  46. package/dist/esm/client/bundlerClient.js.map +1 -1
  47. package/dist/esm/client/decorators/bundlerClient.d.ts +41 -0
  48. package/dist/esm/client/decorators/bundlerClient.js +10 -0
  49. package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
  50. package/dist/esm/client/decorators/smartAccountClient.d.ts +8 -0
  51. package/dist/esm/client/decorators/smartAccountClient.js +12 -1
  52. package/dist/esm/client/decorators/smartAccountClient.js.map +1 -1
  53. package/dist/esm/client/isSmartAccountClient.d.ts +16 -0
  54. package/dist/esm/client/isSmartAccountClient.js +16 -0
  55. package/dist/esm/client/isSmartAccountClient.js.map +1 -1
  56. package/dist/esm/client/schema.d.ts +12 -0
  57. package/dist/esm/client/schema.js +14 -0
  58. package/dist/esm/client/schema.js.map +1 -1
  59. package/dist/esm/client/smartAccountClient.js +53 -0
  60. package/dist/esm/client/smartAccountClient.js.map +1 -1
  61. package/dist/esm/client/types.js +1 -0
  62. package/dist/esm/client/types.js.map +1 -1
  63. package/dist/esm/ens/utils.d.ts +45 -0
  64. package/dist/esm/ens/utils.js +49 -0
  65. package/dist/esm/ens/utils.js.map +1 -1
  66. package/dist/esm/entrypoint/index.d.ts +14 -0
  67. package/dist/esm/entrypoint/index.js +30 -0
  68. package/dist/esm/entrypoint/index.js.map +1 -1
  69. package/dist/esm/entrypoint/types.d.ts +17 -0
  70. package/dist/esm/errors/account.d.ts +87 -4
  71. package/dist/esm/errors/account.js +88 -4
  72. package/dist/esm/errors/account.js.map +1 -1
  73. package/dist/esm/errors/base.d.ts +5 -0
  74. package/dist/esm/errors/base.js +5 -0
  75. package/dist/esm/errors/base.js.map +1 -1
  76. package/dist/esm/errors/client.d.ts +24 -0
  77. package/dist/esm/errors/client.js +24 -0
  78. package/dist/esm/errors/client.js.map +1 -1
  79. package/dist/esm/errors/entrypoint.d.ts +18 -0
  80. package/dist/esm/errors/entrypoint.js +18 -0
  81. package/dist/esm/errors/entrypoint.js.map +1 -1
  82. package/dist/esm/errors/signer.d.ts +8 -0
  83. package/dist/esm/errors/signer.js +8 -0
  84. package/dist/esm/errors/signer.js.map +1 -1
  85. package/dist/esm/errors/transaction.d.ts +14 -1
  86. package/dist/esm/errors/transaction.js +14 -1
  87. package/dist/esm/errors/transaction.js.map +1 -1
  88. package/dist/esm/errors/useroperation.d.ts +25 -0
  89. package/dist/esm/errors/useroperation.js +26 -0
  90. package/dist/esm/errors/useroperation.js.map +1 -1
  91. package/dist/esm/index.d.ts +0 -1
  92. package/dist/esm/index.js +0 -1
  93. package/dist/esm/index.js.map +1 -1
  94. package/dist/esm/logger.d.ts +91 -0
  95. package/dist/esm/logger.js +91 -0
  96. package/dist/esm/logger.js.map +1 -1
  97. package/dist/esm/middleware/actions.d.ts +14 -0
  98. package/dist/esm/middleware/actions.js +7 -0
  99. package/dist/esm/middleware/actions.js.map +1 -1
  100. package/dist/esm/middleware/defaults/feeEstimator.d.ts +20 -0
  101. package/dist/esm/middleware/defaults/feeEstimator.js +28 -0
  102. package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -1
  103. package/dist/esm/middleware/defaults/gasEstimator.d.ts +8 -0
  104. package/dist/esm/middleware/defaults/gasEstimator.js +8 -0
  105. package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
  106. package/dist/esm/middleware/defaults/paymasterAndData.d.ts +8 -0
  107. package/dist/esm/middleware/defaults/paymasterAndData.js +8 -0
  108. package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -1
  109. package/dist/esm/middleware/defaults/userOpSigner.d.ts +10 -0
  110. package/dist/esm/middleware/defaults/userOpSigner.js +10 -0
  111. package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -1
  112. package/dist/esm/middleware/erc7677middleware.d.ts +21 -0
  113. package/dist/esm/middleware/erc7677middleware.js +23 -0
  114. package/dist/esm/middleware/erc7677middleware.js.map +1 -1
  115. package/dist/esm/middleware/noopMiddleware.d.ts +6 -0
  116. package/dist/esm/middleware/noopMiddleware.js +6 -0
  117. package/dist/esm/middleware/noopMiddleware.js.map +1 -1
  118. package/dist/esm/middleware/types.js +1 -0
  119. package/dist/esm/middleware/types.js.map +1 -1
  120. package/dist/esm/signer/local-account.d.ts +98 -5
  121. package/dist/esm/signer/local-account.js +97 -2
  122. package/dist/esm/signer/local-account.js.map +1 -1
  123. package/dist/esm/signer/schema.d.ts +14 -0
  124. package/dist/esm/signer/schema.js +14 -0
  125. package/dist/esm/signer/schema.js.map +1 -1
  126. package/dist/esm/signer/types.d.ts +13 -3
  127. package/dist/esm/signer/types.js +1 -0
  128. package/dist/esm/signer/types.js.map +1 -1
  129. package/dist/esm/signer/utils.d.ts +20 -0
  130. package/dist/esm/signer/utils.js +27 -0
  131. package/dist/esm/signer/utils.js.map +1 -1
  132. package/dist/esm/signer/wallet-client.d.ts +94 -4
  133. package/dist/esm/signer/wallet-client.js +95 -2
  134. package/dist/esm/signer/wallet-client.js.map +1 -1
  135. package/dist/esm/transport/split.d.ts +32 -0
  136. package/dist/esm/transport/split.js +32 -0
  137. package/dist/esm/transport/split.js.map +1 -1
  138. package/dist/esm/types.d.ts +17 -0
  139. package/dist/esm/types.js +1 -0
  140. package/dist/esm/types.js.map +1 -1
  141. package/dist/esm/utils/bigint.d.ts +45 -0
  142. package/dist/esm/utils/bigint.js +46 -0
  143. package/dist/esm/utils/bigint.js.map +1 -1
  144. package/dist/esm/utils/bytes.d.ts +9 -0
  145. package/dist/esm/utils/bytes.js +10 -1
  146. package/dist/esm/utils/bytes.js.map +1 -1
  147. package/dist/esm/utils/index.d.ts +86 -0
  148. package/dist/esm/utils/index.js +86 -0
  149. package/dist/esm/utils/index.js.map +1 -1
  150. package/dist/esm/utils/schema.d.ts +3 -0
  151. package/dist/esm/utils/schema.js +9 -0
  152. package/dist/esm/utils/schema.js.map +1 -1
  153. package/dist/esm/utils/stateOverride.js +2 -0
  154. package/dist/esm/utils/stateOverride.js.map +1 -1
  155. package/dist/esm/utils/types.d.ts +22 -0
  156. package/dist/esm/utils/types.js +1 -0
  157. package/dist/esm/utils/types.js.map +1 -1
  158. package/dist/esm/utils/userop.d.ts +79 -0
  159. package/dist/esm/utils/userop.js +83 -0
  160. package/dist/esm/utils/userop.js.map +1 -1
  161. package/dist/esm/version.d.ts +1 -1
  162. package/dist/esm/version.js +3 -1
  163. package/dist/esm/version.js.map +1 -1
  164. package/dist/types/account/smartContractAccount.d.ts +1 -1
  165. package/dist/types/account/smartContractAccount.d.ts.map +1 -1
  166. package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -1
  167. package/dist/types/client/smartAccountClient.d.ts.map +1 -1
  168. package/dist/types/index.d.ts +0 -1
  169. package/dist/types/index.d.ts.map +1 -1
  170. package/dist/types/signer/local-account.d.ts +2 -4
  171. package/dist/types/signer/local-account.d.ts.map +1 -1
  172. package/dist/types/signer/types.d.ts +1 -3
  173. package/dist/types/signer/types.d.ts.map +1 -1
  174. package/dist/types/signer/wallet-client.d.ts +2 -4
  175. package/dist/types/signer/wallet-client.d.ts.map +1 -1
  176. package/dist/types/transport/split.d.ts +1 -1
  177. package/dist/types/version.d.ts +1 -1
  178. package/dist/types/version.d.ts.map +1 -1
  179. package/package.json +9 -11
  180. package/src/account/smartContractAccount.ts +3 -3
  181. package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +10 -10
  182. package/src/actions/smartAccount/internal/initUserOperation.ts +1 -1
  183. package/src/client/smartAccountClient.ts +7 -0
  184. package/src/index.ts +0 -1
  185. package/src/signer/local-account.ts +2 -2
  186. package/src/signer/types.ts +2 -2
  187. package/src/signer/wallet-client.ts +8 -4
  188. package/src/transport/split.ts +1 -1
  189. package/src/version.ts +1 -1
  190. package/dist/cjs/abis/EntryPointAbi_v6.d.ts +0 -1018
  191. package/dist/cjs/abis/EntryPointAbi_v6.js +0 -1313
  192. package/dist/cjs/abis/EntryPointAbi_v6.js.map +0 -1
  193. package/dist/cjs/abis/EntryPointAbi_v7.d.ts +0 -775
  194. package/dist/cjs/abis/EntryPointAbi_v7.js +0 -661
  195. package/dist/cjs/abis/EntryPointAbi_v7.js.map +0 -1
  196. package/dist/cjs/abis/SimpleAccountAbi_v6.d.ts +0 -405
  197. package/dist/cjs/abis/SimpleAccountAbi_v6.js +0 -528
  198. package/dist/cjs/abis/SimpleAccountAbi_v6.js.map +0 -1
  199. package/dist/cjs/abis/SimpleAccountAbi_v7.d.ts +0 -410
  200. package/dist/cjs/abis/SimpleAccountAbi_v7.js +0 -538
  201. package/dist/cjs/abis/SimpleAccountAbi_v7.js.map +0 -1
  202. package/dist/cjs/abis/SimpleAccountFactoryAbi.d.ts +0 -55
  203. package/dist/cjs/abis/SimpleAccountFactoryAbi.js +0 -78
  204. package/dist/cjs/abis/SimpleAccountFactoryAbi.js.map +0 -1
  205. package/dist/cjs/account/smartContractAccount.d.ts +0 -74
  206. package/dist/cjs/account/smartContractAccount.js +0 -180
  207. package/dist/cjs/account/smartContractAccount.js.map +0 -1
  208. package/dist/cjs/actions/bundler/estimateUserOperationGas.d.ts +0 -8
  209. package/dist/cjs/actions/bundler/estimateUserOperationGas.js +0 -18
  210. package/dist/cjs/actions/bundler/estimateUserOperationGas.js.map +0 -1
  211. package/dist/cjs/actions/bundler/getSupportedEntryPoints.d.ts +0 -3
  212. package/dist/cjs/actions/bundler/getSupportedEntryPoints.js +0 -11
  213. package/dist/cjs/actions/bundler/getSupportedEntryPoints.js.map +0 -1
  214. package/dist/cjs/actions/bundler/getUserOperationByHash.d.ts +0 -6
  215. package/dist/cjs/actions/bundler/getUserOperationByHash.js +0 -11
  216. package/dist/cjs/actions/bundler/getUserOperationByHash.js.map +0 -1
  217. package/dist/cjs/actions/bundler/getUserOperationReceipt.d.ts +0 -6
  218. package/dist/cjs/actions/bundler/getUserOperationReceipt.js +0 -11
  219. package/dist/cjs/actions/bundler/getUserOperationReceipt.js.map +0 -1
  220. package/dist/cjs/actions/bundler/sendRawUserOperation.d.ts +0 -7
  221. package/dist/cjs/actions/bundler/sendRawUserOperation.js +0 -11
  222. package/dist/cjs/actions/bundler/sendRawUserOperation.js.map +0 -1
  223. package/dist/cjs/actions/smartAccount/buildUserOperation.d.ts +0 -5
  224. package/dist/cjs/actions/smartAccount/buildUserOperation.js +0 -25
  225. package/dist/cjs/actions/smartAccount/buildUserOperation.js.map +0 -1
  226. package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.d.ts +0 -5
  227. package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js +0 -39
  228. package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +0 -1
  229. package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.d.ts +0 -4
  230. package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js +0 -62
  231. package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +0 -1
  232. package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +0 -4
  233. package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js +0 -34
  234. package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +0 -1
  235. package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.d.ts +0 -5
  236. package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js +0 -64
  237. package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js.map +0 -1
  238. package/dist/cjs/actions/smartAccount/estimateUserOperationGas.d.ts +0 -5
  239. package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js +0 -23
  240. package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +0 -1
  241. package/dist/cjs/actions/smartAccount/getAddress.d.ts +0 -4
  242. package/dist/cjs/actions/smartAccount/getAddress.js +0 -13
  243. package/dist/cjs/actions/smartAccount/getAddress.js.map +0 -1
  244. package/dist/cjs/actions/smartAccount/internal/initUserOperation.d.ts +0 -7
  245. package/dist/cjs/actions/smartAccount/internal/initUserOperation.js +0 -42
  246. package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +0 -1
  247. package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.d.ts +0 -10
  248. package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js +0 -47
  249. package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +0 -1
  250. package/dist/cjs/actions/smartAccount/internal/sendUserOperation.d.ts +0 -10
  251. package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js +0 -28
  252. package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +0 -1
  253. package/dist/cjs/actions/smartAccount/sendTransaction.d.ts +0 -5
  254. package/dist/cjs/actions/smartAccount/sendTransaction.js +0 -35
  255. package/dist/cjs/actions/smartAccount/sendTransaction.js.map +0 -1
  256. package/dist/cjs/actions/smartAccount/sendTransactions.d.ts +0 -4
  257. package/dist/cjs/actions/smartAccount/sendTransactions.js +0 -36
  258. package/dist/cjs/actions/smartAccount/sendTransactions.js.map +0 -1
  259. package/dist/cjs/actions/smartAccount/sendUserOperation.d.ts +0 -5
  260. package/dist/cjs/actions/smartAccount/sendUserOperation.js +0 -31
  261. package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +0 -1
  262. package/dist/cjs/actions/smartAccount/signMessage.d.ts +0 -6
  263. package/dist/cjs/actions/smartAccount/signMessage.js +0 -12
  264. package/dist/cjs/actions/smartAccount/signMessage.js.map +0 -1
  265. package/dist/cjs/actions/smartAccount/signMessageWith6492.d.ts +0 -4
  266. package/dist/cjs/actions/smartAccount/signMessageWith6492.js +0 -12
  267. package/dist/cjs/actions/smartAccount/signMessageWith6492.js.map +0 -1
  268. package/dist/cjs/actions/smartAccount/signTypedData.d.ts +0 -10
  269. package/dist/cjs/actions/smartAccount/signTypedData.js +0 -12
  270. package/dist/cjs/actions/smartAccount/signTypedData.js.map +0 -1
  271. package/dist/cjs/actions/smartAccount/signTypedDataWith6492.d.ts +0 -6
  272. package/dist/cjs/actions/smartAccount/signTypedDataWith6492.js +0 -12
  273. package/dist/cjs/actions/smartAccount/signTypedDataWith6492.js.map +0 -1
  274. package/dist/cjs/actions/smartAccount/signUserOperation.d.ts +0 -5
  275. package/dist/cjs/actions/smartAccount/signUserOperation.js +0 -30
  276. package/dist/cjs/actions/smartAccount/signUserOperation.js.map +0 -1
  277. package/dist/cjs/actions/smartAccount/types.d.ts +0 -42
  278. package/dist/cjs/actions/smartAccount/types.js +0 -3
  279. package/dist/cjs/actions/smartAccount/types.js.map +0 -1
  280. package/dist/cjs/actions/smartAccount/upgradeAccount.d.ts +0 -4
  281. package/dist/cjs/actions/smartAccount/upgradeAccount.js +0 -38
  282. package/dist/cjs/actions/smartAccount/upgradeAccount.js.map +0 -1
  283. package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.d.ts +0 -3
  284. package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js +0 -36
  285. package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js.map +0 -1
  286. package/dist/cjs/client/bundlerClient.d.ts +0 -10
  287. package/dist/cjs/client/bundlerClient.js +0 -51
  288. package/dist/cjs/client/bundlerClient.js.map +0 -1
  289. package/dist/cjs/client/decorators/bundlerClient.d.ts +0 -41
  290. package/dist/cjs/client/decorators/bundlerClient.js +0 -17
  291. package/dist/cjs/client/decorators/bundlerClient.js.map +0 -1
  292. package/dist/cjs/client/decorators/smartAccountClient.d.ts +0 -35
  293. package/dist/cjs/client/decorators/smartAccountClient.js +0 -43
  294. package/dist/cjs/client/decorators/smartAccountClient.js.map +0 -1
  295. package/dist/cjs/client/isSmartAccountClient.d.ts +0 -5
  296. package/dist/cjs/client/isSmartAccountClient.js +0 -18
  297. package/dist/cjs/client/isSmartAccountClient.js.map +0 -1
  298. package/dist/cjs/client/schema.d.ts +0 -767
  299. package/dist/cjs/client/schema.js +0 -63
  300. package/dist/cjs/client/schema.js.map +0 -1
  301. package/dist/cjs/client/smartAccountClient.d.ts +0 -33
  302. package/dist/cjs/client/smartAccountClient.js +0 -93
  303. package/dist/cjs/client/smartAccountClient.js.map +0 -1
  304. package/dist/cjs/client/types.d.ts +0 -21
  305. package/dist/cjs/client/types.js +0 -3
  306. package/dist/cjs/client/types.js.map +0 -1
  307. package/dist/cjs/ens/utils.d.ts +0 -6
  308. package/dist/cjs/ens/utils.js +0 -53
  309. package/dist/cjs/ens/utils.js.map +0 -1
  310. package/dist/cjs/entrypoint/0.6.d.ts +0 -1029
  311. package/dist/cjs/entrypoint/0.6.js +0 -49
  312. package/dist/cjs/entrypoint/0.6.js.map +0 -1
  313. package/dist/cjs/entrypoint/0.7.d.ts +0 -792
  314. package/dist/cjs/entrypoint/0.7.js +0 -88
  315. package/dist/cjs/entrypoint/0.7.js.map +0 -1
  316. package/dist/cjs/entrypoint/index.d.ts +0 -8
  317. package/dist/cjs/entrypoint/index.js +0 -53
  318. package/dist/cjs/entrypoint/index.js.map +0 -1
  319. package/dist/cjs/entrypoint/types.d.ts +0 -46
  320. package/dist/cjs/entrypoint/types.js +0 -3
  321. package/dist/cjs/entrypoint/types.js.map +0 -1
  322. package/dist/cjs/errors/account.d.ts +0 -47
  323. package/dist/cjs/errors/account.js +0 -140
  324. package/dist/cjs/errors/account.js.map +0 -1
  325. package/dist/cjs/errors/base.d.ts +0 -18
  326. package/dist/cjs/errors/base.js +0 -39
  327. package/dist/cjs/errors/base.js.map +0 -1
  328. package/dist/cjs/errors/client.d.ts +0 -14
  329. package/dist/cjs/errors/client.js +0 -44
  330. package/dist/cjs/errors/client.js.map +0 -1
  331. package/dist/cjs/errors/entrypoint.d.ts +0 -10
  332. package/dist/cjs/errors/entrypoint.js +0 -32
  333. package/dist/cjs/errors/entrypoint.js.map +0 -1
  334. package/dist/cjs/errors/signer.d.ts +0 -5
  335. package/dist/cjs/errors/signer.js +0 -20
  336. package/dist/cjs/errors/signer.js.map +0 -1
  337. package/dist/cjs/errors/transaction.d.ts +0 -10
  338. package/dist/cjs/errors/transaction.js +0 -29
  339. package/dist/cjs/errors/transaction.js.map +0 -1
  340. package/dist/cjs/errors/useroperation.d.ts +0 -10
  341. package/dist/cjs/errors/useroperation.js +0 -34
  342. package/dist/cjs/errors/useroperation.js.map +0 -1
  343. package/dist/cjs/index.d.ts +0 -60
  344. package/dist/cjs/index.js +0 -170
  345. package/dist/cjs/index.js.map +0 -1
  346. package/dist/cjs/logger.d.ts +0 -20
  347. package/dist/cjs/logger.js +0 -60
  348. package/dist/cjs/logger.js.map +0 -1
  349. package/dist/cjs/middleware/actions.d.ts +0 -12
  350. package/dist/cjs/middleware/actions.js +0 -21
  351. package/dist/cjs/middleware/actions.js.map +0 -1
  352. package/dist/cjs/middleware/defaults/feeEstimator.d.ts +0 -3
  353. package/dist/cjs/middleware/defaults/feeEstimator.js +0 -23
  354. package/dist/cjs/middleware/defaults/feeEstimator.js.map +0 -1
  355. package/dist/cjs/middleware/defaults/gasEstimator.d.ts +0 -3
  356. package/dist/cjs/middleware/defaults/gasEstimator.js +0 -28
  357. package/dist/cjs/middleware/defaults/gasEstimator.js.map +0 -1
  358. package/dist/cjs/middleware/defaults/paymasterAndData.d.ts +0 -2
  359. package/dist/cjs/middleware/defaults/paymasterAndData.js +0 -12
  360. package/dist/cjs/middleware/defaults/paymasterAndData.js.map +0 -1
  361. package/dist/cjs/middleware/defaults/userOpSigner.d.ts +0 -2
  362. package/dist/cjs/middleware/defaults/userOpSigner.js +0 -26
  363. package/dist/cjs/middleware/defaults/userOpSigner.js.map +0 -1
  364. package/dist/cjs/middleware/erc7677middleware.d.ts +0 -40
  365. package/dist/cjs/middleware/erc7677middleware.js +0 -77
  366. package/dist/cjs/middleware/erc7677middleware.js.map +0 -1
  367. package/dist/cjs/middleware/noopMiddleware.d.ts +0 -3
  368. package/dist/cjs/middleware/noopMiddleware.js +0 -8
  369. package/dist/cjs/middleware/noopMiddleware.js.map +0 -1
  370. package/dist/cjs/middleware/types.d.ts +0 -22
  371. package/dist/cjs/middleware/types.js +0 -3
  372. package/dist/cjs/middleware/types.js.map +0 -1
  373. package/dist/cjs/package.json +0 -1
  374. package/dist/cjs/signer/local-account.d.ts +0 -219
  375. package/dist/cjs/signer/local-account.js +0 -56
  376. package/dist/cjs/signer/local-account.js.map +0 -1
  377. package/dist/cjs/signer/schema.d.ts +0 -4
  378. package/dist/cjs/signer/schema.js +0 -16
  379. package/dist/cjs/signer/schema.js.map +0 -1
  380. package/dist/cjs/signer/types.d.ts +0 -15
  381. package/dist/cjs/signer/types.js +0 -3
  382. package/dist/cjs/signer/types.js.map +0 -1
  383. package/dist/cjs/signer/utils.d.ts +0 -7
  384. package/dist/cjs/signer/utils.js +0 -16
  385. package/dist/cjs/signer/utils.js.map +0 -1
  386. package/dist/cjs/signer/wallet-client.d.ts +0 -217
  387. package/dist/cjs/signer/wallet-client.js +0 -58
  388. package/dist/cjs/signer/wallet-client.js.map +0 -1
  389. package/dist/cjs/transport/split.d.ts +0 -9
  390. package/dist/cjs/transport/split.js +0 -26
  391. package/dist/cjs/transport/split.js.map +0 -1
  392. package/dist/cjs/types.d.ts +0 -158
  393. package/dist/cjs/types.js +0 -3
  394. package/dist/cjs/types.js.map +0 -1
  395. package/dist/cjs/utils/bigint.d.ts +0 -10
  396. package/dist/cjs/utils/bigint.js +0 -55
  397. package/dist/cjs/utils/bigint.js.map +0 -1
  398. package/dist/cjs/utils/bytes.d.ts +0 -7
  399. package/dist/cjs/utils/bytes.js +0 -11
  400. package/dist/cjs/utils/bytes.js.map +0 -1
  401. package/dist/cjs/utils/defaults.d.ts +0 -4
  402. package/dist/cjs/utils/defaults.js +0 -19
  403. package/dist/cjs/utils/defaults.js.map +0 -1
  404. package/dist/cjs/utils/index.d.ts +0 -19
  405. package/dist/cjs/utils/index.js +0 -95
  406. package/dist/cjs/utils/index.js.map +0 -1
  407. package/dist/cjs/utils/schema.d.ts +0 -25
  408. package/dist/cjs/utils/schema.js +0 -35
  409. package/dist/cjs/utils/schema.js.map +0 -1
  410. package/dist/cjs/utils/stateOverride.d.ts +0 -4
  411. package/dist/cjs/utils/stateOverride.js +0 -52
  412. package/dist/cjs/utils/stateOverride.js.map +0 -1
  413. package/dist/cjs/utils/testUtils.d.ts +0 -6
  414. package/dist/cjs/utils/testUtils.js +0 -33
  415. package/dist/cjs/utils/testUtils.js.map +0 -1
  416. package/dist/cjs/utils/types.d.ts +0 -16
  417. package/dist/cjs/utils/types.js +0 -3
  418. package/dist/cjs/utils/types.js.map +0 -1
  419. package/dist/cjs/utils/userop.d.ts +0 -49
  420. package/dist/cjs/utils/userop.js +0 -75
  421. package/dist/cjs/utils/userop.js.map +0 -1
  422. package/dist/cjs/version.d.ts +0 -1
  423. package/dist/cjs/version.js +0 -5
  424. package/dist/cjs/version.js.map +0 -1
  425. package/dist/esm/package.json +0 -1
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/signer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Address } from \"abitype\";\nimport type {\n Hex,\n SignableMessage,\n TypedData,\n TypedDataDefinition,\n} from \"viem\";\n\n// [!region SmartAccountAuthenticator]\n/**\n * Extends the @interface SmartAccountSigner interface with authentication.\n *\n * @template AuthParams - the generic type of the authentication parameters\n * @template AuthDetails - the generic type of the authentication details\n * @template Inner - the generic type of the inner client that the signer wraps to provide functionality such as signing, etc.\n */\nexport interface SmartAccountAuthenticator<AuthParams, AuthDetails, Inner = any>\n extends SmartAccountSigner<Inner> {\n authenticate: (params: AuthParams) => Promise<AuthDetails>;\n\n getAuthDetails: () => Promise<AuthDetails>;\n}\n// [!endregion SmartAccountAuthenticator]\n\n// [!region SmartAccountSigner]\n/**\n * A signer that can sign messages and typed data.\n *\n * @template Inner - the generic type of the inner client that the signer wraps to provide functionality such as signing, etc.\n */\nexport interface SmartAccountSigner<Inner = any> {\n signerType: string;\n inner: Inner;\n\n getAddress: () => Promise<Address>;\n\n signMessage: (message: SignableMessage) => Promise<Hex>;\n\n signTypedData: <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string\n >(\n params: TypedDataDefinition<TTypedData, TPrimaryType>\n ) => Promise<Hex>;\n}\n// [!endregion SmartAccountSigner]\n"]}
@@ -1,7 +0,0 @@
1
- import { type Address, type Hash, type Hex } from "viem";
2
- export type SignWith6492Params = {
3
- factoryAddress: Address;
4
- factoryCalldata: Hex;
5
- signature: Hash;
6
- };
7
- export declare const wrapSignatureWith6492: ({ factoryAddress, factoryCalldata, signature, }: SignWith6492Params) => Hash;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wrapSignatureWith6492 = void 0;
4
- const viem_1 = require("viem");
5
- const wrapSignatureWith6492 = ({ factoryAddress, factoryCalldata, signature, }) => {
6
- return (0, viem_1.concat)([
7
- (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, bytes, bytes"), [
8
- factoryAddress,
9
- factoryCalldata,
10
- signature,
11
- ]),
12
- "0x6492649264926492649264926492649264926492649264926492649264926492",
13
- ]);
14
- };
15
- exports.wrapSignatureWith6492 = wrapSignatureWith6492;
16
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/signer/utils.ts"],"names":[],"mappings":";;;AAAA,+BAOc;AA4BP,MAAM,qBAAqB,GAAG,CAAC,EACpC,cAAc,EACd,eAAe,EACf,SAAS,GACU,EAAQ,EAAE;IAQ7B,OAAO,IAAA,aAAM,EAAC;QACZ,IAAA,0BAAmB,EAAC,IAAA,yBAAkB,EAAC,uBAAuB,CAAC,EAAE;YAC/D,cAAc;YACd,eAAe;YACf,SAAS;SACV,CAAC;QACF,oEAAoE;KACrE,CAAC,CAAC;AACL,CAAC,CAAC;AApBW,QAAA,qBAAqB,yBAoBhC","sourcesContent":["import {\n concat,\n encodeAbiParameters,\n parseAbiParameters,\n type Address,\n type Hash,\n type Hex,\n} from \"viem\";\n\nexport type SignWith6492Params = {\n factoryAddress: Address;\n factoryCalldata: Hex;\n signature: Hash;\n};\n\n/**\n * Wraps a given signature with additional data following the EIP-6492 standard.\n *\n * @example\n * ```ts\n * import { wrapSignatureWith6492 } from \"@aa-sdk/core\";\n *\n * const signature = wrapSignatureWith6492({\n * factoryAddress: \"0x...\",\n * factoryCalldata: \"0x...\",\n * signature: \"0x...\",\n * });\n * ```\n *\n * @param {SignWith6492Params} params The parameters to wrap the signature\n * @param {Hex} params.factoryAddress The address of the factory\n * @param {Hex} params.factoryCalldata The calldata for the factory\n * @param {Hex} params.signature The original signature that needs to be wrapped\n * @returns {Hash} The wrapped signature\n */\nexport const wrapSignatureWith6492 = ({\n factoryAddress,\n factoryCalldata,\n signature,\n}: SignWith6492Params): Hash => {\n // wrap the signature as follows: https://eips.ethereum.org/EIPS/eip-6492\n // concat(\n // abi.encode(\n // (create2Factory, factoryCalldata, originalERC1271Signature),\n // (address, bytes, bytes)),\n // magicBytes\n // )\n return concat([\n encodeAbiParameters(parseAbiParameters(\"address, bytes, bytes\"), [\n factoryAddress,\n factoryCalldata,\n signature,\n ]),\n \"0x6492649264926492649264926492649264926492649264926492649264926492\",\n ]);\n};\n"]}
@@ -1,217 +0,0 @@
1
- import { type Hex, type SignableMessage, type TypedDataDefinition, type WalletClient } from "viem";
2
- import type { SmartAccountSigner } from "./types";
3
- export declare class WalletClientSigner implements SmartAccountSigner<WalletClient> {
4
- signerType: string;
5
- inner: WalletClient;
6
- constructor(client: WalletClient, signerType: string);
7
- getAddress: () => Promise<`0x${string}`>;
8
- readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`>;
9
- signTypedData: <const TTypedData extends {
10
- [x: string]: readonly import("viem").TypedDataParameter[];
11
- [x: `string[${string}]`]: undefined;
12
- [x: `function[${string}]`]: undefined;
13
- [x: `uint256[${string}]`]: undefined;
14
- [x: `uint48[${string}]`]: undefined;
15
- [x: `bool[${string}]`]: undefined;
16
- [x: `bytes[${string}]`]: undefined;
17
- [x: `address[${string}]`]: undefined;
18
- [x: `bytes32[${string}]`]: undefined;
19
- [x: `uint32[${string}]`]: undefined;
20
- [x: `uint112[${string}]`]: undefined;
21
- [x: `uint192[${string}]`]: undefined;
22
- [x: `bytes4[${string}]`]: undefined;
23
- [x: `uint8[${string}]`]: undefined;
24
- [x: `uint64[${string}]`]: undefined;
25
- [x: `bytes6[${string}]`]: undefined;
26
- [x: `bytes2[${string}]`]: undefined;
27
- [x: `bytes1[${string}]`]: undefined;
28
- [x: `bytes5[${string}]`]: undefined;
29
- [x: `bytes3[${string}]`]: undefined;
30
- [x: `bytes7[${string}]`]: undefined;
31
- [x: `bytes11[${string}]`]: undefined;
32
- [x: `bytes8[${string}]`]: undefined;
33
- [x: `bytes9[${string}]`]: undefined;
34
- [x: `bytes10[${string}]`]: undefined;
35
- [x: `bytes25[${string}]`]: undefined;
36
- [x: `bytes31[${string}]`]: undefined;
37
- [x: `bytes30[${string}]`]: undefined;
38
- [x: `bytes29[${string}]`]: undefined;
39
- [x: `bytes28[${string}]`]: undefined;
40
- [x: `bytes27[${string}]`]: undefined;
41
- [x: `bytes26[${string}]`]: undefined;
42
- [x: `bytes24[${string}]`]: undefined;
43
- [x: `bytes23[${string}]`]: undefined;
44
- [x: `bytes22[${string}]`]: undefined;
45
- [x: `bytes21[${string}]`]: undefined;
46
- [x: `bytes20[${string}]`]: undefined;
47
- [x: `bytes19[${string}]`]: undefined;
48
- [x: `bytes18[${string}]`]: undefined;
49
- [x: `bytes17[${string}]`]: undefined;
50
- [x: `bytes16[${string}]`]: undefined;
51
- [x: `bytes15[${string}]`]: undefined;
52
- [x: `bytes14[${string}]`]: undefined;
53
- [x: `bytes13[${string}]`]: undefined;
54
- [x: `bytes12[${string}]`]: undefined;
55
- [x: `int[${string}]`]: undefined;
56
- [x: `int8[${string}]`]: undefined;
57
- [x: `int40[${string}]`]: undefined;
58
- [x: `int32[${string}]`]: undefined;
59
- [x: `int24[${string}]`]: undefined;
60
- [x: `int16[${string}]`]: undefined;
61
- [x: `int48[${string}]`]: undefined;
62
- [x: `int56[${string}]`]: undefined;
63
- [x: `int64[${string}]`]: undefined;
64
- [x: `int72[${string}]`]: undefined;
65
- [x: `int80[${string}]`]: undefined;
66
- [x: `int88[${string}]`]: undefined;
67
- [x: `int96[${string}]`]: undefined;
68
- [x: `int104[${string}]`]: undefined;
69
- [x: `int112[${string}]`]: undefined;
70
- [x: `int120[${string}]`]: undefined;
71
- [x: `int128[${string}]`]: undefined;
72
- [x: `int136[${string}]`]: undefined;
73
- [x: `int144[${string}]`]: undefined;
74
- [x: `int152[${string}]`]: undefined;
75
- [x: `int160[${string}]`]: undefined;
76
- [x: `int168[${string}]`]: undefined;
77
- [x: `int176[${string}]`]: undefined;
78
- [x: `int184[${string}]`]: undefined;
79
- [x: `int192[${string}]`]: undefined;
80
- [x: `int200[${string}]`]: undefined;
81
- [x: `int208[${string}]`]: undefined;
82
- [x: `int216[${string}]`]: undefined;
83
- [x: `int224[${string}]`]: undefined;
84
- [x: `int232[${string}]`]: undefined;
85
- [x: `int240[${string}]`]: undefined;
86
- [x: `int248[${string}]`]: undefined;
87
- [x: `int256[${string}]`]: undefined;
88
- [x: `uint[${string}]`]: undefined;
89
- [x: `uint40[${string}]`]: undefined;
90
- [x: `uint24[${string}]`]: undefined;
91
- [x: `uint16[${string}]`]: undefined;
92
- [x: `uint56[${string}]`]: undefined;
93
- [x: `uint72[${string}]`]: undefined;
94
- [x: `uint80[${string}]`]: undefined;
95
- [x: `uint88[${string}]`]: undefined;
96
- [x: `uint96[${string}]`]: undefined;
97
- [x: `uint104[${string}]`]: undefined;
98
- [x: `uint120[${string}]`]: undefined;
99
- [x: `uint128[${string}]`]: undefined;
100
- [x: `uint136[${string}]`]: undefined;
101
- [x: `uint144[${string}]`]: undefined;
102
- [x: `uint152[${string}]`]: undefined;
103
- [x: `uint160[${string}]`]: undefined;
104
- [x: `uint168[${string}]`]: undefined;
105
- [x: `uint176[${string}]`]: undefined;
106
- [x: `uint184[${string}]`]: undefined;
107
- [x: `uint200[${string}]`]: undefined;
108
- [x: `uint208[${string}]`]: undefined;
109
- [x: `uint216[${string}]`]: undefined;
110
- [x: `uint224[${string}]`]: undefined;
111
- [x: `uint232[${string}]`]: undefined;
112
- [x: `uint240[${string}]`]: undefined;
113
- [x: `uint248[${string}]`]: undefined;
114
- string?: undefined;
115
- uint256?: undefined;
116
- uint48?: undefined;
117
- bool?: undefined;
118
- bytes?: undefined;
119
- address?: undefined;
120
- bytes32?: undefined;
121
- uint32?: undefined;
122
- uint112?: undefined;
123
- uint192?: undefined;
124
- bytes4?: undefined;
125
- uint8?: undefined;
126
- uint64?: undefined;
127
- bytes6?: undefined;
128
- bytes2?: undefined;
129
- bytes1?: undefined;
130
- bytes5?: undefined;
131
- bytes3?: undefined;
132
- bytes7?: undefined;
133
- bytes11?: undefined;
134
- bytes8?: undefined;
135
- bytes9?: undefined;
136
- bytes10?: undefined;
137
- bytes25?: undefined;
138
- bytes31?: undefined;
139
- bytes30?: undefined;
140
- bytes29?: undefined;
141
- bytes28?: undefined;
142
- bytes27?: undefined;
143
- bytes26?: undefined;
144
- bytes24?: undefined;
145
- bytes23?: undefined;
146
- bytes22?: undefined;
147
- bytes21?: undefined;
148
- bytes20?: undefined;
149
- bytes19?: undefined;
150
- bytes18?: undefined;
151
- bytes17?: undefined;
152
- bytes16?: undefined;
153
- bytes15?: undefined;
154
- bytes14?: undefined;
155
- bytes13?: undefined;
156
- bytes12?: undefined;
157
- int8?: undefined;
158
- int40?: undefined;
159
- int32?: undefined;
160
- int24?: undefined;
161
- int16?: undefined;
162
- int48?: undefined;
163
- int56?: undefined;
164
- int64?: undefined;
165
- int72?: undefined;
166
- int80?: undefined;
167
- int88?: undefined;
168
- int96?: undefined;
169
- int104?: undefined;
170
- int112?: undefined;
171
- int120?: undefined;
172
- int128?: undefined;
173
- int136?: undefined;
174
- int144?: undefined;
175
- int152?: undefined;
176
- int160?: undefined;
177
- int168?: undefined;
178
- int176?: undefined;
179
- int184?: undefined;
180
- int192?: undefined;
181
- int200?: undefined;
182
- int208?: undefined;
183
- int216?: undefined;
184
- int224?: undefined;
185
- int232?: undefined;
186
- int240?: undefined;
187
- int248?: undefined;
188
- int256?: undefined;
189
- uint40?: undefined;
190
- uint24?: undefined;
191
- uint16?: undefined;
192
- uint56?: undefined;
193
- uint72?: undefined;
194
- uint80?: undefined;
195
- uint88?: undefined;
196
- uint96?: undefined;
197
- uint104?: undefined;
198
- uint120?: undefined;
199
- uint128?: undefined;
200
- uint136?: undefined;
201
- uint144?: undefined;
202
- uint152?: undefined;
203
- uint160?: undefined;
204
- uint168?: undefined;
205
- uint176?: undefined;
206
- uint184?: undefined;
207
- uint200?: undefined;
208
- uint208?: undefined;
209
- uint216?: undefined;
210
- uint224?: undefined;
211
- uint232?: undefined;
212
- uint240?: undefined;
213
- uint248?: undefined;
214
- } | {
215
- [key: string]: unknown;
216
- }, TPrimaryType extends string = string>(typedData: TypedDataDefinition<TTypedData, TPrimaryType>) => Promise<Hex>;
217
- }
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WalletClientSigner = void 0;
4
- const viem_1 = require("viem");
5
- const signer_js_1 = require("../errors/signer.js");
6
- class WalletClientSigner {
7
- constructor(client, signerType) {
8
- Object.defineProperty(this, "signerType", {
9
- enumerable: true,
10
- configurable: true,
11
- writable: true,
12
- value: void 0
13
- });
14
- Object.defineProperty(this, "inner", {
15
- enumerable: true,
16
- configurable: true,
17
- writable: true,
18
- value: void 0
19
- });
20
- Object.defineProperty(this, "getAddress", {
21
- enumerable: true,
22
- configurable: true,
23
- writable: true,
24
- value: async () => {
25
- let addresses = await this.inner.getAddresses();
26
- return (0, viem_1.getAddress)(addresses[0]);
27
- }
28
- });
29
- Object.defineProperty(this, "signMessage", {
30
- enumerable: true,
31
- configurable: true,
32
- writable: true,
33
- value: async (message) => {
34
- const account = this.inner.account ?? (await this.getAddress());
35
- return this.inner.signMessage({ message, account });
36
- }
37
- });
38
- Object.defineProperty(this, "signTypedData", {
39
- enumerable: true,
40
- configurable: true,
41
- writable: true,
42
- value: async (typedData) => {
43
- const account = this.inner.account ?? (await this.getAddress());
44
- return this.inner.signTypedData({
45
- account,
46
- ...typedData,
47
- });
48
- }
49
- });
50
- this.inner = client;
51
- if (!signerType) {
52
- throw new signer_js_1.InvalidSignerTypeError(signerType);
53
- }
54
- this.signerType = signerType;
55
- }
56
- }
57
- exports.WalletClientSigner = WalletClientSigner;
58
- //# sourceMappingURL=wallet-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wallet-client.js","sourceRoot":"","sources":["../../../src/signer/wallet-client.ts"],"names":[],"mappings":";;;AAAA,+BAOc;AACd,mDAA6D;AAM7D,MAAa,kBAAkB;IAyB7B,YAAY,MAAoB,EAAE,UAAkB;QAxBpD;;;;;WAAmB;QACnB;;;;;WAAoB;QAmDpB;;;;mBAA2C,KAAK,IAAI,EAAE;gBACpD,IAAI,SAAS,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;gBAChD,OAAO,IAAA,iBAAU,EAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,CAAC;WAAC;QAuBO;;;;mBACP,KAAK,EAAE,OAAO,EAAE,EAAE;gBAChB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;gBAEhE,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;YACtD,CAAC;WAAC;QA6BJ;;;;mBAAgB,KAAK,EAInB,SAAwD,EAC1C,EAAE;gBAChB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;gBAEhE,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;oBAC9B,OAAO;oBACP,GAAG,SAAS;iBACb,CAAC,CAAC;YACL,CAAC;WAAC;QAnGA,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,kCAAsB,CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CA+FF;AA9HD,gDA8HC","sourcesContent":["import {\n getAddress,\n type Hex,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n type WalletClient,\n} from \"viem\";\nimport { InvalidSignerTypeError } from \"../errors/signer.js\";\nimport type { SmartAccountSigner } from \"./types\";\n\n/**\n * Represents a wallet client signer for smart accounts, providing methods to get the address, sign messages, and sign typed data.\n */\nexport class WalletClientSigner implements SmartAccountSigner<WalletClient> {\n signerType: string;\n inner: WalletClient;\n\n /**\n * Initializes a signer with a given wallet client and signer type.\n *\n * @example\n * ```ts\n * import { WalletClientSigner } from \"@aa-sdk/core\";\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum!)\n * });\n *\n * const signer = new WalletClientSigner(client, 'wallet');\n * ```\n *\n * @param {WalletClient} client The wallet client to interact with\n * @param {string} signerType The type of signer; must be a valid signer type, otherwise an error will be thrown\n * @throws {InvalidSignerTypeError} If the signer type is invalid\n */\n constructor(client: WalletClient, signerType: string) {\n this.inner = client;\n if (!signerType) {\n throw new InvalidSignerTypeError(signerType);\n }\n this.signerType = signerType;\n }\n\n /**\n * Asynchronously retrieves addresses from the inner object and returns the first address after applying the `getAddress` function.\n *\n * @example\n * ```ts\n * import { WalletClientSigner } from \"@aa-sdk/core\";\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum!)\n * });\n *\n * const signer = new WalletClientSigner(client, 'wallet');\n * console.log(await signer.getAddress());\n * ```\n *\n * @returns {Promise<string>} A promise that resolves to the first address after being processed by the `getAddress` function.\n */\n getAddress: () => Promise<`0x${string}`> = async () => {\n let addresses = await this.inner.getAddresses();\n return getAddress(addresses[0]);\n };\n\n /**\n * Signs a message using the account's signing method.\n *\n * @example\n * ```ts\n * import { WalletClientSigner } from \"@aa-sdk/core\";\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum!)\n * });\n *\n * const signer = new WalletClientSigner(client, 'wallet');\n * console.log(await signer.signMessage(\"hello\"));\n * ```\n *\n * @param {string} message the message string that needs to be signed\n * @returns {Promise<string>} a promise that resolves to the signed message\n */\n readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> =\n async (message) => {\n const account = this.inner.account ?? (await this.getAddress());\n\n return this.inner.signMessage({ message, account });\n };\n\n /**\n * Signs the provided typed data using the account's private key.\n *\n * @example\n * ```ts\n * import { WalletClientSigner } from \"@aa-sdk/core\";\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum!)\n * });\n *\n * const signer = new WalletClientSigner(client, 'wallet');\n * console.log(await signer.signTypedData({\n * types: {\n * \"Message\": [{ name: \"content\", type: \"string\" }]\n * },\n * primaryType: \"Message\",\n * message: { content: \"Hello\" },\n * }));\n * ```\n *\n * @param {TypedDataDefinition<TTypedData, TPrimaryType>} typedData The typed data to be signed\n * @returns {Promise<Hex>} A promise that resolves to a hex string representing the signed data\n */\n signTypedData = async <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string\n >(\n typedData: TypedDataDefinition<TTypedData, TPrimaryType>\n ): Promise<Hex> => {\n const account = this.inner.account ?? (await this.getAddress());\n\n return this.inner.signTypedData({\n account,\n ...typedData,\n });\n };\n}\n"]}
@@ -1,9 +0,0 @@
1
- import { type CustomTransport, type Transport } from "viem";
2
- export interface SplitTransportParams {
3
- overrides: {
4
- methods: string[];
5
- transport: Transport;
6
- }[];
7
- fallback: Transport;
8
- }
9
- export declare const split: (params: SplitTransportParams) => CustomTransport;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.split = void 0;
4
- const viem_1 = require("viem");
5
- const split = (params) => {
6
- const overrideMap = params.overrides.reduce((accum, curr) => {
7
- curr.methods.forEach((method) => {
8
- if (accum.has(method) && accum.get(method) !== curr.transport) {
9
- throw new Error("A method cannot be handled by more than one transport");
10
- }
11
- accum.set(method, curr.transport);
12
- });
13
- return accum;
14
- }, new Map());
15
- return (opts) => (0, viem_1.custom)({
16
- request: async (args) => {
17
- const transportOverride = overrideMap.get(args.method);
18
- if (transportOverride != null) {
19
- return transportOverride(opts).request(args);
20
- }
21
- return params.fallback(opts).request(args);
22
- },
23
- })(opts);
24
- };
25
- exports.split = split;
26
- //# sourceMappingURL=split.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"split.js","sourceRoot":"","sources":["../../../src/transport/split.ts"],"names":[],"mappings":";;;AAAA,+BAAoE;AA0C7D,MAAM,KAAK,GAAG,CAAC,MAA4B,EAAmB,EAAE;IACrE,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAC1D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC9B,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC9D,MAAM,IAAI,KAAK,CACb,uDAAuD,CACxD,CAAC;YACJ,CAAC;YAED,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,IAAI,GAAG,EAAqB,CAAC,CAAC;IAEjC,OAAO,CAAC,IAAI,EAAE,EAAE,CACd,IAAA,aAAM,EAAC;QACL,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACtB,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvD,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;gBAC9B,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC/C,CAAC;YAED,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC,IAAI,CAAC,CAAC;AACb,CAAC,CAAC;AA1BW,QAAA,KAAK,SA0BhB","sourcesContent":["import { custom, type CustomTransport, type Transport } from \"viem\";\n\nexport interface SplitTransportParams {\n overrides: {\n methods: string[];\n transport: Transport;\n }[];\n fallback: Transport;\n}\n\n/**\n * The Split Transport allows you to split RPC traffic for specific methods across\n * different RPC providers. This is done by specifying the methods you want handled\n * specially as overrides and providing a fallback transport for all other methods.\n *\n * @example\n * ```ts\n * import { createPublicClient, http } from \"viem\";\n * import { split } from \"@aa-sdk/core\";\n *\n * const bundlerMethods = [\n * \"eth_sendUserOperation\",\n * \"eth_estimateUserOperationGas\",\n * \"eth_getUserOperationReceipt\",\n * \"eth_getUserOperationByHash\",\n * \"eth_supportedEntryPoints\"\n * ];\n *\n * const clientWithSplit = createPublicClient({\n * transport: split({\n * overrides: [{\n * methods: bundlerMethods,\n * transport: http(BUNDLER_RPC_URL)\n * }]\n * fallback: http(OTHER_RPC_URL)\n * }),\n * });\n * ```\n *\n * @param {SplitTransportParams} params split transport configuration containing the methods overrides and fallback transport\n * @returns {CustomTransport} a viem Transport that splits traffic\n */\nexport const split = (params: SplitTransportParams): CustomTransport => {\n const overrideMap = params.overrides.reduce((accum, curr) => {\n curr.methods.forEach((method) => {\n if (accum.has(method) && accum.get(method) !== curr.transport) {\n throw new Error(\n \"A method cannot be handled by more than one transport\"\n );\n }\n\n accum.set(method, curr.transport);\n });\n\n return accum;\n }, new Map<string, Transport>());\n\n return (opts) =>\n custom({\n request: async (args) => {\n const transportOverride = overrideMap.get(args.method);\n if (transportOverride != null) {\n return transportOverride(opts).request(args);\n }\n\n return params.fallback(opts).request(args);\n },\n })(opts);\n};\n"]}
@@ -1,158 +0,0 @@
1
- import { type Address, type Hash, type Hex, type StateOverride, type TransactionReceipt } from "viem";
2
- import type { z } from "zod";
3
- import type { UserOperationFeeOptionsFieldSchema, UserOperationFeeOptionsSchema, UserOperationFeeOptionsSchema_v6, UserOperationFeeOptionsSchema_v7 } from "./client/schema";
4
- import type { EntryPointVersion } from "./entrypoint/types";
5
- import type { BigNumberishRangeSchema, BigNumberishSchema, MultiplierSchema, NoUndefined } from "./utils";
6
- export type EmptyHex = `0x`;
7
- export type NullAddress = `0x0`;
8
- export type PromiseOrValue<T> = T | Promise<T>;
9
- export type BytesLike = Uint8Array | Hex;
10
- export type Multiplier = z.input<typeof MultiplierSchema>;
11
- export type BigNumberish = z.input<typeof BigNumberishSchema>;
12
- export type BigNumberishRange = z.input<typeof BigNumberishRangeSchema>;
13
- export type UserOperationCallData = {
14
- target: Address;
15
- data: Hex;
16
- value?: bigint;
17
- } | Hex;
18
- export type BatchUserOperationCallData = Exclude<UserOperationCallData, Hex>[];
19
- export type UserOperationFeeOptionsField = z.input<typeof UserOperationFeeOptionsFieldSchema>;
20
- export type UserOperationFeeOptions<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = TEntryPointVersion extends "0.6.0" ? z.input<typeof UserOperationFeeOptionsSchema_v6> : TEntryPointVersion extends "0.7.0" ? z.input<typeof UserOperationFeeOptionsSchema_v7> : z.input<typeof UserOperationFeeOptionsSchema>;
21
- export type UserOperationOverridesParameter<TEntryPointVersion extends EntryPointVersion = EntryPointVersion, Required extends boolean = false> = Required extends true ? {
22
- overrides: UserOperationOverrides<TEntryPointVersion>;
23
- } : {
24
- overrides?: UserOperationOverrides<TEntryPointVersion>;
25
- };
26
- export type UserOperationPaymasterOverrides<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = TEntryPointVersion extends "0.6.0" ? {
27
- paymasterAndData: Hex;
28
- } : TEntryPointVersion extends "0.7.0" ? {
29
- paymasterData: Hex;
30
- paymaster: Address;
31
- paymasterVerificationGasLimit: NoUndefined<UserOperationStruct<"0.7.0">["paymasterVerificationGasLimit"]> | Multiplier;
32
- paymasterPostOpGasLimit: NoUndefined<UserOperationStruct<"0.7.0">["paymasterPostOpGasLimit"]> | Multiplier;
33
- } : {};
34
- export type UserOperationOverrides<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = Partial<{
35
- callGasLimit: UserOperationStruct<TEntryPointVersion>["callGasLimit"] | Multiplier;
36
- maxFeePerGas: UserOperationStruct<TEntryPointVersion>["maxFeePerGas"] | Multiplier;
37
- maxPriorityFeePerGas: UserOperationStruct<TEntryPointVersion>["maxPriorityFeePerGas"] | Multiplier;
38
- preVerificationGas: UserOperationStruct<TEntryPointVersion>["preVerificationGas"] | Multiplier;
39
- verificationGasLimit: UserOperationStruct<TEntryPointVersion>["verificationGasLimit"] | Multiplier;
40
- nonceKey: bigint;
41
- stateOverride: StateOverride;
42
- } & UserOperationPaymasterOverrides<TEntryPointVersion>>;
43
- export interface UserOperationRequest_v6 {
44
- sender: Address;
45
- nonce: Hex;
46
- initCode: Hex | EmptyHex;
47
- callData: Hex;
48
- callGasLimit: Hex;
49
- verificationGasLimit: Hex;
50
- preVerificationGas: Hex;
51
- maxFeePerGas: Hex;
52
- maxPriorityFeePerGas: Hex;
53
- paymasterAndData: Hex | EmptyHex;
54
- signature: Hex;
55
- }
56
- export interface UserOperationRequest_v7 {
57
- sender: Address;
58
- nonce: Hex;
59
- factory?: Address;
60
- factoryData?: Hex;
61
- callData: Hex;
62
- callGasLimit: Hex;
63
- verificationGasLimit: Hex;
64
- preVerificationGas: Hex;
65
- maxFeePerGas: Hex;
66
- maxPriorityFeePerGas: Hex;
67
- paymaster?: Address;
68
- paymasterVerificationGasLimit?: Hex;
69
- paymasterPostOpGasLimit?: Hex;
70
- paymasterData?: Hex;
71
- signature: Hex;
72
- }
73
- export type UserOperationRequest<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = TEntryPointVersion extends "0.6.0" ? UserOperationRequest_v6 : TEntryPointVersion extends "0.7.0" ? UserOperationRequest_v7 : never;
74
- export interface UserOperationEstimateGasResponse<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> {
75
- preVerificationGas: BigNumberish;
76
- verificationGasLimit: BigNumberish;
77
- callGasLimit: BigNumberish;
78
- paymasterVerificationGasLimit: TEntryPointVersion extends "0.7.0" ? BigNumberish | undefined : never;
79
- }
80
- export interface UserOperationResponse<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> {
81
- userOperation: UserOperationRequest<TEntryPointVersion>;
82
- entryPoint: Address;
83
- blockNumber: BigNumberish;
84
- blockHash: Hash;
85
- transactionHash: Hash;
86
- }
87
- export interface UserOperationReceipt {
88
- userOpHash: Hash;
89
- entryPoint: Address;
90
- sender: Address;
91
- nonce: BigNumberish;
92
- paymaster?: Address;
93
- actualGasCost: BigNumberish;
94
- actualGasUsed: BigNumberish;
95
- success: boolean;
96
- reason?: string;
97
- logs: string[];
98
- receipt: TransactionReceipt;
99
- }
100
- export interface UserOperationReceiptObject {
101
- blockHash: Hash;
102
- blockNumber: BigNumberish;
103
- transactionIndex: BigNumberish;
104
- transactionHash: Hash;
105
- from: Address;
106
- to: Address;
107
- cumulativeGasUsed: BigNumberish;
108
- gasUsed: BigNumberish;
109
- contractAddress: Address;
110
- logs: UserOperationReceiptLog[];
111
- logsBloom: Hex;
112
- root: Hex;
113
- status: number;
114
- effectiveGasPrice: BigNumberish;
115
- type: string;
116
- }
117
- export interface UserOperationReceiptLog {
118
- blockHash: Hash;
119
- blockNumber: BigNumberish;
120
- transactionIndex: BigNumberish;
121
- address: Address;
122
- logIndex: BigNumberish;
123
- data: Hex;
124
- removed: boolean;
125
- topics: string[];
126
- transactionHash: Hash;
127
- }
128
- export interface UserOperationStruct_v6 {
129
- sender: string;
130
- nonce: BigNumberish;
131
- initCode: BytesLike | "0x";
132
- callData: BytesLike;
133
- callGasLimit?: BigNumberish;
134
- verificationGasLimit?: BigNumberish;
135
- preVerificationGas?: BigNumberish;
136
- maxFeePerGas?: BigNumberish;
137
- maxPriorityFeePerGas?: BigNumberish;
138
- paymasterAndData: BytesLike | "0x";
139
- signature: BytesLike;
140
- }
141
- export interface UserOperationStruct_v7 {
142
- sender: string;
143
- nonce: BigNumberish;
144
- factory?: string;
145
- factoryData?: BytesLike;
146
- callData: BytesLike;
147
- callGasLimit?: BigNumberish;
148
- verificationGasLimit?: BigNumberish;
149
- preVerificationGas?: BigNumberish;
150
- maxFeePerGas?: BigNumberish;
151
- maxPriorityFeePerGas?: BigNumberish;
152
- paymaster?: string;
153
- paymasterVerificationGasLimit?: BigNumberish;
154
- paymasterPostOpGasLimit?: BigNumberish;
155
- paymasterData?: BytesLike;
156
- signature: BytesLike;
157
- }
158
- export type UserOperationStruct<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = TEntryPointVersion extends "0.6.0" ? UserOperationStruct_v6 : TEntryPointVersion extends "0.7.0" ? UserOperationStruct_v7 : never;
package/dist/cjs/types.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n type Address,\n type Hash,\n type Hex,\n type StateOverride,\n type TransactionReceipt,\n} from \"viem\";\nimport type { z } from \"zod\";\nimport type {\n UserOperationFeeOptionsFieldSchema,\n UserOperationFeeOptionsSchema,\n UserOperationFeeOptionsSchema_v6,\n UserOperationFeeOptionsSchema_v7,\n} from \"./client/schema\";\nimport type { EntryPointVersion } from \"./entrypoint/types\";\nimport type {\n BigNumberishRangeSchema,\n BigNumberishSchema,\n MultiplierSchema,\n NoUndefined,\n} from \"./utils\";\n\nexport type EmptyHex = `0x`;\nexport type NullAddress = `0x0`;\n\n// based on @account-abstraction/common\nexport type PromiseOrValue<T> = T | Promise<T>;\nexport type BytesLike = Uint8Array | Hex;\nexport type Multiplier = z.input<typeof MultiplierSchema>;\n\nexport type BigNumberish = z.input<typeof BigNumberishSchema>;\nexport type BigNumberishRange = z.input<typeof BigNumberishRangeSchema>;\n\n// [!region UserOperationCallData]\nexport type UserOperationCallData =\n | {\n /* the target of the call */\n target: Address;\n /* the data passed to the target */\n data: Hex;\n /* the amount of native token to send to the target (default: 0) */\n value?: bigint;\n }\n | Hex;\n// [!endregion UserOperationCallData]\n\n// [!region BatchUserOperationCallData]\nexport type BatchUserOperationCallData = Exclude<UserOperationCallData, Hex>[];\n// [!endregion BatchUserOperationCallData]\n\nexport type UserOperationFeeOptionsField = z.input<\n typeof UserOperationFeeOptionsFieldSchema\n>;\n\nexport type UserOperationFeeOptions<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? z.input<typeof UserOperationFeeOptionsSchema_v6>\n : TEntryPointVersion extends \"0.7.0\"\n ? z.input<typeof UserOperationFeeOptionsSchema_v7>\n : z.input<typeof UserOperationFeeOptionsSchema>;\n\nexport type UserOperationOverridesParameter<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n Required extends boolean = false\n> = Required extends true\n ? { overrides: UserOperationOverrides<TEntryPointVersion> }\n : { overrides?: UserOperationOverrides<TEntryPointVersion> };\n\n// [!region UserOperationPaymasterOverrides]\nexport type UserOperationPaymasterOverrides<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? {\n // paymasterData overrides to bypass paymaster middleware\n paymasterAndData: Hex;\n }\n : TEntryPointVersion extends \"0.7.0\"\n ? {\n // paymasterData overrides to bypass paymaster middleware\n // if set to '0x', all paymaster related fields are omitted from the user op request\n paymasterData: Hex;\n paymaster: Address;\n paymasterVerificationGasLimit:\n | NoUndefined<\n UserOperationStruct<\"0.7.0\">[\"paymasterVerificationGasLimit\"]\n >\n | Multiplier;\n paymasterPostOpGasLimit:\n | NoUndefined<UserOperationStruct<\"0.7.0\">[\"paymasterPostOpGasLimit\"]>\n | Multiplier;\n }\n : {};\n// [!endregion UserOperationOverridesParameter]\n\n// [!region UserOperationOverrides]\nexport type UserOperationOverrides<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = Partial<\n {\n callGasLimit:\n | UserOperationStruct<TEntryPointVersion>[\"callGasLimit\"]\n | Multiplier;\n maxFeePerGas:\n | UserOperationStruct<TEntryPointVersion>[\"maxFeePerGas\"]\n | Multiplier;\n maxPriorityFeePerGas:\n | UserOperationStruct<TEntryPointVersion>[\"maxPriorityFeePerGas\"]\n | Multiplier;\n preVerificationGas:\n | UserOperationStruct<TEntryPointVersion>[\"preVerificationGas\"]\n | Multiplier;\n verificationGasLimit:\n | UserOperationStruct<TEntryPointVersion>[\"verificationGasLimit\"]\n | Multiplier;\n /**\n * This can be used to override the key used when calling `entryPoint.getNonce`\n * It is useful when you want to use parallel nonces for user operations\n *\n * NOTE: not all bundlers fully support this feature and it could be that your bundler will still only include\n * one user operation for your account in a bundle\n */\n nonceKey: bigint;\n\n /**\n * The same state overrides for\n * [`eth_call`](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-eth#eth-call) method.\n * An address-to-state mapping, where each entry specifies some state to be ephemerally overridden\n * prior to executing the call. State overrides allow you to customize the network state for\n * the purpose of the simulation, so this feature is useful when you need to estimate gas\n * for user operation scenarios under conditions that aren’t currently present on the live network.\n */\n stateOverride: StateOverride;\n } & UserOperationPaymasterOverrides<TEntryPointVersion>\n>;\n// [!endregion UserOperationOverrides]\n\n// [!region UserOperationRequest_v6]\n// represents the request as it needs to be formatted for v0.6 RPC requests\n// Reference: https://github.com/ethereum/ERCs/blob/8dd085d159cb123f545c272c0d871a5339550e79/ERCS/erc-4337.md#definitions\nexport interface UserOperationRequest_v6 {\n /* the origin of the request */\n sender: Address;\n /* nonce (as hex) of the transaction, returned from the entry point for this Address */\n nonce: Hex;\n /* the initCode for creating the sender if it does not exist yet, otherwise \"0x\" */\n initCode: Hex | EmptyHex;\n /* the callData passed to the target */\n callData: Hex;\n /* Gas value (as hex) used by inner account execution */\n callGasLimit: Hex;\n /* Actual gas (as hex) used by the validation of this UserOperation */\n verificationGasLimit: Hex;\n /* Gas overhead (as hex) of this UserOperation */\n preVerificationGas: Hex;\n /* Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) (as hex)*/\n maxFeePerGas: Hex;\n /* Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) (as hex)*/\n maxPriorityFeePerGas: Hex;\n /* Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (\"0x\" for self-sponsored transaction) */\n paymasterAndData: Hex | EmptyHex;\n /* Data passed into the account along with the nonce during the verification step */\n signature: Hex;\n}\n// [!endregion UserOperationRequest_v6]\n\n// [!region UserOperationRequest_v7]\n// represents the request as it needs to be formatted for v0.7 RPC requests\n// Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions\nexport interface UserOperationRequest_v7 {\n /* the account making the operation */\n sender: Address;\n /* anti-replay parameter. nonce of the transaction, returned from the entry point for this address */\n nonce: Hex;\n /* account factory, only for new accounts */\n factory?: Address;\n /* data for account factory (only if account factory exists) */\n factoryData?: Hex;\n /* the data to pass to the sender during the main execution call */\n callData: Hex;\n /* the amount of gas to allocate the main execution call */\n callGasLimit: Hex;\n /* the amount of gas to allocate for the verification step */\n verificationGasLimit: Hex;\n /* extra gas to pay the bunder */\n preVerificationGas: Hex;\n /* maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas: Hex;\n /* maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas: Hex;\n /* address of paymaster contract, (or empty, if account pays for itself) */\n paymaster?: Address;\n /* the amount of gas to allocate for the paymaster validation code */\n paymasterVerificationGasLimit?: Hex;\n /* the amount of gas to allocate for the paymaster post-operation code */\n paymasterPostOpGasLimit?: Hex;\n /* data for paymaster (only if paymaster exists) */\n paymasterData?: Hex;\n /* data passed into the account to verify authorization */\n signature: Hex;\n}\n// [!endregion UserOperationRequest_v7]\n\n// [!region UserOperationRequest]\n// Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions\nexport type UserOperationRequest<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? UserOperationRequest_v6\n : TEntryPointVersion extends \"0.7.0\"\n ? UserOperationRequest_v7\n : never;\n\n// [!endregion UserOperationRequest]\n\n// [!region UserOperationEstimateGasResponse]\nexport interface UserOperationEstimateGasResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> {\n /* Gas overhead of this UserOperation */\n preVerificationGas: BigNumberish;\n /* Actual gas used by the validation of this UserOperation */\n verificationGasLimit: BigNumberish;\n /* Value used by inner account execution */\n callGasLimit: BigNumberish;\n /*\n * EntryPoint v0.7.0 operations only.\n * The amount of gas to allocate for the paymaster validation code.\n * Note: `eth_estimateUserOperationGas` does not return paymasterPostOpGasLimit.\n */\n paymasterVerificationGasLimit: TEntryPointVersion extends \"0.7.0\"\n ? BigNumberish | undefined\n : never;\n}\n// [!endregion UserOperationEstimateGasResponse]\n\n// [!region UserOperationResponse]\nexport interface UserOperationResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> {\n /* the User Operation */\n userOperation: UserOperationRequest<TEntryPointVersion>;\n /* the address of the entry point contract that executed the user operation */\n entryPoint: Address;\n /* the block number the user operation was included in */\n blockNumber: BigNumberish;\n /* the hash of the block the user operation was included in */\n blockHash: Hash;\n /* the hash of the transaction that included the user operation */\n transactionHash: Hash;\n}\n// [!endregion UserOperationResponse]\n\n// [!region UserOperationReceipt]\nexport interface UserOperationReceipt {\n /* The request hash of the UserOperation. */\n userOpHash: Hash;\n /* The entry point address used for the UserOperation. */\n entryPoint: Address;\n /* The account initiating the UserOperation. */\n sender: Address;\n /* The nonce used in the UserOperation. */\n nonce: BigNumberish;\n /* The paymaster used for this UserOperation (or empty). */\n paymaster?: Address;\n /* The actual amount paid (by account or paymaster) for this UserOperation. */\n actualGasCost: BigNumberish;\n /* The total gas used by this UserOperation (including preVerification, creation, validation, and execution). */\n actualGasUsed: BigNumberish;\n /* Indicates whether the execution completed without reverting. */\n success: boolean;\n /* In case of revert, this is the revert reason. */\n reason?: string;\n /* The logs generated by this UserOperation (not including logs of other UserOperations in the same bundle). */\n logs: string[];\n /* The TransactionReceipt object for the entire bundle, not only for this UserOperation. */\n receipt: TransactionReceipt;\n}\n// [!endregion UserOperationReceipt]\n\n/** @deprecated use viem type TransactionReceipt instead */\nexport interface UserOperationReceiptObject {\n /* 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log */\n blockHash: Hash;\n /* The block number where this log was in. null when its pending. null when its pending log. */\n blockNumber: BigNumberish;\n /* The index of the transaction within the block. */\n transactionIndex: BigNumberish;\n /* 32 Bytes - hash of the transaction. null when its pending. */\n transactionHash: Hash;\n /* 20 Bytes - address of the sender */\n from: Address;\n /* 20 Bytes - address of the receiver. null when its a contract creation transaction */\n to: Address;\n /* The total amount of gas used when this transaction was executed in the block. */\n cumulativeGasUsed: BigNumberish;\n /* The amount of gas used by this specific transaction alone */\n gasUsed: BigNumberish;\n /* 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null */\n contractAddress: Address;\n logs: UserOperationReceiptLog[];\n /* 256 Bytes - Bloom filter for light clients to quickly retrieve related logs */\n logsBloom: Hex;\n /* 32 bytes of post-transaction stateroot. (pre Byzantium hard fork at block 4,370,000) */\n root: Hex;\n /* Either 1 (success) or 0 (failure). (post Byzantium hard fork at block 4,370,000) */\n status: number;\n /* The cumulative gas used in the block containing this UserOperation. */\n effectiveGasPrice: BigNumberish;\n /* The type of the recipt object */\n type: string;\n}\n\n/** @deprecated use viem type Log instead */\n/* https://github.com/wevm/viem/blob/6ef4ac131a878bf1dc4b335f5dc127e62618dda0/src/types/log.ts#L15 */\nexport interface UserOperationReceiptLog {\n /* The hash of the block where the given transaction was included. */\n blockHash: Hash;\n /* The number of the block where the given transaction was included. */\n blockNumber: BigNumberish;\n /* The index of the transaction within the block. */\n transactionIndex: BigNumberish;\n /* 20 Bytes - address from which this log originated. */\n address: Address;\n /* Integer of the log index position in the block. null when its pending log. */\n logIndex: BigNumberish;\n /* Contains one or more 32 Bytes non-indexed arguments of the log. */\n data: Hex;\n /* true when the log was removed, due to a chain reorganization. false if its a valid log. */\n removed: boolean;\n /* Array of zero to four 32 Bytes DATA of indexed log arguments. */\n topics: string[];\n /* hash of the transaction */\n transactionHash: Hash;\n}\n\n// [!region UserOperationStruct_v6]\n// https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.6/test/UserOperation.ts\n// this is used for building requests for v0.6 entry point contract\nexport interface UserOperationStruct_v6 {\n /* the origin of the request */\n sender: string;\n /* nonce of the transaction, returned from the entry point for this address */\n nonce: BigNumberish;\n /* the initCode for creating the sender if it does not exist yet, otherwise \"0x\" */\n initCode: BytesLike | \"0x\";\n /* the callData passed to the target */\n callData: BytesLike;\n /* Value used by inner account execution */\n callGasLimit?: BigNumberish;\n /* Actual gas used by the validation of this UserOperation */\n verificationGasLimit?: BigNumberish;\n /* Gas overhead of this UserOperation */\n preVerificationGas?: BigNumberish;\n /* Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas?: BigNumberish;\n /* Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas?: BigNumberish;\n /* Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (\"0x\" for self-sponsored transaction) */\n paymasterAndData: BytesLike | \"0x\";\n /* Data passed into the account along with the nonce during the verification step */\n signature: BytesLike;\n}\n// [!endregion UserOperationStruct_v6]\n\n// [!region UserOperationStruct_v7]\n// based on https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.7/test/UserOperation.ts\n// this is used for building requests for v0.7 entry point contract\nexport interface UserOperationStruct_v7 {\n /* the account making the operation */\n sender: string;\n /* anti-replay parameter. nonce of the transaction, returned from the entry point for this address */\n nonce: BigNumberish;\n /* account factory, only for new accounts */\n factory?: string;\n /* data for account factory (only if account factory exists) */\n factoryData?: BytesLike;\n /* the data to pass to the sender during the main execution call */\n callData: BytesLike;\n /* the amount of gas to allocate the main execution call */\n callGasLimit?: BigNumberish;\n /* the amount of gas to allocate for the verification step */\n verificationGasLimit?: BigNumberish;\n /* extra gas to pay the bunder */\n preVerificationGas?: BigNumberish;\n /* maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas?: BigNumberish;\n /* maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas?: BigNumberish;\n /* address of paymaster contract, (or empty, if account pays for itself) */\n paymaster?: string;\n /* the amount of gas to allocate for the paymaster validation code */\n paymasterVerificationGasLimit?: BigNumberish;\n /* the amount of gas to allocate for the paymaster post-operation code */\n paymasterPostOpGasLimit?: BigNumberish;\n /* data for paymaster (only if paymaster exists) */\n paymasterData?: BytesLike;\n /* data passed into the account to verify authorization */\n signature: BytesLike;\n}\n// [!endregion UserOperationStruct_v7]\n\n// [!region UserOperationStruct]\nexport type UserOperationStruct<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? UserOperationStruct_v6\n : TEntryPointVersion extends \"0.7.0\"\n ? UserOperationStruct_v7\n : never;\n// [!endregion UserOperationStruct]\n"]}
@@ -1,10 +0,0 @@
1
- import type { BigNumberish, Multiplier } from "../types";
2
- export declare const bigIntMax: (...args: bigint[]) => bigint;
3
- export declare const bigIntMin: (...args: bigint[]) => bigint;
4
- export declare const bigIntClamp: (value: BigNumberish, lower: BigNumberish | null | undefined, upper: BigNumberish | null | undefined) => bigint;
5
- export declare enum RoundingMode {
6
- ROUND_DOWN = 0,
7
- ROUND_UP = 1
8
- }
9
- export declare const bigIntMultiply: (base: BigNumberish, multiplier: Multiplier["multiplier"], roundingMode?: RoundingMode) => bigint;
10
- export declare const stringToIndex: (phrase: string) => bigint;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringToIndex = exports.bigIntMultiply = exports.RoundingMode = exports.bigIntClamp = exports.bigIntMin = exports.bigIntMax = void 0;
4
- const viem_1 = require("viem");
5
- const schema_js_1 = require("./schema.js");
6
- const bigIntMax = (...args) => {
7
- if (!args.length) {
8
- throw new Error("bigIntMax requires at least one argument");
9
- }
10
- return args.reduce((m, c) => (m > c ? m : c));
11
- };
12
- exports.bigIntMax = bigIntMax;
13
- const bigIntMin = (...args) => {
14
- if (!args.length) {
15
- throw new Error("bigIntMin requires at least one argument");
16
- }
17
- return args.reduce((m, c) => (m < c ? m : c));
18
- };
19
- exports.bigIntMin = bigIntMin;
20
- const bigIntClamp = (value, lower, upper) => {
21
- lower = lower != null ? BigInt(lower) : null;
22
- upper = upper != null ? BigInt(upper) : null;
23
- if (upper != null && lower != null && upper < lower) {
24
- throw new Error(`invalid range: upper bound ${upper} is less than lower bound ${lower}`);
25
- }
26
- let ret = BigInt(value);
27
- if (lower != null && lower > ret) {
28
- ret = lower;
29
- }
30
- if (upper != null && upper < ret) {
31
- ret = upper;
32
- }
33
- return ret;
34
- };
35
- exports.bigIntClamp = bigIntClamp;
36
- var RoundingMode;
37
- (function (RoundingMode) {
38
- RoundingMode[RoundingMode["ROUND_DOWN"] = 0] = "ROUND_DOWN";
39
- RoundingMode[RoundingMode["ROUND_UP"] = 1] = "ROUND_UP";
40
- })(RoundingMode || (exports.RoundingMode = RoundingMode = {}));
41
- const bigIntMultiply = (base, multiplier, roundingMode = RoundingMode.ROUND_UP) => {
42
- if (!(0, schema_js_1.isMultiplier)({ multiplier })) {
43
- throw new Error("bigIntMultiply requires a multiplier validated number as the second argument");
44
- }
45
- const decimalPlaces = multiplier.toString().split(".")[1]?.length ?? 0;
46
- const val = roundingMode === RoundingMode.ROUND_UP
47
- ? BigInt(base) * BigInt(multiplier * 10 ** decimalPlaces) +
48
- BigInt(10 ** decimalPlaces - 1)
49
- : BigInt(base) * BigInt(multiplier * 10 ** decimalPlaces);
50
- return val / BigInt(10 ** decimalPlaces);
51
- };
52
- exports.bigIntMultiply = bigIntMultiply;
53
- const stringToIndex = (phrase) => BigInt((0, viem_1.keccak256)((0, viem_1.toHex)(phrase)));
54
- exports.stringToIndex = stringToIndex;
55
- //# sourceMappingURL=bigint.js.map