permissionless 0.0.35 → 0.1.0

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 (325) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/_cjs/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -1
  3. package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js +32 -15
  4. package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
  5. package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +38 -20
  6. package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
  7. package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -1
  8. package/_cjs/accounts/safe/signerToSafeSmartAccount.js +42 -11
  9. package/_cjs/accounts/safe/signerToSafeSmartAccount.js.map +1 -1
  10. package/_cjs/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -1
  11. package/_cjs/accounts/simple/signerToSimpleSmartAccount.js +104 -44
  12. package/_cjs/accounts/simple/signerToSimpleSmartAccount.js.map +1 -1
  13. package/_cjs/accounts/types.js.map +1 -1
  14. package/_cjs/actions/bundler/chainId.js.map +1 -1
  15. package/_cjs/actions/bundler/estimateUserOperationGas.js +20 -3
  16. package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -1
  17. package/_cjs/actions/bundler/getUserOperationByHash.js +28 -11
  18. package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -1
  19. package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -1
  20. package/_cjs/actions/bundler/sendUserOperation.js.map +1 -1
  21. package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -1
  22. package/_cjs/actions/pimlico/getUserOperationGasPrice.js +7 -7
  23. package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
  24. package/_cjs/actions/pimlico/sponsorUserOperation.js +19 -7
  25. package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
  26. package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
  27. package/_cjs/actions/public/getAccountNonce.js.map +1 -1
  28. package/_cjs/actions/public/getSenderAddress.js +5 -2
  29. package/_cjs/actions/public/getSenderAddress.js.map +1 -1
  30. package/_cjs/actions/smartAccount/deployContract.js +3 -4
  31. package/_cjs/actions/smartAccount/deployContract.js.map +1 -1
  32. package/_cjs/actions/smartAccount/prepareUserOperationRequest.js +142 -19
  33. package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
  34. package/_cjs/actions/smartAccount/sendTransaction.js +3 -4
  35. package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
  36. package/_cjs/actions/smartAccount/sendTransactions.js +3 -4
  37. package/_cjs/actions/smartAccount/sendTransactions.js.map +1 -1
  38. package/_cjs/actions/smartAccount/sendUserOperation.js +1 -1
  39. package/_cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
  40. package/_cjs/actions/smartAccount/signMessage.js.map +1 -1
  41. package/_cjs/actions/smartAccount/signTypedData.js.map +1 -1
  42. package/_cjs/actions/smartAccount/writeContract.js.map +1 -1
  43. package/_cjs/actions/stackup/accounts.js +2 -2
  44. package/_cjs/actions/stackup/accounts.js.map +1 -1
  45. package/_cjs/actions/stackup/sponsorUserOperation.js +20 -12
  46. package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -1
  47. package/_cjs/clients/createBundlerClient.js +1 -1
  48. package/_cjs/clients/createBundlerClient.js.map +1 -1
  49. package/_cjs/clients/createSmartAccountClient.js +3 -3
  50. package/_cjs/clients/createSmartAccountClient.js.map +1 -1
  51. package/_cjs/clients/decorators/bundler.js +6 -3
  52. package/_cjs/clients/decorators/bundler.js.map +1 -1
  53. package/_cjs/clients/decorators/pimlico.js +6 -3
  54. package/_cjs/clients/decorators/pimlico.js.map +1 -1
  55. package/_cjs/clients/decorators/smartAccount.js +7 -7
  56. package/_cjs/clients/decorators/smartAccount.js.map +1 -1
  57. package/_cjs/clients/decorators/stackup.js.map +1 -1
  58. package/_cjs/clients/pimlico.js +4 -2
  59. package/_cjs/clients/pimlico.js.map +1 -1
  60. package/_cjs/clients/stackup.js +3 -1
  61. package/_cjs/clients/stackup.js.map +1 -1
  62. package/_cjs/errors/estimateUserOperationGas.js.map +1 -1
  63. package/_cjs/errors/sendUserOperation.js.map +1 -1
  64. package/_cjs/types/entrypoint.js +3 -0
  65. package/_cjs/types/entrypoint.js.map +1 -0
  66. package/_cjs/utils/errors/getBundlerError.js.map +1 -1
  67. package/_cjs/utils/errors/getEstimateUserOperationGasError.js.map +1 -1
  68. package/_cjs/utils/errors/getSendUserOperationError.js.map +1 -1
  69. package/_cjs/utils/getEntryPointVersion.js +8 -0
  70. package/_cjs/utils/getEntryPointVersion.js.map +1 -0
  71. package/_cjs/utils/getRequiredPrefund.js +19 -6
  72. package/_cjs/utils/getRequiredPrefund.js.map +1 -1
  73. package/_cjs/utils/getUserOperationHash.js +81 -17
  74. package/_cjs/utils/getUserOperationHash.js.map +1 -1
  75. package/_cjs/utils/index.js +5 -1
  76. package/_cjs/utils/index.js.map +1 -1
  77. package/_cjs/utils/providerToSmartAccountSigner.js +1 -1
  78. package/_cjs/utils/providerToSmartAccountSigner.js.map +1 -1
  79. package/_cjs/utils/signUserOperationHashWithECDSA.js +2 -2
  80. package/_cjs/utils/signUserOperationHashWithECDSA.js.map +1 -1
  81. package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -1
  82. package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js +32 -15
  83. package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
  84. package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +38 -21
  85. package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
  86. package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -1
  87. package/_esm/accounts/safe/signerToSafeSmartAccount.js +42 -11
  88. package/_esm/accounts/safe/signerToSafeSmartAccount.js.map +1 -1
  89. package/_esm/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -1
  90. package/_esm/accounts/simple/signerToSimpleSmartAccount.js +105 -44
  91. package/_esm/accounts/simple/signerToSimpleSmartAccount.js.map +1 -1
  92. package/_esm/accounts/types.js +0 -1
  93. package/_esm/accounts/types.js.map +1 -1
  94. package/_esm/actions/bundler/chainId.js.map +1 -1
  95. package/_esm/actions/bundler/estimateUserOperationGas.js +20 -3
  96. package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
  97. package/_esm/actions/bundler/getUserOperationByHash.js +28 -11
  98. package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -1
  99. package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
  100. package/_esm/actions/bundler/sendUserOperation.js.map +1 -1
  101. package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -1
  102. package/_esm/actions/pimlico/getUserOperationGasPrice.js +7 -7
  103. package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
  104. package/_esm/actions/pimlico/sponsorUserOperation.js +19 -7
  105. package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
  106. package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
  107. package/_esm/actions/public/getAccountNonce.js.map +1 -1
  108. package/_esm/actions/public/getSenderAddress.js +6 -3
  109. package/_esm/actions/public/getSenderAddress.js.map +1 -1
  110. package/_esm/actions/smartAccount/deployContract.js +3 -4
  111. package/_esm/actions/smartAccount/deployContract.js.map +1 -1
  112. package/_esm/actions/smartAccount/prepareUserOperationRequest.js +142 -19
  113. package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
  114. package/_esm/actions/smartAccount/sendTransaction.js +3 -4
  115. package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
  116. package/_esm/actions/smartAccount/sendTransactions.js +3 -4
  117. package/_esm/actions/smartAccount/sendTransactions.js.map +1 -1
  118. package/_esm/actions/smartAccount/sendUserOperation.js +1 -1
  119. package/_esm/actions/smartAccount/sendUserOperation.js.map +1 -1
  120. package/_esm/actions/smartAccount/signMessage.js.map +1 -1
  121. package/_esm/actions/smartAccount/signTypedData.js.map +1 -1
  122. package/_esm/actions/smartAccount/writeContract.js.map +1 -1
  123. package/_esm/actions/stackup/accounts.js +2 -2
  124. package/_esm/actions/stackup/accounts.js.map +1 -1
  125. package/_esm/actions/stackup/sponsorUserOperation.js +20 -12
  126. package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -1
  127. package/_esm/clients/createBundlerClient.js +1 -1
  128. package/_esm/clients/createBundlerClient.js.map +1 -1
  129. package/_esm/clients/createSmartAccountClient.js +22 -3
  130. package/_esm/clients/createSmartAccountClient.js.map +1 -1
  131. package/_esm/clients/decorators/bundler.js +6 -3
  132. package/_esm/clients/decorators/bundler.js.map +1 -1
  133. package/_esm/clients/decorators/pimlico.js +6 -3
  134. package/_esm/clients/decorators/pimlico.js.map +1 -1
  135. package/_esm/clients/decorators/smartAccount.js +7 -7
  136. package/_esm/clients/decorators/smartAccount.js.map +1 -1
  137. package/_esm/clients/decorators/stackup.js.map +1 -1
  138. package/_esm/clients/pimlico.js +4 -2
  139. package/_esm/clients/pimlico.js.map +1 -1
  140. package/_esm/clients/stackup.js +3 -1
  141. package/_esm/clients/stackup.js.map +1 -1
  142. package/_esm/errors/estimateUserOperationGas.js.map +1 -1
  143. package/_esm/errors/sendUserOperation.js.map +1 -1
  144. package/_esm/types/entrypoint.js +2 -0
  145. package/_esm/types/entrypoint.js.map +1 -0
  146. package/_esm/utils/errors/getBundlerError.js.map +1 -1
  147. package/_esm/utils/errors/getEstimateUserOperationGasError.js.map +1 -1
  148. package/_esm/utils/errors/getSendUserOperationError.js.map +1 -1
  149. package/_esm/utils/getEntryPointVersion.js +4 -0
  150. package/_esm/utils/getEntryPointVersion.js.map +1 -0
  151. package/_esm/utils/getRequiredPrefund.js +19 -6
  152. package/_esm/utils/getRequiredPrefund.js.map +1 -1
  153. package/_esm/utils/getUserOperationHash.js +82 -18
  154. package/_esm/utils/getUserOperationHash.js.map +1 -1
  155. package/_esm/utils/index.js +2 -1
  156. package/_esm/utils/index.js.map +1 -1
  157. package/_esm/utils/providerToSmartAccountSigner.js +1 -1
  158. package/_esm/utils/providerToSmartAccountSigner.js.map +1 -1
  159. package/_esm/utils/signUserOperationHashWithECDSA.js +2 -3
  160. package/_esm/utils/signUserOperationHashWithECDSA.js.map +1 -1
  161. package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts +4 -4
  162. package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts.map +1 -1
  163. package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts +5 -4
  164. package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +1 -1
  165. package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +5 -4
  166. package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -1
  167. package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts +4 -4
  168. package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts.map +1 -1
  169. package/_types/accounts/safe/signerToSafeSmartAccount.d.ts +6 -5
  170. package/_types/accounts/safe/signerToSafeSmartAccount.d.ts.map +1 -1
  171. package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts +4 -4
  172. package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts.map +1 -1
  173. package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts +5 -4
  174. package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts.map +1 -1
  175. package/_types/accounts/types.d.ts +8 -5
  176. package/_types/accounts/types.d.ts.map +1 -1
  177. package/_types/actions/bundler/chainId.d.ts +2 -1
  178. package/_types/actions/bundler/chainId.d.ts.map +1 -1
  179. package/_types/actions/bundler/estimateUserOperationGas.d.ts +14 -7
  180. package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
  181. package/_types/actions/bundler/getUserOperationByHash.d.ts +10 -3
  182. package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
  183. package/_types/actions/bundler/getUserOperationReceipt.d.ts +2 -1
  184. package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
  185. package/_types/actions/bundler/sendUserOperation.d.ts +6 -5
  186. package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -1
  187. package/_types/actions/bundler/supportedEntryPoints.d.ts +3 -2
  188. package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -1
  189. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -1
  190. package/_types/actions/pimlico/sponsorUserOperation.d.ts +47 -6
  191. package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
  192. package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +10 -5
  193. package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -1
  194. package/_types/actions/public/getAccountNonce.d.ts +2 -1
  195. package/_types/actions/public/getAccountNonce.d.ts.map +1 -1
  196. package/_types/actions/public/getSenderAddress.d.ts +11 -3
  197. package/_types/actions/public/getSenderAddress.d.ts.map +1 -1
  198. package/_types/actions/smartAccount/deployContract.d.ts +4 -3
  199. package/_types/actions/smartAccount/deployContract.d.ts.map +1 -1
  200. package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts +21 -11
  201. package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +1 -1
  202. package/_types/actions/smartAccount/sendTransaction.d.ts +4 -3
  203. package/_types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
  204. package/_types/actions/smartAccount/sendTransactions.d.ts +5 -4
  205. package/_types/actions/smartAccount/sendTransactions.d.ts.map +1 -1
  206. package/_types/actions/smartAccount/sendUserOperation.d.ts +6 -5
  207. package/_types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
  208. package/_types/actions/smartAccount/signMessage.d.ts +2 -1
  209. package/_types/actions/smartAccount/signMessage.d.ts.map +1 -1
  210. package/_types/actions/smartAccount/signTypedData.d.ts +3 -2
  211. package/_types/actions/smartAccount/signTypedData.d.ts.map +1 -1
  212. package/_types/actions/smartAccount/writeContract.d.ts +4 -3
  213. package/_types/actions/smartAccount/writeContract.d.ts.map +1 -1
  214. package/_types/actions/smartAccount.d.ts +2 -2
  215. package/_types/actions/smartAccount.d.ts.map +1 -1
  216. package/_types/actions/stackup/accounts.d.ts +4 -3
  217. package/_types/actions/stackup/accounts.d.ts.map +1 -1
  218. package/_types/actions/stackup/sponsorUserOperation.d.ts +6 -6
  219. package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -1
  220. package/_types/clients/createBundlerClient.d.ts +6 -3
  221. package/_types/clients/createBundlerClient.d.ts.map +1 -1
  222. package/_types/clients/createSmartAccountClient.d.ts +9 -5
  223. package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
  224. package/_types/clients/decorators/bundler.d.ts +7 -7
  225. package/_types/clients/decorators/bundler.d.ts.map +1 -1
  226. package/_types/clients/decorators/pimlico.d.ts +6 -5
  227. package/_types/clients/decorators/pimlico.d.ts.map +1 -1
  228. package/_types/clients/decorators/smartAccount.d.ts +12 -12
  229. package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
  230. package/_types/clients/decorators/stackup.d.ts +5 -4
  231. package/_types/clients/decorators/stackup.d.ts.map +1 -1
  232. package/_types/clients/pimlico.d.ts +11 -6
  233. package/_types/clients/pimlico.d.ts.map +1 -1
  234. package/_types/clients/stackup.d.ts +6 -3
  235. package/_types/clients/stackup.d.ts.map +1 -1
  236. package/_types/errors/estimateUserOperationGas.d.ts +4 -3
  237. package/_types/errors/estimateUserOperationGas.d.ts.map +1 -1
  238. package/_types/errors/sendUserOperation.d.ts +4 -3
  239. package/_types/errors/sendUserOperation.d.ts.map +1 -1
  240. package/_types/types/bundler.d.ts +16 -21
  241. package/_types/types/bundler.d.ts.map +1 -1
  242. package/_types/types/entrypoint.d.ts +6 -0
  243. package/_types/types/entrypoint.d.ts.map +1 -0
  244. package/_types/types/index.d.ts +6 -4
  245. package/_types/types/index.d.ts.map +1 -1
  246. package/_types/types/pimlico.d.ts +20 -6
  247. package/_types/types/pimlico.d.ts.map +1 -1
  248. package/_types/types/stackup.d.ts +18 -4
  249. package/_types/types/stackup.d.ts.map +1 -1
  250. package/_types/types/userOperation.d.ts +51 -2
  251. package/_types/types/userOperation.d.ts.map +1 -1
  252. package/_types/utils/errors/getBundlerError.d.ts +4 -4
  253. package/_types/utils/errors/getBundlerError.d.ts.map +1 -1
  254. package/_types/utils/errors/getEstimateUserOperationGasError.d.ts +3 -2
  255. package/_types/utils/errors/getEstimateUserOperationGasError.d.ts.map +1 -1
  256. package/_types/utils/errors/getSendUserOperationError.d.ts +2 -1
  257. package/_types/utils/errors/getSendUserOperationError.d.ts.map +1 -1
  258. package/_types/utils/getEntryPointVersion.d.ts +6 -0
  259. package/_types/utils/getEntryPointVersion.d.ts.map +1 -0
  260. package/_types/utils/getRequiredPrefund.d.ts +5 -4
  261. package/_types/utils/getRequiredPrefund.d.ts.map +1 -1
  262. package/_types/utils/getUserOperationHash.d.ts +6 -5
  263. package/_types/utils/getUserOperationHash.d.ts.map +1 -1
  264. package/_types/utils/index.d.ts +2 -1
  265. package/_types/utils/index.d.ts.map +1 -1
  266. package/_types/utils/providerToSmartAccountSigner.d.ts +4 -1
  267. package/_types/utils/providerToSmartAccountSigner.d.ts.map +1 -1
  268. package/_types/utils/signUserOperationHashWithECDSA.d.ts +6 -6
  269. package/_types/utils/signUserOperationHashWithECDSA.d.ts.map +1 -1
  270. package/accounts/biconomy/privateKeyToBiconomySmartAccount.ts +17 -6
  271. package/accounts/biconomy/signerToBiconomySmartAccount.ts +50 -21
  272. package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +64 -30
  273. package/accounts/safe/privateKeyToSafeSmartAccount.ts +8 -5
  274. package/accounts/safe/signerToSafeSmartAccount.ts +57 -17
  275. package/accounts/simple/privateKeyToSimpleSmartAccount.ts +25 -7
  276. package/accounts/simple/signerToSimpleSmartAccount.ts +127 -56
  277. package/accounts/types.ts +12 -4
  278. package/actions/bundler/chainId.ts +3 -1
  279. package/actions/bundler/estimateUserOperationGas.ts +77 -22
  280. package/actions/bundler/getUserOperationByHash.ts +44 -15
  281. package/actions/bundler/getUserOperationReceipt.ts +3 -1
  282. package/actions/bundler/sendUserOperation.ts +13 -17
  283. package/actions/bundler/supportedEntryPoints.ts +5 -3
  284. package/actions/pimlico/getUserOperationGasPrice.ts +7 -9
  285. package/actions/pimlico/sponsorUserOperation.ts +97 -23
  286. package/actions/pimlico/validateSponsorshipPolicies.ts +18 -7
  287. package/actions/public/getAccountNonce.ts +2 -1
  288. package/actions/public/getSenderAddress.ts +30 -5
  289. package/actions/smartAccount/deployContract.ts +14 -10
  290. package/actions/smartAccount/prepareUserOperationRequest.ts +339 -49
  291. package/actions/smartAccount/sendTransaction.ts +20 -11
  292. package/actions/smartAccount/sendTransactions.ts +17 -11
  293. package/actions/smartAccount/sendUserOperation.ts +56 -23
  294. package/actions/smartAccount/signMessage.ts +3 -1
  295. package/actions/smartAccount/signTypedData.ts +3 -1
  296. package/actions/smartAccount/writeContract.ts +12 -5
  297. package/actions/smartAccount.ts +2 -2
  298. package/actions/stackup/accounts.ts +7 -6
  299. package/actions/stackup/sponsorUserOperation.ts +85 -31
  300. package/clients/createBundlerClient.ts +11 -6
  301. package/clients/createSmartAccountClient.ts +34 -20
  302. package/clients/decorators/bundler.ts +51 -27
  303. package/clients/decorators/pimlico.ts +43 -17
  304. package/clients/decorators/smartAccount.ts +115 -37
  305. package/clients/decorators/stackup.ts +14 -10
  306. package/clients/pimlico.ts +22 -13
  307. package/clients/stackup.ts +13 -7
  308. package/errors/estimateUserOperationGas.ts +7 -4
  309. package/errors/sendUserOperation.ts +9 -5
  310. package/package.json +1 -1
  311. package/types/bundler.ts +40 -28
  312. package/types/entrypoint.ts +13 -0
  313. package/types/index.ts +15 -5
  314. package/types/pimlico.ts +43 -17
  315. package/types/stackup.ts +39 -15
  316. package/types/userOperation.ts +82 -26
  317. package/utils/errors/getBundlerError.ts +10 -6
  318. package/utils/errors/getEstimateUserOperationGasError.ts +13 -10
  319. package/utils/errors/getSendUserOperationError.ts +4 -3
  320. package/utils/getEntryPointVersion.ts +15 -0
  321. package/utils/getRequiredPrefund.ts +35 -11
  322. package/utils/getUserOperationHash.ts +113 -23
  323. package/utils/index.ts +9 -1
  324. package/utils/providerToSmartAccountSigner.ts +6 -3
  325. package/utils/signUserOperationHashWithECDSA.ts +13 -7
@@ -14,7 +14,13 @@ import { toAccount } from "viem/accounts"
14
14
  import { getChainId, signMessage, signTypedData } from "viem/actions"
15
15
  import { getAccountNonce } from "../../actions/public/getAccountNonce"
16
16
  import { getSenderAddress } from "../../actions/public/getSenderAddress"
17
- import type { Prettify } from "../../types"
17
+ import type {
18
+ ENTRYPOINT_ADDRESS_V06_TYPE,
19
+ ENTRYPOINT_ADDRESS_V07_TYPE,
20
+ Prettify
21
+ } from "../../types"
22
+ import type { EntryPoint } from "../../types/entrypoint"
23
+ import { getEntryPointVersion } from "../../utils"
18
24
  import { getUserOperationHash } from "../../utils/getUserOperationHash"
19
25
  import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed"
20
26
  import {
@@ -24,83 +30,90 @@ import {
24
30
  } from "../types"
25
31
 
26
32
  export type SimpleSmartAccount<
33
+ entryPoint extends EntryPoint,
27
34
  transport extends Transport = Transport,
28
35
  chain extends Chain | undefined = Chain | undefined
29
- > = SmartAccount<"SimpleSmartAccount", transport, chain>
36
+ > = SmartAccount<entryPoint, "SimpleSmartAccount", transport, chain>
30
37
 
31
- const getAccountInitCode = async (
32
- factoryAddress: Address,
33
- owner: Address,
34
- index = 0n
35
- ): Promise<Hex> => {
38
+ const getAccountInitCode = async (owner: Address, index = 0n): Promise<Hex> => {
36
39
  if (!owner) throw new Error("Owner account not found")
37
40
 
38
- return concatHex([
39
- factoryAddress,
40
- encodeFunctionData({
41
- abi: [
42
- {
43
- inputs: [
44
- {
45
- internalType: "address",
46
- name: "owner",
47
- type: "address"
48
- },
49
- {
50
- internalType: "uint256",
51
- name: "salt",
52
- type: "uint256"
53
- }
54
- ],
55
- name: "createAccount",
56
- outputs: [
57
- {
58
- internalType: "contract SimpleAccount",
59
- name: "ret",
60
- type: "address"
61
- }
62
- ],
63
- stateMutability: "nonpayable",
64
- type: "function"
65
- }
66
- ],
67
- functionName: "createAccount",
68
- args: [owner, index]
69
- }) as Hex
70
- ])
41
+ return encodeFunctionData({
42
+ abi: [
43
+ {
44
+ inputs: [
45
+ {
46
+ internalType: "address",
47
+ name: "owner",
48
+ type: "address"
49
+ },
50
+ {
51
+ internalType: "uint256",
52
+ name: "salt",
53
+ type: "uint256"
54
+ }
55
+ ],
56
+ name: "createAccount",
57
+ outputs: [
58
+ {
59
+ internalType: "contract SimpleAccount",
60
+ name: "ret",
61
+ type: "address"
62
+ }
63
+ ],
64
+ stateMutability: "nonpayable",
65
+ type: "function"
66
+ }
67
+ ],
68
+ functionName: "createAccount",
69
+ args: [owner, index]
70
+ })
71
71
  }
72
72
 
73
73
  const getAccountAddress = async <
74
+ entryPoint extends EntryPoint,
74
75
  TTransport extends Transport = Transport,
75
76
  TChain extends Chain | undefined = Chain | undefined
76
77
  >({
77
78
  client,
78
79
  factoryAddress,
79
- entryPoint,
80
+ entryPoint: entryPointAddress,
80
81
  owner,
81
82
  index = 0n
82
83
  }: {
83
84
  client: Client<TTransport, TChain>
84
85
  factoryAddress: Address
85
86
  owner: Address
86
- entryPoint: Address
87
+ entryPoint: entryPoint
87
88
  index?: bigint
88
89
  }): Promise<Address> => {
89
- const initCode = await getAccountInitCode(factoryAddress, owner, index)
90
+ const entryPointVersion = getEntryPointVersion(entryPointAddress)
91
+
92
+ const factoryData = await getAccountInitCode(owner, index)
90
93
 
91
- return getSenderAddress(client, {
92
- initCode,
93
- entryPoint
94
+ if (entryPointVersion === "v0.6") {
95
+ return getSenderAddress<ENTRYPOINT_ADDRESS_V06_TYPE>(client, {
96
+ initCode: concatHex([factoryAddress, factoryData]),
97
+ entryPoint: entryPointAddress as ENTRYPOINT_ADDRESS_V06_TYPE
98
+ })
99
+ }
100
+
101
+ // Get the sender address based on the init code
102
+ return getSenderAddress<ENTRYPOINT_ADDRESS_V07_TYPE>(client, {
103
+ factory: factoryAddress,
104
+ factoryData,
105
+ entryPoint: entryPointAddress as ENTRYPOINT_ADDRESS_V07_TYPE
94
106
  })
95
107
  }
96
108
 
97
109
  export type SignerToSimpleSmartAccountParameters<
110
+ entryPoint extends EntryPoint,
98
111
  TSource extends string = "custom",
99
112
  TAddress extends Address = Address
100
113
  > = Prettify<{
101
114
  signer: SmartAccountSigner<TSource, TAddress>
102
115
  factoryAddress: Address
103
- entryPoint: Address
116
+ entryPoint: entryPoint
104
117
  index?: bigint
105
118
  address?: Address
106
119
  }>
@@ -111,6 +124,7 @@ export type SignerToSimpleSmartAccountParameters<
111
124
  * @returns A Private Key Simple Account.
112
125
  */
113
126
  export async function signerToSimpleSmartAccount<
127
+ entryPoint extends EntryPoint,
114
128
  TTransport extends Transport = Transport,
115
129
  TChain extends Chain | undefined = Chain | undefined,
116
130
  TSource extends string = "custom",
@@ -120,11 +134,11 @@ export async function signerToSimpleSmartAccount<
120
134
  {
121
135
  signer,
122
136
  factoryAddress,
123
- entryPoint,
137
+ entryPoint: entryPointAddress,
124
138
  index = 0n,
125
139
  address
126
- }: SignerToSimpleSmartAccountParameters<TSource, TAddress>
127
- ): Promise<SimpleSmartAccount<TTransport, TChain>> {
140
+ }: SignerToSimpleSmartAccountParameters<entryPoint, TSource, TAddress>
141
+ ): Promise<SimpleSmartAccount<entryPoint, TTransport, TChain>> {
128
142
  const viemSigner: LocalAccount = {
129
143
  ...signer,
130
144
  signTransaction: (_, __) => {
@@ -134,10 +148,10 @@ export async function signerToSimpleSmartAccount<
134
148
 
135
149
  const [accountAddress, chainId] = await Promise.all([
136
150
  address ??
137
- getAccountAddress<TTransport, TChain>({
151
+ getAccountAddress<entryPoint, TTransport, TChain>({
138
152
  client,
139
153
  factoryAddress,
140
- entryPoint,
154
+ entryPoint: entryPointAddress,
141
155
  owner: viemSigner.address,
142
156
  index
143
157
  }),
@@ -179,12 +193,12 @@ export async function signerToSimpleSmartAccount<
179
193
  ...account,
180
194
  client: client,
181
195
  publicKey: accountAddress,
182
- entryPoint: entryPoint,
196
+ entryPoint: entryPointAddress,
183
197
  source: "SimpleSmartAccount",
184
198
  async getNonce() {
185
199
  return getAccountNonce(client, {
186
200
  sender: accountAddress,
187
- entryPoint: entryPoint
201
+ entryPoint: entryPointAddress
188
202
  })
189
203
  },
190
204
  async signUserOperation(userOperation) {
@@ -192,7 +206,7 @@ export async function signerToSimpleSmartAccount<
192
206
  message: {
193
207
  raw: getUserOperationHash({
194
208
  userOperation,
195
- entryPoint: entryPoint,
209
+ entryPoint: entryPointAddress,
196
210
  chainId: chainId
197
211
  })
198
212
  }
@@ -208,7 +222,28 @@ export async function signerToSimpleSmartAccount<
208
222
 
209
223
  if (smartAccountDeployed) return "0x"
210
224
 
211
- return getAccountInitCode(factoryAddress, viemSigner.address, index)
225
+ return concatHex([
226
+ factoryAddress,
227
+ await getAccountInitCode(viemSigner.address, index)
228
+ ])
229
+ },
230
+ async getFactory() {
231
+ if (smartAccountDeployed) return undefined
232
+ smartAccountDeployed = await isSmartAccountDeployed(
233
+ client,
234
+ accountAddress
235
+ )
236
+ if (smartAccountDeployed) return undefined
237
+ return factoryAddress
238
+ },
239
+ async getFactoryData() {
240
+ if (smartAccountDeployed) return undefined
241
+ smartAccountDeployed = await isSmartAccountDeployed(
242
+ client,
243
+ accountAddress
244
+ )
245
+ if (smartAccountDeployed) return undefined
246
+ return getAccountInitCode(viemSigner.address, index)
212
247
  },
213
248
  async encodeDeployCallData(_) {
214
249
  throw new Error("Simple account doesn't support account deployment")
@@ -220,6 +255,36 @@ export async function signerToSimpleSmartAccount<
220
255
  value: bigint
221
256
  data: Hex
222
257
  }[]
258
+
259
+ if (getEntryPointVersion(entryPointAddress) === "v0.6") {
260
+ return encodeFunctionData({
261
+ abi: [
262
+ {
263
+ inputs: [
264
+ {
265
+ internalType: "address[]",
266
+ name: "dest",
267
+ type: "address[]"
268
+ },
269
+ {
270
+ internalType: "bytes[]",
271
+ name: "func",
272
+ type: "bytes[]"
273
+ }
274
+ ],
275
+ name: "executeBatch",
276
+ outputs: [],
277
+ stateMutability: "nonpayable",
278
+ type: "function"
279
+ }
280
+ ],
281
+ functionName: "executeBatch",
282
+ args: [
283
+ argsArray.map((a) => a.to),
284
+ argsArray.map((a) => a.data)
285
+ ]
286
+ })
287
+ }
223
288
  return encodeFunctionData({
224
289
  abi: [
225
290
  {
@@ -229,6 +294,11 @@ export async function signerToSimpleSmartAccount<
229
294
  name: "dest",
230
295
  type: "address[]"
231
296
  },
297
+ {
298
+ internalType: "uint256[]",
299
+ name: "value",
300
+ type: "uint256[]"
301
+ },
232
302
  {
233
303
  internalType: "bytes[]",
234
304
  name: "func",
@@ -244,6 +314,7 @@ export async function signerToSimpleSmartAccount<
244
314
  functionName: "executeBatch",
245
315
  args: [
246
316
  argsArray.map((a) => a.to),
317
+ argsArray.map((a) => a.value),
247
318
  argsArray.map((a) => a.data)
248
319
  ]
249
320
  })
package/accounts/types.ts CHANGED
@@ -7,7 +7,8 @@ import {
7
7
  type LocalAccount
8
8
  } from "viem"
9
9
  import type { Chain, EncodeDeployDataParameters, Transport } from "viem"
10
- import { type UserOperation } from "../types"
10
+ import type { UserOperation } from "../types"
11
+ import type { EntryPoint, GetEntryPointVersion } from "../types/entrypoint"
11
12
 
12
13
  export class SignTransactionNotSupportedBySmartAccount extends BaseError {
13
14
  override name = "SignTransactionNotSupportedBySmartAccount"
@@ -26,15 +27,18 @@ export class SignTransactionNotSupportedBySmartAccount extends BaseError {
26
27
  }
27
28
 
28
29
  export type SmartAccount<
30
+ entryPoint extends EntryPoint,
29
31
  Name extends string = string,
30
32
  transport extends Transport = Transport,
31
33
  chain extends Chain | undefined = Chain | undefined,
32
34
  TAbi extends Abi | readonly unknown[] = Abi
33
35
  > = LocalAccount<Name> & {
34
36
  client: Client<transport, chain>
35
- entryPoint: Address
37
+ entryPoint: entryPoint
36
38
  getNonce: () => Promise<bigint>
37
39
  getInitCode: () => Promise<Hex>
40
+ getFactory: () => Promise<Address | undefined>
41
+ getFactoryData: () => Promise<Hex | undefined>
38
42
  encodeCallData: (
39
43
  args:
40
44
  | {
@@ -48,13 +52,17 @@ export type SmartAccount<
48
52
  data: Hex
49
53
  }[]
50
54
  ) => Promise<Hex>
51
- getDummySignature(userOperation: UserOperation): Promise<Hex>
55
+ getDummySignature(
56
+ userOperation: UserOperation<GetEntryPointVersion<entryPoint>>
57
+ ): Promise<Hex>
52
58
  encodeDeployCallData: ({
53
59
  abi,
54
60
  args,
55
61
  bytecode
56
62
  }: EncodeDeployDataParameters<TAbi>) => Promise<Hex>
57
- signUserOperation: (userOperation: UserOperation) => Promise<Hex>
63
+ signUserOperation: (
64
+ userOperation: UserOperation<GetEntryPointVersion<entryPoint>>
65
+ ) => Promise<Hex>
58
66
  }
59
67
 
60
68
  export type SmartAccountSigner<
@@ -1,5 +1,6 @@
1
1
  import type { Account, Chain, Client, Transport } from "viem"
2
2
  import type { BundlerClient } from "../../clients/createBundlerClient"
3
+ import type { EntryPoint } from "../../types"
3
4
  import type { BundlerRpcSchema } from "../../types/bundler"
4
5
 
5
6
  /**
@@ -25,11 +26,12 @@ import type { BundlerRpcSchema } from "../../types/bundler"
25
26
  *
26
27
  */
27
28
  export const chainId = async <
29
+ entryPoint extends EntryPoint,
28
30
  TTransport extends Transport = Transport,
29
31
  TChain extends Chain | undefined = Chain | undefined,
30
32
  TAccount extends Account | undefined = Account | undefined
31
33
  >(
32
- client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>
34
+ client: Client<TTransport, TChain, TAccount, BundlerRpcSchema<entryPoint>>
33
35
  ) => {
34
36
  return Number(
35
37
  await client.request({
@@ -1,38 +1,59 @@
1
1
  import {
2
2
  type Account,
3
- type Address,
4
3
  BaseError,
5
4
  type Chain,
6
5
  type Client,
6
+ type Hex,
7
7
  type Transport
8
8
  } from "viem"
9
9
  import type { PartialBy } from "viem/types/utils"
10
10
  import type { BundlerClient } from "../../clients/createBundlerClient"
11
11
  import type { Prettify } from "../../types/"
12
12
  import type { BundlerRpcSchema, StateOverrides } from "../../types/bundler"
13
+ import type { EntryPoint, GetEntryPointVersion } from "../../types/entrypoint"
13
14
  import type { UserOperation } from "../../types/userOperation"
15
+ import { getEntryPointVersion } from "../../utils"
14
16
  import { deepHexlify } from "../../utils/deepHexlify"
15
17
  import {
16
18
  type GetEstimateUserOperationGasErrorReturnType,
17
19
  getEstimateUserOperationGasError
18
20
  } from "../../utils/errors/getEstimateUserOperationGasError"
19
21
 
20
- export type EstimateUserOperationGasParameters = {
21
- userOperation: PartialBy<
22
- UserOperation,
23
- "callGasLimit" | "preVerificationGas" | "verificationGasLimit"
24
- >
25
- entryPoint: Address
26
- }
22
+ export type EstimateUserOperationGasParameters<entryPoint extends EntryPoint> =
23
+ {
24
+ userOperation: GetEntryPointVersion<entryPoint> extends "v0.6"
25
+ ? PartialBy<
26
+ UserOperation<"v0.6">,
27
+ "callGasLimit" | "preVerificationGas" | "verificationGasLimit"
28
+ >
29
+ : PartialBy<
30
+ UserOperation<"v0.7">,
31
+ | "callGasLimit"
32
+ | "preVerificationGas"
33
+ | "verificationGasLimit"
34
+ | "paymasterVerificationGasLimit"
35
+ | "paymasterPostOpGasLimit"
36
+ >
37
+ entryPoint: entryPoint
38
+ }
27
39
 
28
- export type EstimateUserOperationGasReturnType = {
29
- preVerificationGas: bigint
30
- verificationGasLimit: bigint
31
- callGasLimit: bigint
32
- }
40
+ export type EstimateUserOperationGasReturnType<entryPoint extends EntryPoint> =
41
+ GetEntryPointVersion<entryPoint> extends "v0.6"
42
+ ? {
43
+ preVerificationGas: bigint
44
+ verificationGasLimit: bigint
45
+ callGasLimit: bigint
46
+ }
47
+ : {
48
+ preVerificationGas: bigint
49
+ verificationGasLimit: bigint
50
+ callGasLimit: bigint
51
+ paymasterVerificationGasLimit: bigint | undefined
52
+ paymasterPostOpGasLimit: bigint | undefined
53
+ }
33
54
 
34
- export type EstimateUserOperationErrorType =
35
- GetEstimateUserOperationGasErrorReturnType
55
+ export type EstimateUserOperationErrorType<entryPoint extends EntryPoint> =
56
+ GetEstimateUserOperationGasErrorReturnType<entryPoint>
36
57
 
37
58
  /**
38
59
  * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
@@ -62,14 +83,15 @@ export type EstimateUserOperationErrorType =
62
83
  *
63
84
  */
64
85
  export const estimateUserOperationGas = async <
86
+ entryPoint extends EntryPoint,
65
87
  TTransport extends Transport = Transport,
66
88
  TChain extends Chain | undefined = Chain | undefined,
67
89
  TAccount extends Account | undefined = Account | undefined
68
90
  >(
69
- client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>,
70
- args: Prettify<EstimateUserOperationGasParameters>,
91
+ client: Client<TTransport, TChain, TAccount, BundlerRpcSchema<entryPoint>>,
92
+ args: Prettify<EstimateUserOperationGasParameters<entryPoint>>,
71
93
  stateOverrides?: StateOverrides
72
- ): Promise<Prettify<EstimateUserOperationGasReturnType>> => {
94
+ ): Promise<EstimateUserOperationGasReturnType<entryPoint>> => {
73
95
  const { userOperation, entryPoint } = args
74
96
 
75
97
  const userOperationWithBigIntAsHex = deepHexlify(userOperation)
@@ -87,11 +109,44 @@ export const estimateUserOperationGas = async <
87
109
  : [userOperationWithBigIntAsHex, entryPoint]
88
110
  })
89
111
 
90
- return {
91
- preVerificationGas: BigInt(response.preVerificationGas || 0),
92
- verificationGasLimit: BigInt(response.verificationGasLimit || 0),
93
- callGasLimit: BigInt(response.callGasLimit || 0)
112
+ const entryPointVersion = getEntryPointVersion(entryPoint)
113
+
114
+ if (entryPointVersion === "v0.6") {
115
+ const responseV06 = response as {
116
+ preVerificationGas: Hex
117
+ verificationGasLimit: Hex
118
+ callGasLimit: Hex
119
+ }
120
+
121
+ return {
122
+ preVerificationGas: BigInt(responseV06.preVerificationGas || 0),
123
+ verificationGasLimit: BigInt(
124
+ responseV06.verificationGasLimit || 0
125
+ ),
126
+ callGasLimit: BigInt(responseV06.callGasLimit || 0)
127
+ } as EstimateUserOperationGasReturnType<entryPoint>
128
+ }
129
+
130
+ const responseV07 = response as {
131
+ preVerificationGas: Hex
132
+ verificationGasLimit: Hex
133
+ callGasLimit: Hex
134
+ paymasterVerificationGasLimit: Hex | undefined
135
+ paymasterPostOpGasLimit: Hex | undefined
94
136
  }
137
+
138
+ return {
139
+ preVerificationGas: BigInt(responseV07.preVerificationGas || 0),
140
+ verificationGasLimit: BigInt(responseV07.verificationGasLimit || 0),
141
+ callGasLimit: BigInt(responseV07.callGasLimit || 0),
142
+ paymasterVerificationGasLimit:
143
+ responseV07.paymasterVerificationGasLimit
144
+ ? BigInt(responseV07.paymasterVerificationGasLimit)
145
+ : undefined,
146
+ paymasterPostOpGasLimit: responseV07.paymasterPostOpGasLimit
147
+ ? BigInt(responseV07.paymasterPostOpGasLimit)
148
+ : undefined
149
+ } as EstimateUserOperationGasReturnType<entryPoint>
95
150
  } catch (err) {
96
151
  throw getEstimateUserOperationGasError(err as BaseError, args)
97
152
  }
@@ -2,14 +2,16 @@ import type { Account, Address, Chain, Client, Hash, Transport } from "viem"
2
2
  import type { BundlerClient } from "../../clients/createBundlerClient"
3
3
  import type { Prettify } from "../../types/"
4
4
  import type { BundlerRpcSchema } from "../../types/bundler"
5
+ import type { EntryPoint, GetEntryPointVersion } from "../../types/entrypoint"
5
6
  import type { UserOperation } from "../../types/userOperation"
7
+ import { ENTRYPOINT_ADDRESS_V06 } from "../../utils/getEntryPointVersion"
6
8
 
7
9
  export type GetUserOperationByHashParameters = {
8
10
  hash: Hash
9
11
  }
10
12
 
11
- export type GetUserOperationByHashReturnType = {
12
- userOperation: UserOperation
13
+ export type GetUserOperationByHashReturnType<entryPoint extends EntryPoint> = {
14
+ userOperation: UserOperation<GetEntryPointVersion<entryPoint>>
13
15
  entryPoint: Address
14
16
  transactionHash: Hash
15
17
  blockHash: Hash
@@ -39,13 +41,14 @@ export type GetUserOperationByHashReturnType = {
39
41
  *
40
42
  */
41
43
  export const getUserOperationByHash = async <
44
+ entryPoint extends EntryPoint,
42
45
  TTransport extends Transport = Transport,
43
46
  TChain extends Chain | undefined = Chain | undefined,
44
47
  TAccount extends Account | undefined = Account | undefined
45
48
  >(
46
- client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>,
49
+ client: Client<TTransport, TChain, TAccount, BundlerRpcSchema<entryPoint>>,
47
50
  { hash }: Prettify<GetUserOperationByHashParameters>
48
- ): Promise<Prettify<GetUserOperationByHashReturnType> | null> => {
51
+ ): Promise<Prettify<GetUserOperationByHashReturnType<entryPoint>> | null> => {
49
52
  const params: [Hash] = [hash]
50
53
 
51
54
  const response = await client.request({
@@ -57,23 +60,49 @@ export const getUserOperationByHash = async <
57
60
 
58
61
  const {
59
62
  userOperation,
60
- entryPoint,
63
+ entryPoint: entryPointAddress,
61
64
  transactionHash,
62
65
  blockHash,
63
66
  blockNumber
64
67
  } = response
65
68
 
66
69
  return {
67
- userOperation: {
68
- ...userOperation,
69
- nonce: BigInt(userOperation.nonce),
70
- callGasLimit: BigInt(userOperation.callGasLimit),
71
- verificationGasLimit: BigInt(userOperation.verificationGasLimit),
72
- preVerificationGas: BigInt(userOperation.preVerificationGas),
73
- maxFeePerGas: BigInt(userOperation.maxFeePerGas),
74
- maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
75
- } as UserOperation,
76
- entryPoint: entryPoint,
70
+ userOperation: (entryPointAddress === ENTRYPOINT_ADDRESS_V06
71
+ ? {
72
+ ...userOperation,
73
+ nonce: BigInt(userOperation.nonce),
74
+ callGasLimit: BigInt(userOperation.callGasLimit),
75
+ verificationGasLimit: BigInt(
76
+ userOperation.verificationGasLimit
77
+ ),
78
+ preVerificationGas: BigInt(userOperation.preVerificationGas),
79
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
80
+ maxPriorityFeePerGas: BigInt(
81
+ userOperation.maxPriorityFeePerGas
82
+ )
83
+ }
84
+ : {
85
+ ...userOperation,
86
+ nonce: BigInt(userOperation.nonce),
87
+ callGasLimit: BigInt(userOperation.callGasLimit),
88
+ verificationGasLimit: BigInt(
89
+ userOperation.verificationGasLimit
90
+ ),
91
+ preVerificationGas: BigInt(userOperation.preVerificationGas),
92
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
93
+ maxPriorityFeePerGas: BigInt(
94
+ userOperation.maxPriorityFeePerGas
95
+ ),
96
+ paymasterVerificationGasLimit:
97
+ userOperation.paymasterVerificationGasLimit
98
+ ? BigInt(userOperation.paymasterVerificationGasLimit)
99
+ : undefined,
100
+ paymasterPostOpGasLimit:
101
+ userOperation.paymasterVerificationGasLimit
102
+ ? BigInt(userOperation.paymasterPostOpGasLimit)
103
+ : undefined
104
+ }) as UserOperation<GetEntryPointVersion<entryPoint>>,
105
+ entryPoint: entryPointAddress,
77
106
  transactionHash: transactionHash,
78
107
  blockHash: blockHash,
79
108
  blockNumber: BigInt(blockNumber)
@@ -10,6 +10,7 @@ import type {
10
10
  import type { BundlerClient } from "../../clients/createBundlerClient"
11
11
  import type { Prettify } from "../../types"
12
12
  import type { BundlerRpcSchema } from "../../types/bundler"
13
+ import type { EntryPoint } from "../../types/entrypoint"
13
14
  import type { TStatus } from "../../types/userOperation"
14
15
  import { transactionReceiptStatus } from "../../utils/deepHexlify"
15
16
 
@@ -73,11 +74,12 @@ export type GetUserOperationReceiptReturnType = {
73
74
  *
74
75
  */
75
76
  export const getUserOperationReceipt = async <
77
+ entryPoint extends EntryPoint,
76
78
  TTransport extends Transport = Transport,
77
79
  TChain extends Chain | undefined = Chain | undefined,
78
80
  TAccount extends Account | undefined = Account | undefined
79
81
  >(
80
- client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>,
82
+ client: Client<TTransport, TChain, TAccount, BundlerRpcSchema<entryPoint>>,
81
83
  { hash }: Prettify<GetUserOperationReceiptParameters>
82
84
  ): Promise<Prettify<GetUserOperationReceiptReturnType> | null> => {
83
85
  const params: [Hash] = [hash]