viem 2.17.11 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (439) hide show
  1. package/CHANGELOG.md +8 -2
  2. package/_cjs/account-abstraction/accounts/createWebAuthnCredential.js +6 -0
  3. package/_cjs/account-abstraction/accounts/createWebAuthnCredential.js.map +1 -0
  4. package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +688 -0
  5. package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -0
  6. package/_cjs/account-abstraction/accounts/implementations/toSoladySmartAccount.js +704 -0
  7. package/_cjs/account-abstraction/accounts/implementations/toSoladySmartAccount.js.map +1 -0
  8. package/_cjs/account-abstraction/accounts/toSmartAccount.js +93 -0
  9. package/_cjs/account-abstraction/accounts/toSmartAccount.js.map +1 -0
  10. package/_cjs/account-abstraction/accounts/toWebAuthnAccount.js +24 -0
  11. package/_cjs/account-abstraction/accounts/toWebAuthnAccount.js.map +1 -0
  12. package/_cjs/account-abstraction/accounts/types.js +3 -0
  13. package/_cjs/account-abstraction/accounts/types.js.map +1 -0
  14. package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js +37 -0
  15. package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -0
  16. package/_cjs/account-abstraction/actions/bundler/getSupportedEntryPoints.js +7 -0
  17. package/_cjs/account-abstraction/actions/bundler/getSupportedEntryPoints.js.map +1 -0
  18. package/_cjs/account-abstraction/actions/bundler/getUserOperation.js +22 -0
  19. package/_cjs/account-abstraction/actions/bundler/getUserOperation.js.map +1 -0
  20. package/_cjs/account-abstraction/actions/bundler/getUserOperationReceipt.js +15 -0
  21. package/_cjs/account-abstraction/actions/bundler/getUserOperationReceipt.js.map +1 -0
  22. package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js +239 -0
  23. package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -0
  24. package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js +36 -0
  25. package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -0
  26. package/_cjs/account-abstraction/actions/bundler/waitForUserOperationReceipt.js +48 -0
  27. package/_cjs/account-abstraction/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
  28. package/_cjs/account-abstraction/actions/paymaster/getPaymasterData.js +34 -0
  29. package/_cjs/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -0
  30. package/_cjs/account-abstraction/actions/paymaster/getPaymasterStubData.js +34 -0
  31. package/_cjs/account-abstraction/actions/paymaster/getPaymasterStubData.js.map +1 -0
  32. package/_cjs/account-abstraction/clients/createBundlerClient.js +18 -0
  33. package/_cjs/account-abstraction/clients/createBundlerClient.js.map +1 -0
  34. package/_cjs/account-abstraction/clients/createPaymasterClient.js +17 -0
  35. package/_cjs/account-abstraction/clients/createPaymasterClient.js.map +1 -0
  36. package/_cjs/account-abstraction/clients/decorators/bundler.js +24 -0
  37. package/_cjs/account-abstraction/clients/decorators/bundler.js.map +1 -0
  38. package/_cjs/account-abstraction/clients/decorators/paymaster.js +12 -0
  39. package/_cjs/account-abstraction/clients/decorators/paymaster.js.map +1 -0
  40. package/_cjs/account-abstraction/constants/abis.js +1318 -0
  41. package/_cjs/account-abstraction/constants/abis.js.map +1 -0
  42. package/_cjs/account-abstraction/constants/address.js +6 -0
  43. package/_cjs/account-abstraction/constants/address.js.map +1 -0
  44. package/_cjs/account-abstraction/errors/bundler.js +813 -0
  45. package/_cjs/account-abstraction/errors/bundler.js.map +1 -0
  46. package/_cjs/account-abstraction/errors/userOperation.js +91 -0
  47. package/_cjs/account-abstraction/errors/userOperation.js.map +1 -0
  48. package/_cjs/account-abstraction/index.js +90 -0
  49. package/_cjs/account-abstraction/index.js.map +1 -0
  50. package/_cjs/account-abstraction/types/account.js +3 -0
  51. package/_cjs/account-abstraction/types/account.js.map +1 -0
  52. package/_cjs/account-abstraction/types/entryPointVersion.js +3 -0
  53. package/_cjs/account-abstraction/types/entryPointVersion.js.map +1 -0
  54. package/_cjs/account-abstraction/types/rpc.js +3 -0
  55. package/_cjs/account-abstraction/types/rpc.js.map +1 -0
  56. package/_cjs/account-abstraction/types/userOperation.js +3 -0
  57. package/_cjs/account-abstraction/types/userOperation.js.map +1 -0
  58. package/_cjs/account-abstraction/utils/errors/getBundlerError.js +186 -0
  59. package/_cjs/account-abstraction/utils/errors/getBundlerError.js.map +1 -0
  60. package/_cjs/account-abstraction/utils/errors/getUserOperationError.js +87 -0
  61. package/_cjs/account-abstraction/utils/errors/getUserOperationError.js.map +1 -0
  62. package/_cjs/account-abstraction/utils/formatters/userOperation.js +24 -0
  63. package/_cjs/account-abstraction/utils/formatters/userOperation.js.map +1 -0
  64. package/_cjs/account-abstraction/utils/formatters/userOperationGas.js +18 -0
  65. package/_cjs/account-abstraction/utils/formatters/userOperationGas.js.map +1 -0
  66. package/_cjs/account-abstraction/utils/formatters/userOperationReceipt.js +18 -0
  67. package/_cjs/account-abstraction/utils/formatters/userOperationReceipt.js.map +1 -0
  68. package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js +43 -0
  69. package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -0
  70. package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js +88 -0
  71. package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -0
  72. package/_cjs/account-abstraction/utils/userOperation/toPackedUserOperation.js +44 -0
  73. package/_cjs/account-abstraction/utils/userOperation/toPackedUserOperation.js.map +1 -0
  74. package/_cjs/accounts/index.js +1 -3
  75. package/_cjs/accounts/index.js.map +1 -1
  76. package/_cjs/accounts/privateKeyToAccount.js +4 -0
  77. package/_cjs/accounts/privateKeyToAccount.js.map +1 -1
  78. package/_cjs/accounts/toAccount.js +1 -0
  79. package/_cjs/accounts/toAccount.js.map +1 -1
  80. package/_cjs/accounts/utils/parseAccount.js.map +1 -1
  81. package/_cjs/accounts/utils/sign.js +8 -2
  82. package/_cjs/accounts/utils/sign.js.map +1 -1
  83. package/_cjs/accounts/utils/signMessage.js +1 -3
  84. package/_cjs/accounts/utils/signMessage.js.map +1 -1
  85. package/_cjs/accounts/utils/signTypedData.js +2 -3
  86. package/_cjs/accounts/utils/signTypedData.js.map +1 -1
  87. package/_cjs/actions/wallet/sendTransaction.js +35 -22
  88. package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
  89. package/_cjs/actions/wallet/signMessage.js +1 -1
  90. package/_cjs/actions/wallet/signMessage.js.map +1 -1
  91. package/_cjs/actions/wallet/signTransaction.js +1 -2
  92. package/_cjs/actions/wallet/signTransaction.js.map +1 -1
  93. package/_cjs/actions/wallet/signTypedData.js +1 -1
  94. package/_cjs/actions/wallet/signTypedData.js.map +1 -1
  95. package/_cjs/constants/abis.js +0 -3
  96. package/_cjs/constants/abis.js.map +1 -1
  97. package/_cjs/constants/address.js +3 -1
  98. package/_cjs/constants/address.js.map +1 -1
  99. package/_cjs/errors/account.js +17 -2
  100. package/_cjs/errors/account.js.map +1 -1
  101. package/_cjs/errors/contract.js +1 -1
  102. package/_cjs/errors/contract.js.map +1 -1
  103. package/_cjs/errors/rpc.js +6 -6
  104. package/_cjs/errors/rpc.js.map +1 -1
  105. package/_cjs/errors/version.js +1 -1
  106. package/_cjs/errors/version.js.map +1 -1
  107. package/_cjs/index.js +5 -3
  108. package/_cjs/index.js.map +1 -1
  109. package/_cjs/types/eip1193.js.map +1 -1
  110. package/_cjs/utils/buildRequest.js +4 -2
  111. package/_cjs/utils/buildRequest.js.map +1 -1
  112. package/_cjs/utils/errors/getNodeError.js +1 -2
  113. package/_cjs/utils/errors/getNodeError.js.map +1 -1
  114. package/_cjs/utils/index.js +3 -1
  115. package/_cjs/utils/index.js.map +1 -1
  116. package/_cjs/utils/signature/serializeErc6492Signature.js +6 -2
  117. package/_cjs/utils/signature/serializeErc6492Signature.js.map +1 -1
  118. package/_cjs/utils/signature/serializeSignature.js +6 -2
  119. package/_cjs/utils/signature/serializeSignature.js.map +1 -1
  120. package/_cjs/utils/signature/verifyHash.js +10 -0
  121. package/_cjs/utils/signature/verifyHash.js.map +1 -0
  122. package/_esm/account-abstraction/accounts/createWebAuthnCredential.js +3 -0
  123. package/_esm/account-abstraction/accounts/createWebAuthnCredential.js.map +1 -0
  124. package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +709 -0
  125. package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -0
  126. package/_esm/account-abstraction/accounts/implementations/toSoladySmartAccount.js +718 -0
  127. package/_esm/account-abstraction/accounts/implementations/toSoladySmartAccount.js.map +1 -0
  128. package/_esm/account-abstraction/accounts/toSmartAccount.js +96 -0
  129. package/_esm/account-abstraction/accounts/toSmartAccount.js.map +1 -0
  130. package/_esm/account-abstraction/accounts/toWebAuthnAccount.js +26 -0
  131. package/_esm/account-abstraction/accounts/toWebAuthnAccount.js.map +1 -0
  132. package/_esm/account-abstraction/accounts/types.js +2 -0
  133. package/_esm/account-abstraction/accounts/types.js.map +1 -0
  134. package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js +61 -0
  135. package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -0
  136. package/_esm/account-abstraction/actions/bundler/getSupportedEntryPoints.js +25 -0
  137. package/_esm/account-abstraction/actions/bundler/getSupportedEntryPoints.js.map +1 -0
  138. package/_esm/account-abstraction/actions/bundler/getUserOperation.js +42 -0
  139. package/_esm/account-abstraction/actions/bundler/getUserOperation.js.map +1 -0
  140. package/_esm/account-abstraction/actions/bundler/getUserOperationReceipt.js +35 -0
  141. package/_esm/account-abstraction/actions/bundler/getUserOperationReceipt.js.map +1 -0
  142. package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js +323 -0
  143. package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -0
  144. package/_esm/account-abstraction/actions/bundler/sendUserOperation.js +60 -0
  145. package/_esm/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -0
  146. package/_esm/account-abstraction/actions/bundler/waitForUserOperationReceipt.js +68 -0
  147. package/_esm/account-abstraction/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
  148. package/_esm/account-abstraction/actions/paymaster/getPaymasterData.js +56 -0
  149. package/_esm/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -0
  150. package/_esm/account-abstraction/actions/paymaster/getPaymasterStubData.js +56 -0
  151. package/_esm/account-abstraction/actions/paymaster/getPaymasterStubData.js.map +1 -0
  152. package/_esm/account-abstraction/clients/createBundlerClient.js +15 -0
  153. package/_esm/account-abstraction/clients/createBundlerClient.js.map +1 -0
  154. package/_esm/account-abstraction/clients/createPaymasterClient.js +14 -0
  155. package/_esm/account-abstraction/clients/createPaymasterClient.js.map +1 -0
  156. package/_esm/account-abstraction/clients/decorators/bundler.js +21 -0
  157. package/_esm/account-abstraction/clients/decorators/bundler.js.map +1 -0
  158. package/_esm/account-abstraction/clients/decorators/paymaster.js +9 -0
  159. package/_esm/account-abstraction/clients/decorators/paymaster.js.map +1 -0
  160. package/_esm/account-abstraction/constants/abis.js +1315 -0
  161. package/_esm/account-abstraction/constants/abis.js.map +1 -0
  162. package/_esm/account-abstraction/constants/address.js +3 -0
  163. package/_esm/account-abstraction/constants/address.js.map +1 -0
  164. package/_esm/account-abstraction/errors/bundler.js +774 -0
  165. package/_esm/account-abstraction/errors/bundler.js.map +1 -0
  166. package/_esm/account-abstraction/errors/userOperation.js +84 -0
  167. package/_esm/account-abstraction/errors/userOperation.js.map +1 -0
  168. package/_esm/account-abstraction/index.js +31 -0
  169. package/_esm/account-abstraction/index.js.map +1 -0
  170. package/_esm/account-abstraction/types/account.js +2 -0
  171. package/_esm/account-abstraction/types/account.js.map +1 -0
  172. package/_esm/account-abstraction/types/entryPointVersion.js +2 -0
  173. package/_esm/account-abstraction/types/entryPointVersion.js.map +1 -0
  174. package/_esm/account-abstraction/types/rpc.js +2 -0
  175. package/_esm/account-abstraction/types/rpc.js.map +1 -0
  176. package/_esm/account-abstraction/types/userOperation.js +2 -0
  177. package/_esm/account-abstraction/types/userOperation.js.map +1 -0
  178. package/_esm/account-abstraction/utils/errors/getBundlerError.js +183 -0
  179. package/_esm/account-abstraction/utils/errors/getBundlerError.js.map +1 -0
  180. package/_esm/account-abstraction/utils/errors/getUserOperationError.js +85 -0
  181. package/_esm/account-abstraction/utils/errors/getUserOperationError.js.map +1 -0
  182. package/_esm/account-abstraction/utils/formatters/userOperation.js +21 -0
  183. package/_esm/account-abstraction/utils/formatters/userOperation.js.map +1 -0
  184. package/_esm/account-abstraction/utils/formatters/userOperationGas.js +15 -0
  185. package/_esm/account-abstraction/utils/formatters/userOperationGas.js.map +1 -0
  186. package/_esm/account-abstraction/utils/formatters/userOperationReceipt.js +15 -0
  187. package/_esm/account-abstraction/utils/formatters/userOperationReceipt.js.map +1 -0
  188. package/_esm/account-abstraction/utils/formatters/userOperationRequest.js +40 -0
  189. package/_esm/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -0
  190. package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js +85 -0
  191. package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -0
  192. package/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js +41 -0
  193. package/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js.map +1 -0
  194. package/_esm/accounts/index.js +0 -1
  195. package/_esm/accounts/index.js.map +1 -1
  196. package/_esm/accounts/privateKeyToAccount.js +4 -0
  197. package/_esm/accounts/privateKeyToAccount.js.map +1 -1
  198. package/_esm/accounts/toAccount.js +2 -0
  199. package/_esm/accounts/toAccount.js.map +1 -1
  200. package/_esm/accounts/utils/parseAccount.js.map +1 -1
  201. package/_esm/accounts/utils/sign.js +9 -3
  202. package/_esm/accounts/utils/sign.js.map +1 -1
  203. package/_esm/accounts/utils/signMessage.js +1 -3
  204. package/_esm/accounts/utils/signMessage.js.map +1 -1
  205. package/_esm/accounts/utils/signTypedData.js +2 -3
  206. package/_esm/accounts/utils/signTypedData.js.map +1 -1
  207. package/_esm/actions/wallet/sendTransaction.js +37 -24
  208. package/_esm/actions/wallet/sendTransaction.js.map +1 -1
  209. package/_esm/actions/wallet/signMessage.js +1 -1
  210. package/_esm/actions/wallet/signMessage.js.map +1 -1
  211. package/_esm/actions/wallet/signTransaction.js +1 -2
  212. package/_esm/actions/wallet/signTransaction.js.map +1 -1
  213. package/_esm/actions/wallet/signTypedData.js +1 -1
  214. package/_esm/actions/wallet/signTypedData.js.map +1 -1
  215. package/_esm/constants/abis.js +0 -3
  216. package/_esm/constants/abis.js.map +1 -1
  217. package/_esm/constants/address.js +2 -0
  218. package/_esm/constants/address.js.map +1 -1
  219. package/_esm/errors/account.js +15 -1
  220. package/_esm/errors/account.js.map +1 -1
  221. package/_esm/errors/contract.js +1 -1
  222. package/_esm/errors/contract.js.map +1 -1
  223. package/_esm/errors/rpc.js +6 -6
  224. package/_esm/errors/rpc.js.map +1 -1
  225. package/_esm/errors/version.js +1 -1
  226. package/_esm/errors/version.js.map +1 -1
  227. package/_esm/index.js +1 -0
  228. package/_esm/index.js.map +1 -1
  229. package/_esm/types/eip1193.js.map +1 -1
  230. package/_esm/utils/buildRequest.js +4 -2
  231. package/_esm/utils/buildRequest.js.map +1 -1
  232. package/_esm/utils/errors/getNodeError.js +1 -2
  233. package/_esm/utils/errors/getNodeError.js.map +1 -1
  234. package/_esm/utils/index.js +1 -0
  235. package/_esm/utils/index.js.map +1 -1
  236. package/_esm/utils/signature/serializeErc6492Signature.js +6 -2
  237. package/_esm/utils/signature/serializeErc6492Signature.js.map +1 -1
  238. package/_esm/utils/signature/serializeSignature.js +6 -2
  239. package/_esm/utils/signature/serializeSignature.js.map +1 -1
  240. package/_esm/utils/signature/verifyHash.js +19 -0
  241. package/_esm/utils/signature/verifyHash.js.map +1 -0
  242. package/_types/account-abstraction/accounts/createWebAuthnCredential.d.ts +2 -0
  243. package/_types/account-abstraction/accounts/createWebAuthnCredential.d.ts.map +1 -0
  244. package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts +648 -0
  245. package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts.map +1 -0
  246. package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts +464 -0
  247. package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts.map +1 -0
  248. package/_types/account-abstraction/accounts/toSmartAccount.d.ts +14 -0
  249. package/_types/account-abstraction/accounts/toSmartAccount.d.ts.map +1 -0
  250. package/_types/account-abstraction/accounts/toWebAuthnAccount.d.ts +32 -0
  251. package/_types/account-abstraction/accounts/toWebAuthnAccount.d.ts.map +1 -0
  252. package/_types/account-abstraction/accounts/types.d.ts +174 -0
  253. package/_types/account-abstraction/accounts/types.d.ts.map +1 -0
  254. package/_types/account-abstraction/actions/bundler/estimateUserOperationGas.d.ts +62 -0
  255. package/_types/account-abstraction/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
  256. package/_types/account-abstraction/actions/bundler/getSupportedEntryPoints.d.ts +30 -0
  257. package/_types/account-abstraction/actions/bundler/getSupportedEntryPoints.d.ts.map +1 -0
  258. package/_types/account-abstraction/actions/bundler/getUserOperation.d.ts +57 -0
  259. package/_types/account-abstraction/actions/bundler/getUserOperation.d.ts.map +1 -0
  260. package/_types/account-abstraction/actions/bundler/getUserOperationReceipt.d.ts +39 -0
  261. package/_types/account-abstraction/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
  262. package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts +106 -0
  263. package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts.map +1 -0
  264. package/_types/account-abstraction/actions/bundler/sendUserOperation.d.ts +60 -0
  265. package/_types/account-abstraction/actions/bundler/sendUserOperation.d.ts.map +1 -0
  266. package/_types/account-abstraction/actions/bundler/waitForUserOperationReceipt.d.ts +52 -0
  267. package/_types/account-abstraction/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
  268. package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts +49 -0
  269. package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts.map +1 -0
  270. package/_types/account-abstraction/actions/paymaster/getPaymasterStubData.d.ts +55 -0
  271. package/_types/account-abstraction/actions/paymaster/getPaymasterStubData.d.ts.map +1 -0
  272. package/_types/account-abstraction/clients/createBundlerClient.d.ts +66 -0
  273. package/_types/account-abstraction/clients/createBundlerClient.d.ts.map +1 -0
  274. package/_types/account-abstraction/clients/createPaymasterClient.d.ts +27 -0
  275. package/_types/account-abstraction/clients/createPaymasterClient.d.ts.map +1 -0
  276. package/_types/account-abstraction/clients/decorators/bundler.d.ts +206 -0
  277. package/_types/account-abstraction/clients/decorators/bundler.d.ts.map +1 -0
  278. package/_types/account-abstraction/clients/decorators/paymaster.d.ts +60 -0
  279. package/_types/account-abstraction/clients/decorators/paymaster.d.ts.map +1 -0
  280. package/_types/account-abstraction/constants/abis.d.ts +1468 -0
  281. package/_types/account-abstraction/constants/abis.d.ts.map +1 -0
  282. package/_types/account-abstraction/constants/address.d.ts +3 -0
  283. package/_types/account-abstraction/constants/address.d.ts.map +1 -0
  284. package/_types/account-abstraction/errors/bundler.d.ts +391 -0
  285. package/_types/account-abstraction/errors/bundler.d.ts.map +1 -0
  286. package/_types/account-abstraction/errors/userOperation.d.ts +41 -0
  287. package/_types/account-abstraction/errors/userOperation.d.ts.map +1 -0
  288. package/_types/account-abstraction/index.d.ts +34 -0
  289. package/_types/account-abstraction/index.d.ts.map +1 -0
  290. package/_types/account-abstraction/types/account.d.ts +11 -0
  291. package/_types/account-abstraction/types/account.d.ts.map +1 -0
  292. package/_types/account-abstraction/types/entryPointVersion.d.ts +9 -0
  293. package/_types/account-abstraction/types/entryPointVersion.d.ts.map +1 -0
  294. package/_types/account-abstraction/types/rpc.d.ts +9 -0
  295. package/_types/account-abstraction/types/rpc.d.ts.map +1 -0
  296. package/_types/account-abstraction/types/userOperation.d.ts +157 -0
  297. package/_types/account-abstraction/types/userOperation.d.ts.map +1 -0
  298. package/_types/account-abstraction/utils/errors/getBundlerError.d.ts +8 -0
  299. package/_types/account-abstraction/utils/errors/getBundlerError.d.ts.map +1 -0
  300. package/_types/account-abstraction/utils/errors/getUserOperationError.d.ts +15 -0
  301. package/_types/account-abstraction/utils/errors/getUserOperationError.d.ts.map +1 -0
  302. package/_types/account-abstraction/utils/formatters/userOperation.d.ts +6 -0
  303. package/_types/account-abstraction/utils/formatters/userOperation.d.ts.map +1 -0
  304. package/_types/account-abstraction/utils/formatters/userOperationGas.d.ts +6 -0
  305. package/_types/account-abstraction/utils/formatters/userOperationGas.d.ts.map +1 -0
  306. package/_types/account-abstraction/utils/formatters/userOperationReceipt.d.ts +6 -0
  307. package/_types/account-abstraction/utils/formatters/userOperationReceipt.d.ts.map +1 -0
  308. package/_types/account-abstraction/utils/formatters/userOperationRequest.d.ts +7 -0
  309. package/_types/account-abstraction/utils/formatters/userOperationRequest.d.ts.map +1 -0
  310. package/_types/account-abstraction/utils/userOperation/getUserOperationHash.d.ts +13 -0
  311. package/_types/account-abstraction/utils/userOperation/getUserOperationHash.d.ts.map +1 -0
  312. package/_types/account-abstraction/utils/userOperation/toPackedUserOperation.d.ts +3 -0
  313. package/_types/account-abstraction/utils/userOperation/toPackedUserOperation.d.ts.map +1 -0
  314. package/_types/accounts/index.d.ts +0 -1
  315. package/_types/accounts/index.d.ts.map +1 -1
  316. package/_types/accounts/privateKeyToAccount.d.ts +2 -1
  317. package/_types/accounts/privateKeyToAccount.d.ts.map +1 -1
  318. package/_types/accounts/toAccount.d.ts.map +1 -1
  319. package/_types/accounts/types.d.ts +14 -7
  320. package/_types/accounts/types.d.ts.map +1 -1
  321. package/_types/accounts/utils/parseAccount.d.ts +1 -1
  322. package/_types/accounts/utils/parseAccount.d.ts.map +1 -1
  323. package/_types/accounts/utils/sign.d.ts +9 -6
  324. package/_types/accounts/utils/sign.d.ts.map +1 -1
  325. package/_types/accounts/utils/signMessage.d.ts +1 -2
  326. package/_types/accounts/utils/signMessage.d.ts.map +1 -1
  327. package/_types/accounts/utils/signTypedData.d.ts +1 -2
  328. package/_types/accounts/utils/signTypedData.d.ts.map +1 -1
  329. package/_types/actions/wallet/sendTransaction.d.ts +2 -1
  330. package/_types/actions/wallet/sendTransaction.d.ts.map +1 -1
  331. package/_types/actions/wallet/signMessage.d.ts.map +1 -1
  332. package/_types/actions/wallet/signTransaction.d.ts.map +1 -1
  333. package/_types/chains/definitions/lisk.d.ts +2 -2
  334. package/_types/chains/definitions/playfiAlbireo.d.ts +2 -2
  335. package/_types/chains/definitions/zkSync.d.ts +2 -2
  336. package/_types/chains/definitions/zkSyncInMemoryNode.d.ts +2 -2
  337. package/_types/chains/definitions/zkSyncLocalNode.d.ts +2 -2
  338. package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts +2 -2
  339. package/_types/chains/definitions/zkSyncTestnet.d.ts +2 -2
  340. package/_types/clients/decorators/public.d.ts +1 -1
  341. package/_types/clients/decorators/public.d.ts.map +1 -1
  342. package/_types/constants/abis.d.ts +0 -3
  343. package/_types/constants/abis.d.ts.map +1 -1
  344. package/_types/constants/address.d.ts +2 -0
  345. package/_types/constants/address.d.ts.map +1 -1
  346. package/_types/errors/account.d.ts +11 -0
  347. package/_types/errors/account.d.ts.map +1 -1
  348. package/_types/errors/rpc.d.ts +9 -3
  349. package/_types/errors/rpc.d.ts.map +1 -1
  350. package/_types/errors/version.d.ts +1 -1
  351. package/_types/errors/version.d.ts.map +1 -1
  352. package/_types/index.d.ts +5 -3
  353. package/_types/index.d.ts.map +1 -1
  354. package/_types/types/eip1193.d.ts +239 -2
  355. package/_types/types/eip1193.d.ts.map +1 -1
  356. package/_types/types/multicall.d.ts +1 -1
  357. package/_types/types/multicall.d.ts.map +1 -1
  358. package/_types/utils/buildRequest.d.ts.map +1 -1
  359. package/_types/utils/errors/getNodeError.d.ts.map +1 -1
  360. package/_types/utils/formatters/transaction.d.ts +1 -1
  361. package/_types/utils/index.d.ts +1 -0
  362. package/_types/utils/index.d.ts.map +1 -1
  363. package/_types/utils/signature/hashTypedData.d.ts +2 -2
  364. package/_types/utils/signature/hashTypedData.d.ts.map +1 -1
  365. package/_types/utils/signature/serializeErc6492Signature.d.ts +7 -4
  366. package/_types/utils/signature/serializeErc6492Signature.d.ts.map +1 -1
  367. package/_types/utils/signature/serializeSignature.d.ts +8 -2
  368. package/_types/utils/signature/serializeSignature.d.ts.map +1 -1
  369. package/_types/utils/signature/verifyHash.d.ts +30 -0
  370. package/_types/utils/signature/verifyHash.d.ts.map +1 -0
  371. package/_types/zksync/chainConfig.d.ts +2 -2
  372. package/_types/zksync/formatters.d.ts +2 -2
  373. package/account-abstraction/accounts/createWebAuthnCredential.ts +7 -0
  374. package/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.ts +817 -0
  375. package/account-abstraction/accounts/implementations/toSoladySmartAccount.ts +794 -0
  376. package/account-abstraction/accounts/toSmartAccount.ts +126 -0
  377. package/account-abstraction/accounts/toWebAuthnAccount.ts +56 -0
  378. package/account-abstraction/accounts/types.ts +208 -0
  379. package/account-abstraction/actions/bundler/estimateUserOperationGas.ts +170 -0
  380. package/account-abstraction/actions/bundler/getSupportedEntryPoints.ts +33 -0
  381. package/account-abstraction/actions/bundler/getUserOperation.ts +85 -0
  382. package/account-abstraction/actions/bundler/getUserOperationReceipt.ts +64 -0
  383. package/account-abstraction/actions/bundler/prepareUserOperation.ts +637 -0
  384. package/account-abstraction/actions/bundler/sendUserOperation.ts +149 -0
  385. package/account-abstraction/actions/bundler/waitForUserOperationReceipt.ts +139 -0
  386. package/account-abstraction/actions/paymaster/getPaymasterData.ts +135 -0
  387. package/account-abstraction/actions/paymaster/getPaymasterStubData.ts +138 -0
  388. package/account-abstraction/clients/createBundlerClient.ts +155 -0
  389. package/account-abstraction/clients/createPaymasterClient.ts +78 -0
  390. package/account-abstraction/clients/decorators/bundler.ts +296 -0
  391. package/account-abstraction/clients/decorators/paymaster.ts +81 -0
  392. package/account-abstraction/constants/abis.ts +1404 -0
  393. package/account-abstraction/constants/address.ts +4 -0
  394. package/account-abstraction/errors/bundler.ts +781 -0
  395. package/account-abstraction/errors/userOperation.ts +111 -0
  396. package/account-abstraction/index.ts +228 -0
  397. package/account-abstraction/package.json +6 -0
  398. package/account-abstraction/types/account.ts +21 -0
  399. package/account-abstraction/types/entryPointVersion.ts +24 -0
  400. package/account-abstraction/types/rpc.ts +29 -0
  401. package/account-abstraction/types/userOperation.ts +262 -0
  402. package/account-abstraction/utils/errors/getBundlerError.ts +309 -0
  403. package/account-abstraction/utils/errors/getUserOperationError.ts +153 -0
  404. package/account-abstraction/utils/formatters/userOperation.ts +31 -0
  405. package/account-abstraction/utils/formatters/userOperationGas.ts +26 -0
  406. package/account-abstraction/utils/formatters/userOperationReceipt.ts +24 -0
  407. package/account-abstraction/utils/formatters/userOperationRequest.ts +53 -0
  408. package/account-abstraction/utils/userOperation/getUserOperationHash.ts +138 -0
  409. package/account-abstraction/utils/userOperation/toPackedUserOperation.ts +64 -0
  410. package/accounts/index.ts +1 -1
  411. package/accounts/privateKeyToAccount.ts +5 -0
  412. package/accounts/toAccount.ts +3 -0
  413. package/accounts/types.ts +34 -12
  414. package/accounts/utils/parseAccount.ts +6 -3
  415. package/accounts/utils/sign.ts +24 -8
  416. package/accounts/utils/signMessage.ts +1 -7
  417. package/accounts/utils/signTypedData.ts +2 -7
  418. package/actions/wallet/sendTransaction.ts +48 -27
  419. package/actions/wallet/signMessage.ts +2 -1
  420. package/actions/wallet/signTransaction.ts +1 -2
  421. package/actions/wallet/signTypedData.ts +1 -1
  422. package/clients/decorators/public.ts +1 -1
  423. package/constants/abis.ts +0 -3
  424. package/constants/address.ts +4 -0
  425. package/errors/account.ts +22 -1
  426. package/errors/contract.ts +1 -1
  427. package/errors/rpc.ts +6 -6
  428. package/errors/version.ts +1 -1
  429. package/index.ts +20 -3
  430. package/package.json +7 -1
  431. package/types/eip1193.ts +314 -2
  432. package/types/multicall.ts +1 -1
  433. package/utils/buildRequest.ts +4 -2
  434. package/utils/errors/getNodeError.ts +1 -2
  435. package/utils/index.ts +6 -0
  436. package/utils/signature/hashTypedData.ts +6 -6
  437. package/utils/signature/serializeErc6492Signature.ts +17 -8
  438. package/utils/signature/serializeSignature.ts +24 -4
  439. package/utils/signature/verifyHash.ts +54 -0
@@ -0,0 +1,174 @@
1
+ import type { Abi, Address, TypedData } from 'abitype';
2
+ import type { SignReturnType as WebAuthnSignReturnType } from 'webauthn-p256';
3
+ import type { Client } from '../../clients/createClient.js';
4
+ import type { Hash, Hex, SignableMessage } from '../../types/misc.js';
5
+ import type { TypedDataDefinition } from '../../types/typedData.js';
6
+ import type { Assign, ExactPartial, UnionPartialBy } from '../../types/utils.js';
7
+ import type { EntryPointVersion } from '../types/entryPointVersion.js';
8
+ import type { EstimateUserOperationGasReturnType, UserOperation, UserOperationRequest } from '../types/userOperation.js';
9
+ type Call = {
10
+ to: Hex;
11
+ data?: Hex | undefined;
12
+ value?: bigint | undefined;
13
+ };
14
+ export type SmartAccountImplementation<entryPointAbi extends Abi | readonly unknown[] = Abi, entryPointVersion extends EntryPointVersion = EntryPointVersion, extend extends object = object> = {
15
+ /** Client used to retrieve Smart Account data, and perform signing (if owner is a JSON-RPC Account). */
16
+ client: Client;
17
+ /** Compatible EntryPoint of the Smart Account. */
18
+ entryPoint: {
19
+ /** Compatible EntryPoint ABI. */
20
+ abi: entryPointAbi;
21
+ /** Compatible EntryPoint address. */
22
+ address: Address;
23
+ /** Compatible EntryPoint version. */
24
+ version: entryPointVersion;
25
+ };
26
+ /** Extend the Smart Account with custom properties. */
27
+ extend?: extend | undefined;
28
+ /**
29
+ * Retrieves the Smart Account's address.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const address = await account.getAddress()
34
+ * // '0x...'
35
+ * ```
36
+ */
37
+ getAddress: () => Promise<Address>;
38
+ /**
39
+ * Encodes the calls into calldata for executing a User Operation.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const callData = await account.encodeCalls([
44
+ * { to: '0x...', data: '0x...' },
45
+ * { to: '0x...', data: '0x...', value: 100n },
46
+ * ])
47
+ * // '0x...'
48
+ * ```
49
+ */
50
+ encodeCalls: (calls: readonly Call[]) => Promise<Hex>;
51
+ /**
52
+ * Retrieves the calldata for factory call to deploy a Smart Account.
53
+ * If the Smart Account has already been deployed, this will return undefined values.
54
+ *
55
+ * @example Counterfactual account
56
+ * ```ts
57
+ * const { factory, factoryData } = await account.getFactoryArgs()
58
+ * // { factory: '0x...', factoryData: '0x...' }
59
+ * ```
60
+ *
61
+ * @example Deployed account
62
+ * ```ts
63
+ * const { factory, factoryData } = await account.getFactoryArgs()
64
+ * // { factory: undefined, factoryData: undefined }
65
+ * ```
66
+ */
67
+ getFactoryArgs: () => Promise<{
68
+ factory?: Address | undefined;
69
+ factoryData?: Hex | undefined;
70
+ }>;
71
+ /**
72
+ * Retrieves the nonce of the Account.
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * const nonce = await account.getNonce()
77
+ * // 1n
78
+ * ```
79
+ */
80
+ getNonce: (parameters?: {
81
+ key?: bigint | undefined;
82
+ } | undefined) => Promise<bigint>;
83
+ /**
84
+ * Retrieves the User Operation "stub" signature for gas estimation.
85
+ *
86
+ * ```ts
87
+ * const signature = await account.getStubSignature()
88
+ * // '0x...'
89
+ * ```
90
+ */
91
+ getStubSignature: () => Promise<Hex>;
92
+ /**
93
+ * Signs a hash via the Smart Account's owner.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * const signature = await account.sign({
98
+ * hash: '0x...'
99
+ * })
100
+ * // '0x...'
101
+ * ```
102
+ */
103
+ sign?: ((parameters: {
104
+ hash: Hash;
105
+ }) => Promise<Hex>) | undefined;
106
+ /**
107
+ * Signs a [EIP-191 Personal Sign message](https://eips.ethereum.org/EIPS/eip-191).
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * const signature = await account.signMessage({
112
+ * message: 'Hello, World!'
113
+ * })
114
+ * // '0x...'
115
+ * ```
116
+ */
117
+ signMessage: (parameters: {
118
+ message: SignableMessage;
119
+ }) => Promise<Hex>;
120
+ /**
121
+ * Signs [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712).
122
+ *
123
+ * @example
124
+ * ```ts
125
+ * const signature = await account.signTypedData({
126
+ * domain,
127
+ * types,
128
+ * primaryType: 'Mail',
129
+ * message,
130
+ * })
131
+ * ```
132
+ */
133
+ signTypedData: <const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(parameters: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
134
+ /**
135
+ * Signs the User Operation.
136
+ *
137
+ * @example
138
+ * ```ts
139
+ * const signature = await account.signUserOperation({
140
+ * chainId: 1,
141
+ * userOperation,
142
+ * })
143
+ * ```
144
+ */
145
+ signUserOperation: (parameters: UnionPartialBy<UserOperation, 'sender'> & {
146
+ chainId?: number | undefined;
147
+ }) => Promise<Hex>;
148
+ /** User Operation configuration properties. */
149
+ userOperation?: {
150
+ /** Prepares gas properties for the User Operation request. */
151
+ estimateGas?: ((userOperation: UserOperationRequest) => Promise<ExactPartial<EstimateUserOperationGasReturnType> | undefined>) | undefined;
152
+ } | undefined;
153
+ };
154
+ export type SmartAccount<implementation extends SmartAccountImplementation = SmartAccountImplementation> = Assign<implementation['extend'], Assign<implementation, {
155
+ /** Address of the Smart Account. */
156
+ address: Address;
157
+ /** Whether or not the Smart Account has been deployed. */
158
+ isDeployed: () => Promise<boolean>;
159
+ /** Type of account. */
160
+ type: 'smart';
161
+ }>>;
162
+ export type WebAuthnAccount = {
163
+ publicKey: Hex;
164
+ sign: ({ hash }: {
165
+ hash: Hash;
166
+ }) => Promise<WebAuthnSignReturnType>;
167
+ signMessage: ({ message, }: {
168
+ message: SignableMessage;
169
+ }) => Promise<WebAuthnSignReturnType>;
170
+ signTypedData: <const typedData extends TypedDataDefinition | Record<string, unknown>, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<WebAuthnSignReturnType>;
171
+ type: 'webAuthn';
172
+ };
173
+ export {};
174
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../account-abstraction/accounts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAE7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,KAAK,EACV,kCAAkC,EAClC,aAAa,EACb,oBAAoB,EACrB,MAAM,2BAA2B,CAAA;AAElC,KAAK,IAAI,GAAG;IACV,EAAE,EAAE,GAAG,CAAA;IACP,IAAI,CAAC,EAAE,GAAG,GAAG,SAAS,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,0BAA0B,CACpC,aAAa,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EACpD,iBAAiB,SAAS,iBAAiB,GAAG,iBAAiB,EAC/D,MAAM,SAAS,MAAM,GAAG,MAAM,IAC5B;IACF,wGAAwG;IACxG,MAAM,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,UAAU,EAAE;QACV,iCAAiC;QACjC,GAAG,EAAE,aAAa,CAAA;QAClB,qCAAqC;QACrC,OAAO,EAAE,OAAO,CAAA;QAChB,qCAAqC;QACrC,OAAO,EAAE,iBAAi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AE,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,KAC7D,OAAO,CAAC,sBAAsB,CAAC,CAAA;IACpC,IAAI,EAAE,UAAU,CAAA;CACjB,CAAA"}
@@ -0,0 +1,62 @@
1
+ import type { Address, Narrow } from 'abitype';
2
+ import { type ParseAccountErrorType } from '../../../accounts/utils/parseAccount.js';
3
+ import type { Client } from '../../../clients/createClient.js';
4
+ import type { Transport } from '../../../clients/transports/createTransport.js';
5
+ import type { ErrorType } from '../../../errors/utils.js';
6
+ import type { Chain } from '../../../types/chain.js';
7
+ import type { Hex } from '../../../types/misc.js';
8
+ import type { Assign, OneOf, Prettify } from '../../../types/utils.js';
9
+ import type { RequestErrorType } from '../../../utils/buildRequest.js';
10
+ import type { SmartAccount } from '../../accounts/types.js';
11
+ import type { PaymasterActions } from '../../clients/decorators/paymaster.js';
12
+ import type { DeriveSmartAccount, GetSmartAccountParameter } from '../../types/account.js';
13
+ import type { DeriveEntryPointVersion, EntryPointVersion } from '../../types/entryPointVersion.js';
14
+ import type { EstimateUserOperationGasReturnType as EstimateUserOperationGasReturnType_, UserOperationCalls, UserOperationRequest } from '../../types/userOperation.js';
15
+ import { type FormatUserOperationGasErrorType } from '../../utils/formatters/userOperationGas.js';
16
+ import { type FormatUserOperationRequestErrorType } from '../../utils/formatters/userOperationRequest.js';
17
+ import { type PrepareUserOperationErrorType } from './prepareUserOperation.js';
18
+ export type EstimateUserOperationGasParameters<account extends SmartAccount | undefined = SmartAccount | undefined, accountOverride extends SmartAccount | undefined = SmartAccount | undefined, calls extends readonly unknown[] = readonly unknown[], _derivedAccount extends SmartAccount | undefined = DeriveSmartAccount<account, accountOverride>, _derivedVersion extends EntryPointVersion = DeriveEntryPointVersion<_derivedAccount>> = Assign<UserOperationRequest<_derivedVersion>, OneOf<{
19
+ calls: UserOperationCalls<Narrow<calls>>;
20
+ } | {
21
+ callData: Hex;
22
+ }> & {
23
+ paymaster?: Address | true | {
24
+ /** Retrieves paymaster-related User Operation properties to be used for sending the User Operation. */
25
+ getPaymasterData?: PaymasterActions['getPaymasterData'] | undefined;
26
+ /** Retrieves paymaster-related User Operation properties to be used for gas estimation. */
27
+ getPaymasterStubData?: PaymasterActions['getPaymasterStubData'] | undefined;
28
+ } | undefined;
29
+ /** Paymaster context to pass to `getPaymasterData` and `getPaymasterStubData` calls. */
30
+ paymasterContext?: unknown | undefined;
31
+ }> & GetSmartAccountParameter<account, accountOverride>;
32
+ export type EstimateUserOperationGasReturnType<account extends SmartAccount | undefined = SmartAccount | undefined, accountOverride extends SmartAccount | undefined = SmartAccount | undefined, _derivedAccount extends SmartAccount | undefined = DeriveSmartAccount<account, accountOverride>, _derivedVersion extends EntryPointVersion = DeriveEntryPointVersion<_derivedAccount>> = Prettify<EstimateUserOperationGasReturnType_<_derivedVersion>>;
33
+ export type EstimateUserOperationGasErrorType = ParseAccountErrorType | PrepareUserOperationErrorType | FormatUserOperationRequestErrorType | FormatUserOperationGasErrorType | RequestErrorType | ErrorType;
34
+ /**
35
+ * Returns an estimate of gas values necessary to execute the User Operation.
36
+ *
37
+ * - Docs: https://viem.sh/actions/bundler/estimateUserOperationGas
38
+ *
39
+ * @param client - Client to use
40
+ * @param parameters - {@link EstimateUserOperationGasParameters}
41
+ * @returns The gas estimate (in wei). {@link EstimateUserOperationGasReturnType}
42
+ *
43
+ * @example
44
+ * import { createBundlerClient, http, parseEther } from 'viem'
45
+ * import { toSmartAccount } from 'viem/accounts'
46
+ * import { mainnet } from 'viem/chains'
47
+ * import { estimateUserOperationGas } from 'viem/actions'
48
+ *
49
+ * const account = await toSmartAccount({ ... })
50
+ *
51
+ * const bundlerClient = createBundlerClient({
52
+ * chain: mainnet,
53
+ * transport: http(),
54
+ * })
55
+ *
56
+ * const values = await estimateUserOperationGas(bundlerClient, {
57
+ * account,
58
+ * calls: [{ to: '0x...', value: parseEther('1') }],
59
+ * })
60
+ */
61
+ export declare function estimateUserOperationGas<const calls extends readonly unknown[], account extends SmartAccount | undefined, accountOverride extends SmartAccount | undefined = undefined>(client: Client<Transport, Chain | undefined, account>, parameters: EstimateUserOperationGasParameters<account, accountOverride, calls>): Promise<EstimateUserOperationGasReturnType<account, accountOverride>>;
62
+ //# sourceMappingURL=estimateUserOperationGas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimateUserOperationGas.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAG/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EACV,kCAAkC,IAAI,mCAAmC,EAEzE,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EACL,KAAK,+BAA+B,E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S,GAAG,kBAAkB,CACnE,OAAO,EACP,eAAe,CAChB,EACD,eAAe,SACb,iBAAiB,GAAG,uBAAuB,CAAC,eAAe,CAAC,IAC5D,QAAQ,CAAC,mCAAmC,CAAC,eAAe,CAAC,CAAC,CAAA;AAElE,MAAM,MAAM,iCAAiC,GACzC,qBAAqB,GACrB,6BAA6B,GAC7B,mCAAmC,GACnC,+BAA+B,GAC/B,gBAAgB,GAChB,SAAS,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,wBAAwB,CAC5C,KAAK,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,EACtC,OAAO,SAAS,YAAY,GAAG,SAAS,EACxC,eAAe,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,EAE5D,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,CAAC,EACrD,UAAU,EAAE,kCAAkC,CAC5C,OAAO,EACP,eAAe,EACf,KAAK,CACN,GACA,OAAO,CAAC,kCAAkC,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAiCvE"}
@@ -0,0 +1,30 @@
1
+ import type { Address } from 'abitype';
2
+ import type { Client } from '../../../clients/createClient.js';
3
+ import type { Transport } from '../../../clients/transports/createTransport.js';
4
+ import type { ErrorType } from '../../../errors/utils.js';
5
+ import type { RequestErrorType } from '../../../utils/buildRequest.js';
6
+ export type GetSupportedEntryPointsReturnType = readonly Address[];
7
+ export type GetSupportedEntryPointsErrorType = RequestErrorType | ErrorType;
8
+ /**
9
+ * Returns the EntryPoints that the bundler supports.
10
+ *
11
+ * - Docs: https://viem.sh/actions/bundler/getSupportedEntryPoints
12
+ *
13
+ * @param client - Client to use
14
+ * @param parameters - {@link GetSupportedEntryPointsParameters}
15
+ * @returns Supported Entry Points. {@link GetSupportedEntryPointsReturnType}
16
+ *
17
+ * @example
18
+ * import { createBundlerClient, http, parseEther } from 'viem'
19
+ * import { mainnet } from 'viem/chains'
20
+ * import { getSupportedEntryPoints } from 'viem/actions'
21
+ *
22
+ * const bundlerClient = createBundlerClient({
23
+ * chain: mainnet,
24
+ * transport: http(),
25
+ * })
26
+ *
27
+ * const addresses = await getSupportedEntryPoints(bundlerClient)
28
+ */
29
+ export declare function getSupportedEntryPoints(client: Client<Transport>): Promise<readonly `0x${string}`[]>;
30
+ //# sourceMappingURL=getSupportedEntryPoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSupportedEntryPoints.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/bundler/getSupportedEntryPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,MAAM,MAAM,iCAAiC,GAAG,SAAS,OAAO,EAAE,CAAA;AAClE,MAAM,MAAM,gCAAgC,GAAG,gBAAgB,GAAG,SAAS,CAAA;AAE3E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,qCAEhE"}
@@ -0,0 +1,57 @@
1
+ import type { Address } from 'abitype';
2
+ import type { Client } from '../../../clients/createClient.js';
3
+ import type { Transport } from '../../../clients/transports/createTransport.js';
4
+ import type { ErrorType } from '../../../errors/utils.js';
5
+ import type { Hash } from '../../../types/misc.js';
6
+ import type { Prettify } from '../../../types/utils.js';
7
+ import type { RequestErrorType } from '../../../utils/buildRequest.js';
8
+ import { type UserOperationNotFoundErrorType } from '../../errors/userOperation.js';
9
+ import type { UserOperation } from '../../types/userOperation.js';
10
+ export type GetUserOperationParameters = {
11
+ /** The hash of the User Operation. */
12
+ hash: Hash;
13
+ };
14
+ export type GetUserOperationReturnType = Prettify<{
15
+ /** The block hash the User Operation was included on. */
16
+ blockHash: Hash;
17
+ /** The block number the User Operation was included on. */
18
+ blockNumber: bigint;
19
+ /** The EntryPoint which handled the User Operation. */
20
+ entryPoint: Address;
21
+ /** The hash of the transaction which included the User Operation. */
22
+ transactionHash: Hash;
23
+ /** The User Operation. */
24
+ userOperation: UserOperation;
25
+ }>;
26
+ export type GetUserOperationErrorType = RequestErrorType | UserOperationNotFoundErrorType | ErrorType;
27
+ /**
28
+ * Retrieves information about a User Operation given a hash.
29
+ *
30
+ * - Docs: https://viem.sh/docs/actions/bundler/getUserOperation
31
+ *
32
+ * @param client - Client to use
33
+ * @param parameters - {@link GetUserOperationParameters}
34
+ * @returns The receipt. {@link GetUserOperationReturnType}
35
+ *
36
+ * @example
37
+ * import { createBundlerClient, http } from 'viem'
38
+ * import { mainnet } from 'viem/chains'
39
+ * import { getUserOperation } from 'viem/actions
40
+ *
41
+ * const client = createBundlerClient({
42
+ * chain: mainnet,
43
+ * transport: http(),
44
+ * })
45
+ *
46
+ * const receipt = await getUserOperation(client, {
47
+ * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
48
+ * })
49
+ */
50
+ export declare function getUserOperation(client: Client<Transport>, { hash }: GetUserOperationParameters): Promise<{
51
+ blockHash: `0x${string}`;
52
+ blockNumber: bigint;
53
+ entryPoint: `0x${string}`;
54
+ transactionHash: `0x${string}`;
55
+ userOperation: UserOperation;
56
+ }>;
57
+ //# sourceMappingURL=getUserOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperation.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/bundler/getUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAGjE,MAAM,MAAM,0BAA0B,GAAG;IACvC,sCAAsC;IACtC,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAChD,yDAAyD;IACzD,SAAS,EAAE,IAAI,CAAA;IACf,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAA;IACnB,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAA;IACnB,qEAAqE;IACrE,eAAe,EAAE,IAAI,CAAA;IACrB,0BAA0B;IAC1B,aAAa,EAAE,aAAa,CAAA;CAC7B,CAAC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GACjC,gBAAgB,GAChB,8BAA8B,GAC9B,SAAS,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,EACzB,EAAE,IAAI,EAAE,EAAE,0BAA0B;;;;;;GAsBrC"}
@@ -0,0 +1,39 @@
1
+ import type { Client } from '../../../clients/createClient.js';
2
+ import type { Transport } from '../../../clients/transports/createTransport.js';
3
+ import type { ErrorType } from '../../../errors/utils.js';
4
+ import type { Hash } from '../../../types/misc.js';
5
+ import type { Prettify } from '../../../types/utils.js';
6
+ import type { RequestErrorType } from '../../../utils/buildRequest.js';
7
+ import { type UserOperationReceiptNotFoundErrorType } from '../../errors/userOperation.js';
8
+ import type { UserOperationReceipt } from '../../types/userOperation.js';
9
+ export type GetUserOperationReceiptParameters = {
10
+ /** The hash of the User Operation. */
11
+ hash: Hash;
12
+ };
13
+ export type GetUserOperationReceiptReturnType = Prettify<UserOperationReceipt>;
14
+ export type GetUserOperationReceiptErrorType = RequestErrorType | UserOperationReceiptNotFoundErrorType | ErrorType;
15
+ /**
16
+ * Returns the User Operation Receipt given a User Operation hash.
17
+ *
18
+ * - Docs: https://viem.sh/docs/actions/bundler/getUserOperationReceipt
19
+ *
20
+ * @param client - Client to use
21
+ * @param parameters - {@link GetUserOperationReceiptParameters}
22
+ * @returns The receipt. {@link GetUserOperationReceiptReturnType}
23
+ *
24
+ * @example
25
+ * import { createBundlerClient, http } from 'viem'
26
+ * import { mainnet } from 'viem/chains'
27
+ * import { getUserOperationReceipt } from 'viem/actions
28
+ *
29
+ * const client = createBundlerClient({
30
+ * chain: mainnet,
31
+ * transport: http(),
32
+ * })
33
+ *
34
+ * const receipt = await getUserOperationReceipt(client, {
35
+ * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
36
+ * })
37
+ */
38
+ export declare function getUserOperationReceipt(client: Client<Transport>, { hash }: GetUserOperationReceiptParameters): Promise<UserOperationReceipt>;
39
+ //# sourceMappingURL=getUserOperationReceipt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAEL,KAAK,qCAAqC,EAC3C,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAGxE,MAAM,MAAM,iCAAiC,GAAG;IAC9C,sCAAsC;IACtC,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAA;AAE9E,MAAM,MAAM,gCAAgC,GACxC,gBAAgB,GAChB,qCAAqC,GACrC,SAAS,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,EACzB,EAAE,IAAI,EAAE,EAAE,iCAAiC,iCAa5C"}
@@ -0,0 +1,106 @@
1
+ import type { Address, Narrow } from 'abitype';
2
+ import { type ParseAccountErrorType } from '../../../accounts/utils/parseAccount.js';
3
+ import { type EstimateFeesPerGasErrorType } from '../../../actions/public/estimateFeesPerGas.js';
4
+ import type { Client } from '../../../clients/createClient.js';
5
+ import type { Transport } from '../../../clients/transports/createTransport.js';
6
+ import type { ErrorType } from '../../../errors/utils.js';
7
+ import type { Chain } from '../../../types/chain.js';
8
+ import type { Hex } from '../../../types/misc.js';
9
+ import type { Assign, OneOf, Prettify, UnionOmit } from '../../../types/utils.js';
10
+ import { type EncodeFunctionDataErrorType } from '../../../utils/abi/encodeFunctionData.js';
11
+ import { type ConcatErrorType } from '../../../utils/data/concat.js';
12
+ import type { SmartAccount } from '../../accounts/types.js';
13
+ import type { PaymasterActions } from '../../clients/decorators/paymaster.js';
14
+ import type { DeriveSmartAccount, GetSmartAccountParameter } from '../../types/account.js';
15
+ import type { DeriveEntryPointVersion, EntryPointVersion } from '../../types/entryPointVersion.js';
16
+ import type { UserOperation, UserOperationCalls, UserOperationRequest } from '../../types/userOperation.js';
17
+ import { type GetPaymasterDataErrorType } from '../paymaster/getPaymasterData.js';
18
+ import { type GetPaymasterStubDataErrorType } from '../paymaster/getPaymasterStubData.js';
19
+ declare const defaultParameters: readonly ["factory", "fees", "gas", "paymaster", "nonce", "signature"];
20
+ export type PrepareUserOperationParameterType = 'factory' | 'fees' | 'gas' | 'paymaster' | 'nonce' | 'signature';
21
+ type FactoryProperties<entryPointVersion extends EntryPointVersion = EntryPointVersion> = (entryPointVersion extends '0.7' ? {
22
+ factory: UserOperation['factory'];
23
+ factoryData: UserOperation['factoryData'];
24
+ } : never) | (entryPointVersion extends '0.6' ? {
25
+ initCode: UserOperation['initCode'];
26
+ } : never);
27
+ type GasProperties<entryPointVersion extends EntryPointVersion = EntryPointVersion> = (entryPointVersion extends '0.7' ? {
28
+ callGasLimit: UserOperation['callGasLimit'];
29
+ preVerificationGas: UserOperation['preVerificationGas'];
30
+ verificationGasLimit: UserOperation['verificationGasLimit'];
31
+ paymasterPostOpGasLimit: UserOperation['paymasterPostOpGasLimit'];
32
+ paymasterVerificationGasLimit: UserOperation['paymasterVerificationGasLimit'];
33
+ } : never) | (entryPointVersion extends '0.6' ? {
34
+ callGasLimit: UserOperation['callGasLimit'];
35
+ preVerificationGas: UserOperation['preVerificationGas'];
36
+ verificationGasLimit: UserOperation['verificationGasLimit'];
37
+ } : never);
38
+ type FeeProperties = {
39
+ maxFeePerGas: UserOperation['maxFeePerGas'];
40
+ maxPriorityFeePerGas: UserOperation['maxPriorityFeePerGas'];
41
+ };
42
+ type NonceProperties = {
43
+ nonce: UserOperation['nonce'];
44
+ };
45
+ type PaymasterProperties<entryPointVersion extends EntryPointVersion = EntryPointVersion> = (entryPointVersion extends '0.7' ? {
46
+ paymaster: UserOperation['paymaster'];
47
+ paymasterData: UserOperation['paymasterData'];
48
+ paymasterPostOpGasLimit: UserOperation['paymasterPostOpGasLimit'];
49
+ paymasterVerificationGasLimit: UserOperation['paymasterVerificationGasLimit'];
50
+ } : never) | (entryPointVersion extends '0.6' ? {
51
+ paymasterAndData: UserOperation['paymasterAndData'];
52
+ } : never);
53
+ type SignatureProperties = {
54
+ signature: UserOperation['signature'];
55
+ };
56
+ export type PrepareUserOperationRequest<account extends SmartAccount | undefined = SmartAccount | undefined, accountOverride extends SmartAccount | undefined = SmartAccount | undefined, calls extends readonly unknown[] = readonly unknown[], _derivedAccount extends SmartAccount | undefined = DeriveSmartAccount<account, accountOverride>, _derivedVersion extends EntryPointVersion = DeriveEntryPointVersion<_derivedAccount>> = Assign<UserOperationRequest<_derivedVersion>, OneOf<{
57
+ calls: UserOperationCalls<Narrow<calls>>;
58
+ } | {
59
+ callData: Hex;
60
+ }> & {
61
+ parameters?: readonly PrepareUserOperationParameterType[] | undefined;
62
+ paymaster?: Address | true | {
63
+ /** Retrieves paymaster-related User Operation properties to be used for sending the User Operation. */
64
+ getPaymasterData?: PaymasterActions['getPaymasterData'] | undefined;
65
+ /** Retrieves paymaster-related User Operation properties to be used for gas estimation. */
66
+ getPaymasterStubData?: PaymasterActions['getPaymasterStubData'] | undefined;
67
+ } | undefined;
68
+ /** Paymaster context to pass to `getPaymasterData` and `getPaymasterStubData` calls. */
69
+ paymasterContext?: unknown | undefined;
70
+ }>;
71
+ export type PrepareUserOperationParameters<account extends SmartAccount | undefined = SmartAccount | undefined, accountOverride extends SmartAccount | undefined = SmartAccount | undefined, calls extends readonly unknown[] = readonly unknown[], request extends PrepareUserOperationRequest<account, accountOverride, calls> = PrepareUserOperationRequest<account, accountOverride, calls>> = request & GetSmartAccountParameter<account, accountOverride>;
72
+ export type PrepareUserOperationReturnType<account extends SmartAccount | undefined = SmartAccount | undefined, accountOverride extends SmartAccount | undefined = SmartAccount | undefined, calls extends readonly unknown[] = readonly unknown[], request extends PrepareUserOperationRequest<account, accountOverride, calls> = PrepareUserOperationRequest<account, accountOverride, calls>, _parameters extends PrepareUserOperationParameterType = request['parameters'] extends readonly PrepareUserOperationParameterType[] ? request['parameters'][number] : (typeof defaultParameters)[number], _derivedAccount extends SmartAccount | undefined = DeriveSmartAccount<account, accountOverride>, _derivedVersion extends EntryPointVersion = DeriveEntryPointVersion<_derivedAccount>> = Prettify<UnionOmit<request, 'calls' | 'parameters'> & {
73
+ callData: Hex;
74
+ paymasterAndData: _derivedVersion extends '0.6' ? Hex : undefined;
75
+ sender: UserOperation['sender'];
76
+ } & (Extract<_parameters, 'factory'> extends never ? {} : FactoryProperties<_derivedVersion>) & (Extract<_parameters, 'nonce'> extends never ? {} : NonceProperties) & (Extract<_parameters, 'fees'> extends never ? {} : FeeProperties) & (Extract<_parameters, 'gas'> extends never ? {} : GasProperties<_derivedVersion>) & (Extract<_parameters, 'paymaster'> extends never ? {} : PaymasterProperties<_derivedVersion>) & (Extract<_parameters, 'signature'> extends never ? {} : SignatureProperties)>;
77
+ export type PrepareUserOperationErrorType = ParseAccountErrorType | GetPaymasterStubDataErrorType | GetPaymasterDataErrorType | EncodeFunctionDataErrorType | ConcatErrorType | EstimateFeesPerGasErrorType | ErrorType;
78
+ /**
79
+ * Prepares a User Operation and fills in missing properties.
80
+ *
81
+ * - Docs: https://viem.sh/actions/bundler/prepareUserOperation
82
+ *
83
+ * @param args - {@link PrepareUserOperationParameters}
84
+ * @returns The User Operation. {@link PrepareUserOperationReturnType}
85
+ *
86
+ * @example
87
+ * import { createBundlerClient, http } from 'viem'
88
+ * import { toSmartAccount } from 'viem/accounts'
89
+ * import { mainnet } from 'viem/chains'
90
+ * import { prepareUserOperation } from 'viem/actions'
91
+ *
92
+ * const account = await toSmartAccount({ ... })
93
+ *
94
+ * const client = createBundlerClient({
95
+ * chain: mainnet,
96
+ * transport: http(),
97
+ * })
98
+ *
99
+ * const request = await prepareUserOperation(client, {
100
+ * account,
101
+ * calls: [{ to: '0x...', value: parseEther('1') }],
102
+ * })
103
+ */
104
+ export declare function prepareUserOperation<account extends SmartAccount | undefined, const calls extends readonly unknown[], const request extends PrepareUserOperationRequest<account, accountOverride, calls>, accountOverride extends SmartAccount | undefined = undefined>(client: Client<Transport, Chain | undefined, account>, parameters_: PrepareUserOperationParameters<account, accountOverride, calls, request>): Promise<PrepareUserOperationReturnType<account, accountOverride, calls, request>>;
105
+ export {};
106
+ //# sourceMappingURL=prepareUserOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareUserOperation.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/bundler/prepareUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,yCAAyC,CAAA;AAChD,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,+CAA+C,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACV,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,0CAA0C,CAAA;AACjD,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,+BAA+B,CAAA;AAG5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EACV,uBAAuB,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C,qBAAqB,GACrB,6BAA6B,GAC7B,yBAAyB,GACzB,2BAA2B,GAC3B,eAAe,GACf,2BAA2B,GAC3B,SAAS,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,SAAS,YAAY,GAAG,SAAS,EACxC,KAAK,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,EACtC,KAAK,CAAC,OAAO,SAAS,2BAA2B,CAC/C,OAAO,EACP,eAAe,EACf,KAAK,CACN,EACD,eAAe,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,EAE5D,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,CAAC,EACrD,WAAW,EAAE,8BAA8B,CACzC,OAAO,EACP,eAAe,EACf,KAAK,EACL,OAAO,CACR,GACA,OAAO,CACR,8BAA8B,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,CAAC,CACzE,CAuWA"}
@@ -0,0 +1,60 @@
1
+ import type { Address, Narrow } from 'abitype';
2
+ import type { Client } from '../../../clients/createClient.js';
3
+ import type { Transport } from '../../../clients/transports/createTransport.js';
4
+ import type { ErrorType } from '../../../errors/utils.js';
5
+ import type { Chain } from '../../../types/chain.js';
6
+ import type { Hex } from '../../../types/misc.js';
7
+ import type { Assign, OneOf } from '../../../types/utils.js';
8
+ import type { RequestErrorType } from '../../../utils/buildRequest.js';
9
+ import type { SmartAccount } from '../../accounts/types.js';
10
+ import type { PaymasterActions } from '../../clients/decorators/paymaster.js';
11
+ import type { DeriveSmartAccount, GetSmartAccountParameter } from '../../types/account.js';
12
+ import type { DeriveEntryPointVersion, EntryPointVersion } from '../../types/entryPointVersion.js';
13
+ import type { UserOperationCalls, UserOperationRequest } from '../../types/userOperation.js';
14
+ import { type FormatUserOperationRequestErrorType } from '../../utils/formatters/userOperationRequest.js';
15
+ import { type PrepareUserOperationErrorType } from './prepareUserOperation.js';
16
+ export type SendUserOperationParameters<account extends SmartAccount | undefined = SmartAccount | undefined, accountOverride extends SmartAccount | undefined = SmartAccount | undefined, calls extends readonly unknown[] = readonly unknown[], _derivedAccount extends SmartAccount | undefined = DeriveSmartAccount<account, accountOverride>, _derivedVersion extends EntryPointVersion = DeriveEntryPointVersion<_derivedAccount>> = Assign<UserOperationRequest<_derivedVersion>, OneOf<{
17
+ calls: UserOperationCalls<Narrow<calls>>;
18
+ } | {
19
+ callData: Hex;
20
+ }> & {
21
+ paymaster?: Address | true | {
22
+ /** Retrieves paymaster-related User Operation properties to be used for sending the User Operation. */
23
+ getPaymasterData?: PaymasterActions['getPaymasterData'] | undefined;
24
+ /** Retrieves paymaster-related User Operation properties to be used for gas estimation. */
25
+ getPaymasterStubData?: PaymasterActions['getPaymasterStubData'] | undefined;
26
+ } | undefined;
27
+ /** Paymaster context to pass to `getPaymasterData` and `getPaymasterStubData` calls. */
28
+ paymasterContext?: unknown;
29
+ }> & GetSmartAccountParameter<account, accountOverride>;
30
+ export type SendUserOperationReturnType = Hex;
31
+ export type SendUserOperationErrorType = FormatUserOperationRequestErrorType | PrepareUserOperationErrorType | RequestErrorType | ErrorType;
32
+ /**
33
+ * Broadcasts a User Operation to the Bundler.
34
+ *
35
+ * - Docs: https://viem.sh/actions/bundler/sendUserOperation
36
+ *
37
+ * @param client - Client to use
38
+ * @param parameters - {@link SendUserOperationParameters}
39
+ * @returns The User Operation hash. {@link SendUserOperationReturnType}
40
+ *
41
+ * @example
42
+ * import { createBundlerClient, http, parseEther } from 'viem'
43
+ * import { mainnet } from 'viem/chains'
44
+ * import { toSmartAccount } from 'viem/accounts'
45
+ * import { sendUserOperation } from 'viem/actions'
46
+ *
47
+ * const account = await toSmartAccount({ ... })
48
+ *
49
+ * const bundlerClient = createBundlerClient({
50
+ * chain: mainnet,
51
+ * transport: http(),
52
+ * })
53
+ *
54
+ * const values = await sendUserOperation(bundlerClient, {
55
+ * account,
56
+ * calls: [{ to: '0x...', value: parseEther('1') }],
57
+ * })
58
+ */
59
+ export declare function sendUserOperation<const calls extends readonly unknown[], account extends SmartAccount | undefined, accountOverride extends SmartAccount | undefined = undefined>(client: Client<Transport, Chain | undefined, account>, parameters: SendUserOperationParameters<account, accountOverride, calls>): Promise<`0x${string}`>;
60
+ //# sourceMappingURL=sendUserOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendUserOperation.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAG/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAEV,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EACL,KAAK,mCAAmC,EAEzC,MAAM,gDAAgD,CAAA;AACvD,OAAO,EACL,KAAK,6BAA6B,EAGnC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AS,GAAG,SAAS,EAE5D,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,CAAC,EACrD,UAAU,EAAE,2BAA2B,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,CAAC,0BAqCzE"}
@@ -0,0 +1,52 @@
1
+ import type { Client } from '../../../clients/createClient.js';
2
+ import type { Transport } from '../../../clients/transports/createTransport.js';
3
+ import type { ErrorType } from '../../../errors/utils.js';
4
+ import type { Hash } from '../../../types/misc.js';
5
+ import type { Prettify } from '../../../types/utils.js';
6
+ import { type ObserveErrorType } from '../../../utils/observe.js';
7
+ import { type PollErrorType } from '../../../utils/poll.js';
8
+ import { type WaitForUserOperationReceiptTimeoutErrorType } from '../../errors/userOperation.js';
9
+ import type { UserOperationReceipt } from '../../types/userOperation.js';
10
+ export type WaitForUserOperationReceiptParameters = {
11
+ /** The hash of the User Operation. */
12
+ hash: Hash;
13
+ /**
14
+ * Polling frequency (in ms). Defaults to the client's pollingInterval config.
15
+ * @default client.pollingInterval
16
+ */
17
+ pollingInterval?: number | undefined;
18
+ /**
19
+ * The number of times to retry.
20
+ * @default 6
21
+ */
22
+ retryCount?: number | undefined;
23
+ /** Optional timeout (in ms) to wait before stopping polling. */
24
+ timeout?: number | undefined;
25
+ };
26
+ export type WaitForUserOperationReceiptReturnType = Prettify<UserOperationReceipt>;
27
+ export type WaitForUserOperationReceiptErrorType = WaitForUserOperationReceiptTimeoutErrorType | PollErrorType | ObserveErrorType | ErrorType;
28
+ /**
29
+ * Waits for the User Operation to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the User Operation receipt.
30
+ *
31
+ * - Docs: https://viem.sh/docs/actions/bundler/waitForUserOperationReceipt
32
+ *
33
+ * @param client - Client to use
34
+ * @param parameters - {@link WaitForUserOperationReceiptParameters}
35
+ * @returns The receipt. {@link WaitForUserOperationReceiptReturnType}
36
+ *
37
+ * @example
38
+ * import { createBundlerClient, http } from 'viem'
39
+ * import { mainnet } from 'viem/chains'
40
+ * import { waitForUserOperationReceipt } from 'viem/actions'
41
+ *
42
+ * const client = createBundlerClient({
43
+ * chain: mainnet,
44
+ * transport: http(),
45
+ * })
46
+ *
47
+ * const receipt = await waitForUserOperationReceipt(client, {
48
+ * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
49
+ * })
50
+ */
51
+ export declare function waitForUserOperationReceipt(client: Client<Transport>, parameters: WaitForUserOperationReceiptParameters): Promise<WaitForUserOperationReceiptReturnType>;
52
+ //# sourceMappingURL=waitForUserOperationReceipt.d.ts.map