@zerodev/sdk 5.3.26 → 5.4.0-beta.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 (320) hide show
  1. package/_cjs/accounts/index.js.map +1 -1
  2. package/_cjs/accounts/kernel/createKernelAccount.js +171 -199
  3. package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
  4. package/_cjs/accounts/kernel/utils/account/ep0_6/encodeCallData.js +13 -9
  5. package/_cjs/accounts/kernel/utils/account/ep0_6/encodeCallData.js.map +1 -1
  6. package/_cjs/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.js.map +1 -1
  7. package/_cjs/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js +18 -17
  8. package/_cjs/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js.map +1 -1
  9. package/_cjs/accounts/kernel/utils/account/ep0_7/encodeCallData.js +12 -8
  10. package/_cjs/accounts/kernel/utils/account/ep0_7/encodeCallData.js.map +1 -1
  11. package/_cjs/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.js.map +1 -1
  12. package/_cjs/accounts/kernel/utils/common/accountMetadata.js.map +1 -1
  13. package/_cjs/accounts/kernel/utils/common/getActionSelector.js +2 -2
  14. package/_cjs/accounts/kernel/utils/common/getActionSelector.js.map +1 -1
  15. package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.js +2 -2
  16. package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.js.map +1 -1
  17. package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.js +1 -1
  18. package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.js.map +1 -1
  19. package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.js +1 -1
  20. package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.js.map +1 -1
  21. package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js +2 -2
  22. package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js.map +1 -1
  23. package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteCall.js +2 -2
  24. package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteCall.js.map +1 -1
  25. package/_cjs/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.js.map +1 -1
  26. package/_cjs/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js.map +1 -1
  27. package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
  28. package/_cjs/accounts/kernel/v1/createKernelAccountV1.js +81 -94
  29. package/_cjs/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
  30. package/_cjs/accounts/kernel/v2/createKernelAccountV0_2.js +104 -110
  31. package/_cjs/accounts/kernel/v2/createKernelAccountV0_2.js.map +1 -1
  32. package/_cjs/accounts/utils/getCustomNonceKeyFromString.js +2 -4
  33. package/_cjs/accounts/utils/getCustomNonceKeyFromString.js.map +1 -1
  34. package/_cjs/accounts/utils/index.js +1 -7
  35. package/_cjs/accounts/utils/index.js.map +1 -1
  36. package/_cjs/accounts/utils/multisend.js.map +1 -1
  37. package/_cjs/accounts/utils/toKernelPluginManager.js +14 -16
  38. package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
  39. package/_cjs/actions/account-client/changeSudoValidator.js +27 -21
  40. package/_cjs/actions/account-client/changeSudoValidator.js.map +1 -1
  41. package/_cjs/actions/account-client/getKernelV3ModuleCurrentNonce.js +8 -6
  42. package/_cjs/actions/account-client/getKernelV3ModuleCurrentNonce.js.map +1 -1
  43. package/_cjs/actions/account-client/invalidateNonce.js +20 -15
  44. package/_cjs/actions/account-client/invalidateNonce.js.map +1 -1
  45. package/_cjs/actions/account-client/sendTransaction.js +42 -0
  46. package/_cjs/actions/account-client/sendTransaction.js.map +1 -0
  47. package/_cjs/actions/account-client/signMessage.js +15 -0
  48. package/_cjs/actions/account-client/signMessage.js.map +1 -0
  49. package/_cjs/actions/account-client/signTypedData.js +32 -0
  50. package/_cjs/actions/account-client/signTypedData.js.map +1 -0
  51. package/_cjs/actions/account-client/signUserOperation.js +7 -5
  52. package/_cjs/actions/account-client/signUserOperation.js.map +1 -1
  53. package/_cjs/actions/account-client/uninstallPlugin.js +13 -12
  54. package/_cjs/actions/account-client/uninstallPlugin.js.map +1 -1
  55. package/_cjs/actions/account-client/writeContract.js +21 -0
  56. package/_cjs/actions/account-client/writeContract.js.map +1 -0
  57. package/_cjs/actions/index.js +13 -3
  58. package/_cjs/actions/index.js.map +1 -1
  59. package/_cjs/actions/paymaster/estimateGasInERC20.js +4 -4
  60. package/_cjs/actions/paymaster/estimateGasInERC20.js.map +1 -1
  61. package/_cjs/actions/paymaster/sponsorUserOperation.js +4 -6
  62. package/_cjs/actions/paymaster/sponsorUserOperation.js.map +1 -1
  63. package/_cjs/actions/public/getAccountNonce.js +38 -0
  64. package/_cjs/actions/public/getAccountNonce.js.map +1 -0
  65. package/_cjs/actions/public/getSenderAddress.js +166 -0
  66. package/_cjs/actions/public/getSenderAddress.js.map +1 -0
  67. package/_cjs/actions/public/index.js +8 -0
  68. package/_cjs/actions/public/index.js.map +1 -0
  69. package/_cjs/clients/decorators/kernel.js +17 -27
  70. package/_cjs/clients/decorators/kernel.js.map +1 -1
  71. package/_cjs/clients/fallbackKernelAccountClient.js.map +1 -1
  72. package/_cjs/clients/kernelAccountClient.js +27 -45
  73. package/_cjs/clients/kernelAccountClient.js.map +1 -1
  74. package/_cjs/clients/paymasterClient.js +7 -18
  75. package/_cjs/clients/paymasterClient.js.map +1 -1
  76. package/_cjs/errors/index.js +18 -0
  77. package/_cjs/errors/index.js.map +1 -0
  78. package/_cjs/gasTokenAddresses.js +2 -1
  79. package/_cjs/gasTokenAddresses.js.map +1 -1
  80. package/_cjs/index.js.map +1 -1
  81. package/_cjs/providers/KernelEIP1193Provider.js.map +1 -1
  82. package/_cjs/types/kernel.js.map +1 -1
  83. package/_cjs/utils.js +27 -7
  84. package/_cjs/utils.js.map +1 -1
  85. package/_esm/accounts/index.js.map +1 -1
  86. package/_esm/accounts/kernel/createKernelAccount.js +181 -217
  87. package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
  88. package/_esm/accounts/kernel/utils/account/ep0_6/encodeCallData.js +13 -9
  89. package/_esm/accounts/kernel/utils/account/ep0_6/encodeCallData.js.map +1 -1
  90. package/_esm/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.js.map +1 -1
  91. package/_esm/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js +18 -17
  92. package/_esm/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js.map +1 -1
  93. package/_esm/accounts/kernel/utils/account/ep0_7/encodeCallData.js +12 -8
  94. package/_esm/accounts/kernel/utils/account/ep0_7/encodeCallData.js.map +1 -1
  95. package/_esm/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.js.map +1 -1
  96. package/_esm/accounts/kernel/utils/common/accountMetadata.js.map +1 -1
  97. package/_esm/accounts/kernel/utils/common/getActionSelector.js +2 -2
  98. package/_esm/accounts/kernel/utils/common/getActionSelector.js.map +1 -1
  99. package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.js +2 -2
  100. package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.js.map +1 -1
  101. package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.js +1 -1
  102. package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.js.map +1 -1
  103. package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.js +1 -1
  104. package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.js.map +1 -1
  105. package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js +2 -2
  106. package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js.map +1 -1
  107. package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteCall.js +2 -2
  108. package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteCall.js.map +1 -1
  109. package/_esm/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.js.map +1 -1
  110. package/_esm/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js.map +1 -1
  111. package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
  112. package/_esm/accounts/kernel/v1/createKernelAccountV1.js +91 -98
  113. package/_esm/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
  114. package/_esm/accounts/kernel/v2/createKernelAccountV0_2.js +105 -118
  115. package/_esm/accounts/kernel/v2/createKernelAccountV0_2.js.map +1 -1
  116. package/_esm/accounts/utils/getCustomNonceKeyFromString.js +2 -4
  117. package/_esm/accounts/utils/getCustomNonceKeyFromString.js.map +1 -1
  118. package/_esm/accounts/utils/index.js +0 -5
  119. package/_esm/accounts/utils/index.js.map +1 -1
  120. package/_esm/accounts/utils/multisend.js.map +1 -1
  121. package/_esm/accounts/utils/toKernelPluginManager.js +14 -16
  122. package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
  123. package/_esm/actions/account-client/changeSudoValidator.js +23 -17
  124. package/_esm/actions/account-client/changeSudoValidator.js.map +1 -1
  125. package/_esm/actions/account-client/getKernelV3ModuleCurrentNonce.js +8 -6
  126. package/_esm/actions/account-client/getKernelV3ModuleCurrentNonce.js.map +1 -1
  127. package/_esm/actions/account-client/invalidateNonce.js +20 -15
  128. package/_esm/actions/account-client/invalidateNonce.js.map +1 -1
  129. package/_esm/actions/account-client/sendTransaction.js +85 -0
  130. package/_esm/actions/account-client/sendTransaction.js.map +1 -0
  131. package/_esm/actions/account-client/signMessage.js +58 -0
  132. package/_esm/actions/account-client/signMessage.js.map +1 -0
  133. package/_esm/actions/account-client/signTypedData.js +127 -0
  134. package/_esm/actions/account-client/signTypedData.js.map +1 -0
  135. package/_esm/actions/account-client/signUserOperation.js +7 -5
  136. package/_esm/actions/account-client/signUserOperation.js.map +1 -1
  137. package/_esm/actions/account-client/uninstallPlugin.js +10 -9
  138. package/_esm/actions/account-client/uninstallPlugin.js.map +1 -1
  139. package/_esm/actions/account-client/writeContract.js +18 -0
  140. package/_esm/actions/account-client/writeContract.js.map +1 -0
  141. package/_esm/actions/index.js +6 -1
  142. package/_esm/actions/index.js.map +1 -1
  143. package/_esm/actions/paymaster/estimateGasInERC20.js +3 -3
  144. package/_esm/actions/paymaster/estimateGasInERC20.js.map +1 -1
  145. package/_esm/actions/paymaster/sponsorUserOperation.js +3 -5
  146. package/_esm/actions/paymaster/sponsorUserOperation.js.map +1 -1
  147. package/_esm/actions/public/getAccountNonce.js +61 -0
  148. package/_esm/actions/public/getAccountNonce.js.map +1 -0
  149. package/_esm/actions/public/getSenderAddress.js +191 -0
  150. package/_esm/actions/public/getSenderAddress.js.map +1 -0
  151. package/_esm/actions/public/index.js +3 -0
  152. package/_esm/actions/public/index.js.map +1 -0
  153. package/_esm/clients/decorators/kernel.js +19 -28
  154. package/_esm/clients/decorators/kernel.js.map +1 -1
  155. package/_esm/clients/fallbackKernelAccountClient.js.map +1 -1
  156. package/_esm/clients/kernelAccountClient.js +28 -46
  157. package/_esm/clients/kernelAccountClient.js.map +1 -1
  158. package/_esm/clients/paymasterClient.js +8 -19
  159. package/_esm/clients/paymasterClient.js.map +1 -1
  160. package/_esm/errors/index.js +14 -0
  161. package/_esm/errors/index.js.map +1 -0
  162. package/_esm/gasTokenAddresses.js +2 -1
  163. package/_esm/gasTokenAddresses.js.map +1 -1
  164. package/_esm/index.js.map +1 -1
  165. package/_esm/providers/KernelEIP1193Provider.js.map +1 -1
  166. package/_esm/types/kernel.js.map +1 -1
  167. package/_esm/utils.js +29 -7
  168. package/_esm/utils.js.map +1 -1
  169. package/_types/accounts/index.d.ts +2 -2
  170. package/_types/accounts/index.d.ts.map +1 -1
  171. package/_types/accounts/kernel/createKernelAccount.d.ts +21 -18
  172. package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
  173. package/_types/accounts/kernel/utils/account/ep0_6/encodeCallData.d.ts +8 -3
  174. package/_types/accounts/kernel/utils/account/ep0_6/encodeCallData.d.ts.map +1 -1
  175. package/_types/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.d.ts +3 -2
  176. package/_types/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.d.ts.map +1 -1
  177. package/_types/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.d.ts +0 -1
  178. package/_types/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.d.ts.map +1 -1
  179. package/_types/accounts/kernel/utils/account/ep0_7/encodeCallData.d.ts +8 -3
  180. package/_types/accounts/kernel/utils/account/ep0_7/encodeCallData.d.ts.map +1 -1
  181. package/_types/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.d.ts +3 -2
  182. package/_types/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.d.ts.map +1 -1
  183. package/_types/accounts/kernel/utils/common/accountMetadata.d.ts +2 -2
  184. package/_types/accounts/kernel/utils/common/accountMetadata.d.ts.map +1 -1
  185. package/_types/accounts/kernel/utils/common/getActionSelector.d.ts +1 -1
  186. package/_types/accounts/kernel/utils/common/getActionSelector.d.ts.map +1 -1
  187. package/_types/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.d.ts +1 -1
  188. package/_types/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.d.ts.map +1 -1
  189. package/_types/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.d.ts +1 -1
  190. package/_types/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.d.ts.map +1 -1
  191. package/_types/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.d.ts +2 -3
  192. package/_types/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.d.ts.map +1 -1
  193. package/_types/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.d.ts +4 -5
  194. package/_types/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.d.ts.map +1 -1
  195. package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts +2 -3
  196. package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts.map +1 -1
  197. package/_types/accounts/kernel/utils/types.d.ts +2 -2
  198. package/_types/accounts/kernel/utils/types.d.ts.map +1 -1
  199. package/_types/accounts/kernel/v1/createKernelAccountV1.d.ts +18 -9
  200. package/_types/accounts/kernel/v1/createKernelAccountV1.d.ts.map +1 -1
  201. package/_types/accounts/kernel/v2/createKernelAccountV0_2.d.ts +9 -7
  202. package/_types/accounts/kernel/v2/createKernelAccountV0_2.d.ts.map +1 -1
  203. package/_types/accounts/utils/getCustomNonceKeyFromString.d.ts +2 -2
  204. package/_types/accounts/utils/getCustomNonceKeyFromString.d.ts.map +1 -1
  205. package/_types/accounts/utils/index.d.ts +0 -2
  206. package/_types/accounts/utils/index.d.ts.map +1 -1
  207. package/_types/accounts/utils/multisend.d.ts +2 -2
  208. package/_types/accounts/utils/multisend.d.ts.map +1 -1
  209. package/_types/accounts/utils/toKernelPluginManager.d.ts +4 -4
  210. package/_types/accounts/utils/toKernelPluginManager.d.ts.map +1 -1
  211. package/_types/actions/account-client/changeSudoValidator.d.ts +5 -11
  212. package/_types/actions/account-client/changeSudoValidator.d.ts.map +1 -1
  213. package/_types/actions/account-client/getKernelV3ModuleCurrentNonce.d.ts +2 -5
  214. package/_types/actions/account-client/getKernelV3ModuleCurrentNonce.d.ts.map +1 -1
  215. package/_types/actions/account-client/invalidateNonce.d.ts +4 -6
  216. package/_types/actions/account-client/invalidateNonce.d.ts.map +1 -1
  217. package/_types/actions/account-client/sendTransaction.d.ts +50 -0
  218. package/_types/actions/account-client/sendTransaction.d.ts.map +1 -0
  219. package/_types/actions/account-client/signMessage.d.ts +50 -0
  220. package/_types/actions/account-client/signMessage.d.ts.map +1 -0
  221. package/_types/actions/account-client/signTypedData.d.ts +104 -0
  222. package/_types/actions/account-client/signTypedData.d.ts.map +1 -0
  223. package/_types/actions/account-client/signUserOperation.d.ts +4 -6
  224. package/_types/actions/account-client/signUserOperation.d.ts.map +1 -1
  225. package/_types/actions/account-client/uninstallPlugin.d.ts +5 -7
  226. package/_types/actions/account-client/uninstallPlugin.d.ts.map +1 -1
  227. package/_types/actions/account-client/writeContract.d.ts +4 -0
  228. package/_types/actions/account-client/writeContract.d.ts.map +1 -0
  229. package/_types/actions/index.d.ts +6 -1
  230. package/_types/actions/index.d.ts.map +1 -1
  231. package/_types/actions/paymaster/estimateGasInERC20.d.ts +1305 -4
  232. package/_types/actions/paymaster/estimateGasInERC20.d.ts.map +1 -1
  233. package/_types/actions/paymaster/sponsorUserOperation.d.ts +1314 -10
  234. package/_types/actions/paymaster/sponsorUserOperation.d.ts.map +1 -1
  235. package/_types/actions/public/getAccountNonce.d.ts +34 -0
  236. package/_types/actions/public/getAccountNonce.d.ts.map +1 -0
  237. package/_types/actions/public/getSenderAddress.d.ts +46 -0
  238. package/_types/actions/public/getSenderAddress.d.ts.map +1 -0
  239. package/_types/actions/public/index.d.ts +3 -0
  240. package/_types/actions/public/index.d.ts.map +1 -0
  241. package/_types/clients/decorators/kernel.d.ts +774 -20
  242. package/_types/clients/decorators/kernel.d.ts.map +1 -1
  243. package/_types/clients/fallbackKernelAccountClient.d.ts +255 -4
  244. package/_types/clients/fallbackKernelAccountClient.d.ts.map +1 -1
  245. package/_types/clients/kernelAccountClient.d.ts +34 -36
  246. package/_types/clients/kernelAccountClient.d.ts.map +1 -1
  247. package/_types/clients/paymasterClient.d.ts +10 -24
  248. package/_types/clients/paymasterClient.d.ts.map +1 -1
  249. package/_types/errors/index.d.ts +7 -0
  250. package/_types/errors/index.d.ts.map +1 -0
  251. package/_types/gasTokenAddresses.d.ts +1 -1
  252. package/_types/gasTokenAddresses.d.ts.map +1 -1
  253. package/_types/index.d.ts +1 -1
  254. package/_types/index.d.ts.map +1 -1
  255. package/_types/providers/KernelEIP1193Provider.d.ts +3 -4
  256. package/_types/providers/KernelEIP1193Provider.d.ts.map +1 -1
  257. package/_types/types/index.d.ts +1 -0
  258. package/_types/types/index.d.ts.map +1 -1
  259. package/_types/types/kernel.d.ts +25 -27
  260. package/_types/types/kernel.d.ts.map +1 -1
  261. package/_types/utils.d.ts +1310 -4
  262. package/_types/utils.d.ts.map +1 -1
  263. package/accounts/index.ts +5 -2
  264. package/accounts/kernel/createKernelAccount.ts +312 -357
  265. package/accounts/kernel/utils/account/ep0_6/encodeCallData.ts +22 -12
  266. package/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.ts +6 -3
  267. package/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.ts +22 -19
  268. package/accounts/kernel/utils/account/ep0_7/encodeCallData.ts +21 -11
  269. package/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.ts +6 -3
  270. package/accounts/kernel/utils/common/accountMetadata.ts +2 -7
  271. package/accounts/kernel/utils/common/getActionSelector.ts +3 -3
  272. package/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.ts +3 -3
  273. package/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.ts +1 -1
  274. package/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.ts +1 -1
  275. package/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.ts +3 -3
  276. package/accounts/kernel/utils/ep0_7/encodeExecuteCall.ts +2 -2
  277. package/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.ts +2 -8
  278. package/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.ts +4 -10
  279. package/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.ts +2 -8
  280. package/accounts/kernel/utils/types.ts +2 -2
  281. package/accounts/kernel/v1/createKernelAccountV1.ts +147 -174
  282. package/accounts/kernel/v2/createKernelAccountV0_2.ts +135 -179
  283. package/accounts/utils/getCustomNonceKeyFromString.ts +3 -6
  284. package/accounts/utils/index.ts +0 -9
  285. package/accounts/utils/multisend.ts +5 -2
  286. package/accounts/utils/toKernelPluginManager.ts +23 -27
  287. package/actions/account-client/changeSudoValidator.ts +61 -85
  288. package/actions/account-client/getKernelV3ModuleCurrentNonce.ts +12 -51
  289. package/actions/account-client/invalidateNonce.ts +38 -67
  290. package/actions/account-client/sendTransaction.ts +134 -0
  291. package/actions/account-client/signMessage.ts +75 -0
  292. package/actions/account-client/signTypedData.ts +159 -0
  293. package/actions/account-client/signUserOperation.ts +31 -63
  294. package/actions/account-client/uninstallPlugin.ts +35 -56
  295. package/actions/account-client/writeContract.ts +72 -0
  296. package/actions/index.ts +15 -6
  297. package/actions/paymaster/estimateGasInERC20.ts +12 -8
  298. package/actions/paymaster/sponsorUserOperation.ts +52 -50
  299. package/actions/public/getAccountNonce.ts +77 -0
  300. package/actions/public/getSenderAddress.ts +276 -0
  301. package/actions/public/index.ts +9 -0
  302. package/clients/decorators/kernel.ts +363 -159
  303. package/clients/fallbackKernelAccountClient.ts +9 -11
  304. package/clients/kernelAccountClient.ts +142 -104
  305. package/clients/paymasterClient.ts +69 -43
  306. package/errors/index.ts +17 -0
  307. package/gasTokenAddresses.ts +3 -2
  308. package/index.ts +5 -2
  309. package/package.json +11 -34
  310. package/providers/KernelEIP1193Provider.ts +4 -7
  311. package/types/index.ts +2 -0
  312. package/types/kernel.ts +64 -63
  313. package/utils.ts +41 -13
  314. package/_cjs/actions/paymaster/sponsorUserOperationEip7677.js +0 -59
  315. package/_cjs/actions/paymaster/sponsorUserOperationEip7677.js.map +0 -1
  316. package/_esm/actions/paymaster/sponsorUserOperationEip7677.js +0 -58
  317. package/_esm/actions/paymaster/sponsorUserOperationEip7677.js.map +0 -1
  318. package/_types/actions/paymaster/sponsorUserOperationEip7677.d.ts +0 -16
  319. package/_types/actions/paymaster/sponsorUserOperationEip7677.d.ts.map +0 -1
  320. package/actions/paymaster/sponsorUserOperationEip7677.ts +0 -152
@@ -1,13 +1,15 @@
1
- import { sendUserOperation } from "permissionless/actions/smartAccount";
2
- import { AccountOrClientNotFoundError, parseAccount } from "permissionless/utils";
3
1
  import { zeroAddress } from "viem";
4
- import { concatHex, encodeFunctionData, getAction, pad } from "viem/utils";
2
+ import { sendUserOperation } from "viem/account-abstraction";
3
+ import { concatHex, encodeFunctionData, getAction, pad, parseAccount } from "viem/utils";
5
4
  import { KernelV3_1AccountAbi } from "../../accounts/kernel/abi/kernel_v_3_1/KernelAccountAbi.js";
6
5
  import { KERNEL_V3_0, KERNEL_V3_1, KernelVersionToAddressesMap, VALIDATOR_TYPE } from "../../constants.js";
6
+ import { AccountNotFoundError } from "../../errors/index.js";
7
7
  export async function changeSudoValidator(client, args) {
8
8
  const { account: account_ = client.account, sudoValidator, hook } = args;
9
9
  if (!account_)
10
- throw new AccountOrClientNotFoundError();
10
+ throw new AccountNotFoundError({
11
+ docsPath: "/docs/actions/wallet/sendTransaction"
12
+ });
11
13
  const account = parseAccount(account_);
12
14
  let rootValidatorId;
13
15
  if ([VALIDATOR_TYPE.PERMISSION, VALIDATOR_TYPE.SECONDARY].includes(VALIDATOR_TYPE[sudoValidator.validatorType])) {
@@ -29,30 +31,34 @@ export async function changeSudoValidator(client, args) {
29
31
  * @dev Kernel v3.0 does not support changeRootValidator directly, so we need to use delegatecall to call changeRootValidator on Kernel v3.1 implementation contract
30
32
  */
31
33
  if (account.kernelVersion === KERNEL_V3_0) {
32
- return await getAction(client, (sendUserOperation), "sendUserOperation")({
34
+ return await getAction(client, sendUserOperation, "sendUserOperation")({
33
35
  ...args,
34
- userOperation: {
35
- callData: await account.encodeCallData({
36
+ callData: await account.encodeCalls([
37
+ {
36
38
  to: KernelVersionToAddressesMap[KERNEL_V3_1]
37
39
  .accountImplementationAddress,
38
40
  value: 0n,
39
41
  data: encodeFunctionData({
40
42
  abi: KernelV3_1AccountAbi,
41
43
  functionName: "changeRootValidator",
42
- args: [rootValidatorId, hookId, validatorData, hookData]
43
- }),
44
- callType: "delegatecall"
45
- })
46
- }
44
+ args: [
45
+ rootValidatorId,
46
+ hookId,
47
+ validatorData,
48
+ hookData
49
+ ]
50
+ })
51
+ }
52
+ ], "delegatecall")
47
53
  });
48
54
  }
49
55
  /**
50
56
  * @dev Kernel v3.1 supports changeRootValidator directly
51
57
  */
52
- return await getAction(client, (sendUserOperation), "sendUserOperation")({
58
+ return await getAction(client, sendUserOperation, "sendUserOperation")({
53
59
  ...args,
54
- userOperation: {
55
- callData: await account.encodeCallData({
60
+ callData: await account.encodeCalls([
61
+ {
56
62
  to: account.address,
57
63
  value: 0n,
58
64
  data: encodeFunctionData({
@@ -60,8 +66,8 @@ export async function changeSudoValidator(client, args) {
60
66
  functionName: "changeRootValidator",
61
67
  args: [rootValidatorId, hookId, validatorData, hookData]
62
68
  })
63
- })
64
- }
69
+ }
70
+ ])
65
71
  });
66
72
  }
67
73
  //# sourceMappingURL=changeSudoValidator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"changeSudoValidator.js","sourceRoot":"","sources":["../../../actions/account-client/changeSudoValidator.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"changeSudoValidator.js","sourceRoot":"","sources":["../../../actions/account-client/changeSudoValidator.ts"],"names":[],"mappings":"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"}
@@ -1,14 +1,16 @@
1
- import { AccountOrClientNotFoundError, parseAccount } from "permissionless/utils";
2
1
  import { readContract } from "viem/actions";
3
- import { getAction } from "viem/utils";
2
+ import { getAction, parseAccount } from "viem/utils";
4
3
  import { KernelV3AccountAbi } from "../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js";
5
- export async function getKernelV3ModuleCurrentNonce(client, args) {
6
- const { account: account_ = client.account } = args;
4
+ import { AccountNotFoundError } from "../../errors/index.js";
5
+ export async function getKernelV3ModuleCurrentNonce(client) {
6
+ const account_ = client.account;
7
7
  if (!account_)
8
- throw new AccountOrClientNotFoundError();
8
+ throw new AccountNotFoundError({
9
+ docsPath: "/docs/actions/wallet/sendTransaction"
10
+ });
9
11
  const account = parseAccount(account_);
10
12
  try {
11
- const nonce = await getAction(client, readContract, "sendTransaction")({
13
+ const nonce = await getAction(client, readContract, "readContract")({
12
14
  abi: KernelV3AccountAbi,
13
15
  address: account.address,
14
16
  functionName: "currentNonce",
@@ -1 +1 @@
1
- {"version":3,"file":"getKernelV3ModuleCurrentNonce.js","sourceRoot":"","sources":["../../../actions/account-client/getKernelV3ModuleCurrentNonce.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,4BAA4B,EAC5B,YAAY,EACf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAA;AAsBjG,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAW/C,MAA4C,EAC5C,IAQC;IAED,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAA;IACnD,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,4BAA4B,EAAE,CAAA;IAEvD,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAmC,CAAA;IAExE,IAAI,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,SAAS,CACzB,MAAM,EACN,YAAY,EACZ,iBAAiB,CACpB,CAAC;YACE,GAAG,EAAE,kBAAkB;YACvB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,YAAY,EAAE,cAAc;YAC5B,IAAI,EAAE,EAAE;SACX,CAAC,CAAA;QACF,OAAO,KAAK,CAAA;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,CAAA;IACZ,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"getKernelV3ModuleCurrentNonce.js","sourceRoot":"","sources":["../../../actions/account-client/getKernelV3ModuleCurrentNonce.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAA;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAE5D,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAIjD,MAA4C;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAA;IAC/B,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,IAAI,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,SAAS,CACzB,MAAM,EACN,YAAY,EACZ,cAAc,CACjB,CAAC;YACE,GAAG,EAAE,kBAAkB;YACvB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,YAAY,EAAE,cAAc;YAC5B,IAAI,EAAE,EAAE;SACX,CAAC,CAAA;QACF,OAAO,KAAK,CAAA;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,CAAA;IACZ,CAAC;AACL,CAAC"}
@@ -1,23 +1,28 @@
1
- import { sendTransaction } from "permissionless/actions/smartAccount";
2
- import { AccountOrClientNotFoundError, parseAccount } from "permissionless/utils";
3
- import { encodeFunctionData, getAction } from "viem/utils";
1
+ import { sendUserOperation } from "viem/account-abstraction";
2
+ import { encodeFunctionData, getAction, parseAccount } from "viem/utils";
4
3
  import { KernelV3AccountAbi } from "../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js";
4
+ import { AccountNotFoundError } from "../../errors/index.js";
5
5
  export async function invalidateNonce(client, args) {
6
- const { account: account_ = client.account, middleware, nonceToSet } = args;
6
+ const { account: account_ = client.account, nonceToSet } = args;
7
7
  if (!account_)
8
- throw new AccountOrClientNotFoundError();
8
+ throw new AccountNotFoundError({
9
+ docsPath: "/docs/actions/wallet/sendTransaction"
10
+ });
9
11
  const account = parseAccount(account_);
10
- return await getAction(client, (sendTransaction), "sendTransaction")({
12
+ return await getAction(client, sendUserOperation, "sendUserOperation")({
11
13
  ...args,
12
- to: account.address,
13
- data: encodeFunctionData({
14
- abi: KernelV3AccountAbi,
15
- functionName: "invalidateNonce",
16
- args: [nonceToSet]
17
- }),
18
- value: 0n,
19
- account,
20
- middleware
14
+ calls: [
15
+ {
16
+ to: account.address,
17
+ data: encodeFunctionData({
18
+ abi: KernelV3AccountAbi,
19
+ functionName: "invalidateNonce",
20
+ args: [nonceToSet]
21
+ }),
22
+ value: 0n
23
+ }
24
+ ],
25
+ account
21
26
  });
22
27
  }
23
28
  //# sourceMappingURL=invalidateNonce.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalidateNonce.js","sourceRoot":"","sources":["../../../actions/account-client/invalidateNonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,eAAe,EAClB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,4BAA4B,EAC5B,YAAY,EACf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAA;AAwBjG,MAAM,CAAC,KAAK,UAAU,eAAe,CAWjC,MAA4C,EAC5C,IAQC;IAED,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC3E,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,4BAA4B,EAAE,CAAA;IAEvD,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAmC,CAAA;IAExE,OAAO,MAAM,SAAS,CAClB,MAAM,EACN,CAAA,eAMC,CAAA,EACD,iBAAiB,CACpB,CAAC;QACE,GAAG,IAAI;QACP,EAAE,EAAE,OAAO,CAAC,OAAO;QACnB,IAAI,EAAE,kBAAkB,CAAC;YACrB,GAAG,EAAE,kBAAkB;YACvB,YAAY,EAAE,iBAAiB;YAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;SACrB,CAAC;QACF,KAAK,EAAE,EAAE;QACT,OAAO;QACP,UAAU;KACb,CAAC,CAAA;AACN,CAAC"}
1
+ {"version":3,"file":"invalidateNonce.js","sourceRoot":"","sources":["../../../actions/account-client/invalidateNonce.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,iBAAiB,EACpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAA;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAY5D,MAAM,CAAC,KAAK,UAAU,eAAe,CAMjC,MAAyC,EACzC,IAA0E;IAE1E,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC/D,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,MAAM,SAAS,CAClB,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,GAAG,IAAI;QACP,KAAK,EAAE;YACH;gBACI,EAAE,EAAE,OAAO,CAAC,OAAO;gBACnB,IAAI,EAAE,kBAAkB,CAAC;oBACrB,GAAG,EAAE,kBAAkB;oBACvB,YAAY,EAAE,iBAAiB;oBAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;iBACrB,CAAC;gBACF,KAAK,EAAE,EAAE;aACZ;SACJ;QACD,OAAO;KACqB,CAAC,CAAA;AACrC,CAAC"}
@@ -0,0 +1,85 @@
1
+ // Copied from: https://github.com/pimlicolabs/permissionless.js/blob/main/packages/permissionless/actions/smartAccount/sendTransaction.ts
2
+ import { sendUserOperation, waitForUserOperationReceipt } from "viem/account-abstraction";
3
+ import { getAction, parseAccount } from "viem/utils";
4
+ import { AccountNotFoundError } from "../../errors";
5
+ /**
6
+ * Creates, signs, and sends a new transaction to the network.
7
+ * This function also allows you to sponsor this transaction if sender is a smartAccount
8
+ *
9
+ * - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html
10
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions
11
+ * - JSON-RPC Methods:
12
+ * - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)
13
+ * - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)
14
+ *
15
+ * @param client - Client to use
16
+ * @param parameters - {@link SendTransactionParameters}
17
+ * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash.
18
+ *
19
+ * @example
20
+ * import { createWalletClient, custom } from 'viem'
21
+ * import { mainnet } from 'viem/chains'
22
+ * import { sendTransaction } from 'viem/wallet'
23
+ *
24
+ * const client = createWalletClient({
25
+ * chain: mainnet,
26
+ * transport: custom(window.ethereum),
27
+ * })
28
+ * const hash = await sendTransaction(client, {
29
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
30
+ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
31
+ * value: 1000000000000000000n,
32
+ * })
33
+ *
34
+ * @example
35
+ * // Account Hoisting
36
+ * import { createWalletClient, http } from 'viem'
37
+ * import { privateKeyToAccount } from 'viem/accounts'
38
+ * import { mainnet } from 'viem/chains'
39
+ * import { sendTransaction } from 'viem/wallet'
40
+ *
41
+ * const client = createWalletClient({
42
+ * account: privateKeyToAccount('0x…'),
43
+ * chain: mainnet,
44
+ * transport: http(),
45
+ * })
46
+ * const hash = await sendTransaction(client, {
47
+ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
48
+ * value: 1000000000000000000n,
49
+ * })
50
+ */
51
+ export async function sendTransaction(client, args) {
52
+ let userOpHash;
53
+ if ("to" in args) {
54
+ const { account: account_ = client.account, data, maxFeePerGas, maxPriorityFeePerGas, to, value, nonce } = args;
55
+ if (!account_) {
56
+ throw new AccountNotFoundError({
57
+ docsPath: "/docs/actions/wallet/sendTransaction"
58
+ });
59
+ }
60
+ const account = parseAccount(account_);
61
+ if (!to)
62
+ throw new Error("Missing to address");
63
+ userOpHash = await getAction(client, sendUserOperation, "sendUserOperation")({
64
+ calls: [
65
+ {
66
+ to,
67
+ value: value || BigInt(0),
68
+ data: data || "0x"
69
+ }
70
+ ],
71
+ account,
72
+ maxFeePerGas,
73
+ maxPriorityFeePerGas,
74
+ nonce: nonce ? BigInt(nonce) : undefined
75
+ });
76
+ }
77
+ else {
78
+ userOpHash = await getAction(client, sendUserOperation, "sendUserOperation")({ ...args });
79
+ }
80
+ const userOperationReceipt = await getAction(client, waitForUserOperationReceipt, "waitForUserOperationReceipt")({
81
+ hash: userOpHash
82
+ });
83
+ return userOperationReceipt?.receipt.transactionHash;
84
+ }
85
+ //# sourceMappingURL=sendTransaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendTransaction.js","sourceRoot":"","sources":["../../../actions/account-client/sendTransaction.ts"],"names":[],"mappings":"AAAA,0IAA0I;AAS1I,OAAO,EAGH,iBAAiB,EACjB,2BAA2B,EAC9B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAOjC,MAAyC,EACzC,IAEkE;IAElE,IAAI,UAAgB,CAAA;IAEpB,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,EAAE,EACF,KAAK,EACL,KAAK,EACR,GAAG,IAAI,CAAA;QAER,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,MAAM,IAAI,oBAAoB,CAAC;gBAC3B,QAAQ,EAAE,sCAAsC;aACnD,CAAC,CAAA;QACN,CAAC;QAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;QAEtD,IAAI,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAE9C,UAAU,GAAG,MAAM,SAAS,CACxB,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACtB,CAAC;YACE,KAAK,EAAE;gBACH;oBACI,EAAE;oBACF,KAAK,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;oBACzB,IAAI,EAAE,IAAI,IAAI,IAAI;iBACrB;aACJ;YACD,OAAO;YACP,YAAY;YACZ,oBAAoB;YACpB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SAC3C,CAAC,CAAA;IACN,CAAC;SAAM,CAAC;QACJ,UAAU,GAAG,MAAM,SAAS,CACxB,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACtB,CAAC,EAAE,GAAG,IAAI,EAA2D,CAAC,CAAA;IAC3E,CAAC;IAED,MAAM,oBAAoB,GAAG,MAAM,SAAS,CACxC,MAAM,EACN,2BAA2B,EAC3B,6BAA6B,CAChC,CAAC;QACE,IAAI,EAAE,UAAU;KACnB,CAAC,CAAA;IAEF,OAAO,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAA;AACxD,CAAC"}
@@ -0,0 +1,58 @@
1
+ // Copied from: https://github.com/pimlicolabs/permissionless.js/blob/main/packages/permissionless/actions/smartAccount/signMessage.ts
2
+ import { parseAccount } from "viem/utils";
3
+ import { AccountNotFoundError } from "../../errors";
4
+ /**
5
+ * Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.
6
+ *
7
+ * - Docs: https://viem.sh/docs/actions/wallet/signMessage.html
8
+ * - JSON-RPC Methods:
9
+ * - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign)
10
+ * - Local Accounts: Signs locally. No JSON-RPC request.
11
+ *
12
+ * With the calculated signature, you can:
13
+ * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,
14
+ * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.
15
+ *
16
+ * @param client - Client to use
17
+ * @param parameters - {@link SignMessageParameters}
18
+ * @returns The signed message. {@link SignMessageReturnType}
19
+ *
20
+ * @example
21
+ * import { createWalletClient, custom } from 'viem'
22
+ * import { mainnet } from 'viem/chains'
23
+ * import { signMessage } from 'viem/wallet'
24
+ *
25
+ * const client = createWalletClient({
26
+ * chain: mainnet,
27
+ * transport: custom(window.ethereum),
28
+ * })
29
+ * const signature = await signMessage(client, {
30
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
31
+ * message: 'hello world',
32
+ * })
33
+ *
34
+ * @example
35
+ * // Account Hoisting
36
+ * import { createWalletClient, custom } from 'viem'
37
+ * import { privateKeyToAccount } from 'viem/accounts'
38
+ * import { mainnet } from 'viem/chains'
39
+ * import { signMessage } from 'viem/wallet'
40
+ *
41
+ * const client = createWalletClient({
42
+ * account: privateKeyToAccount('0x…'),
43
+ * chain: mainnet,
44
+ * transport: custom(window.ethereum),
45
+ * })
46
+ * const signature = await signMessage(client, {
47
+ * message: 'hello world',
48
+ * })
49
+ */
50
+ export async function signMessage(client, { account: account_ = client.account, message }) {
51
+ if (!account_)
52
+ throw new AccountNotFoundError({
53
+ docsPath: "/docs/actions/wallet/signMessage"
54
+ });
55
+ const account = parseAccount(account_);
56
+ return account.signMessage({ message });
57
+ }
58
+ //# sourceMappingURL=signMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signMessage.js","sourceRoot":"","sources":["../../../actions/account-client/signMessage.ts"],"names":[],"mappings":"AAAA,sIAAsI;AAUtI,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC7B,MAAsD,EACtD,EACI,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,OAAO,EACuB;IAElC,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,kCAAkC;SAC/C,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;AAC3C,CAAC"}
@@ -0,0 +1,127 @@
1
+ // Copied from: https://github.com/pimlicolabs/permissionless.js/blob/main/packages/permissionless/actions/smartAccount/signTypedData.ts
2
+ import { getTypesForEIP712Domain, validateTypedData } from "viem";
3
+ import { parseAccount } from "viem/utils";
4
+ import { AccountNotFoundError } from "../../errors";
5
+ /**
6
+ * Signs typed data and calculates an Ethereum-specific signature in [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712): `sign(keccak256("\x19\x01" ‖ domainSeparator ‖ hashStruct(message)))`
7
+ *
8
+ * - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html
9
+ * - JSON-RPC Methods:
10
+ * - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4)
11
+ * - Local Accounts: Signs locally. No JSON-RPC request.
12
+ *
13
+ * @param client - Client to use
14
+ * @param parameters - {@link SignTypedDataParameters}
15
+ * @returns The signed data. {@link SignTypedDataReturnType}
16
+ *
17
+ * @example
18
+ * import { createWalletClient, custom } from 'viem'
19
+ * import { mainnet } from 'viem/chains'
20
+ * import { signTypedData } from 'viem/wallet'
21
+ *
22
+ * const client = createWalletClient({
23
+ * chain: mainnet,
24
+ * transport: custom(window.ethereum),
25
+ * })
26
+ * const signature = await signTypedData(client, {
27
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
28
+ * domain: {
29
+ * name: 'Ether Mail',
30
+ * version: '1',
31
+ * chainId: 1,
32
+ * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
33
+ * },
34
+ * types: {
35
+ * Person: [
36
+ * { name: 'name', type: 'string' },
37
+ * { name: 'wallet', type: 'address' },
38
+ * ],
39
+ * Mail: [
40
+ * { name: 'from', type: 'Person' },
41
+ * { name: 'to', type: 'Person' },
42
+ * { name: 'contents', type: 'string' },
43
+ * ],
44
+ * },
45
+ * primaryType: 'Mail',
46
+ * message: {
47
+ * from: {
48
+ * name: 'Cow',
49
+ * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
50
+ * },
51
+ * to: {
52
+ * name: 'Bob',
53
+ * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
54
+ * },
55
+ * contents: 'Hello, Bob!',
56
+ * },
57
+ * })
58
+ *
59
+ * @example
60
+ * // Account Hoisting
61
+ * import { createWalletClient, http } from 'viem'
62
+ * import { privateKeyToAccount } from 'viem/accounts'
63
+ * import { mainnet } from 'viem/chains'
64
+ * import { signTypedData } from 'viem/wallet'
65
+ *
66
+ * const client = createWalletClient({
67
+ * account: privateKeyToAccount('0x…'),
68
+ * chain: mainnet,
69
+ * transport: http(),
70
+ * })
71
+ * const signature = await signTypedData(client, {
72
+ * domain: {
73
+ * name: 'Ether Mail',
74
+ * version: '1',
75
+ * chainId: 1,
76
+ * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
77
+ * },
78
+ * types: {
79
+ * Person: [
80
+ * { name: 'name', type: 'string' },
81
+ * { name: 'wallet', type: 'address' },
82
+ * ],
83
+ * Mail: [
84
+ * { name: 'from', type: 'Person' },
85
+ * { name: 'to', type: 'Person' },
86
+ * { name: 'contents', type: 'string' },
87
+ * ],
88
+ * },
89
+ * primaryType: 'Mail',
90
+ * message: {
91
+ * from: {
92
+ * name: 'Cow',
93
+ * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
94
+ * },
95
+ * to: {
96
+ * name: 'Bob',
97
+ * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
98
+ * },
99
+ * contents: 'Hello, Bob!',
100
+ * },
101
+ * })
102
+ */
103
+ export async function signTypedData(client, { account: account_ = client.account, domain, message, primaryType, types: types_ }) {
104
+ if (!account_) {
105
+ throw new AccountNotFoundError({
106
+ docsPath: "/docs/actions/wallet/signMessage"
107
+ });
108
+ }
109
+ const account = parseAccount(account_);
110
+ const types = {
111
+ EIP712Domain: getTypesForEIP712Domain({ domain }),
112
+ ...types_
113
+ };
114
+ validateTypedData({
115
+ domain,
116
+ message,
117
+ primaryType,
118
+ types
119
+ });
120
+ return account.signTypedData({
121
+ domain,
122
+ primaryType,
123
+ types,
124
+ message
125
+ });
126
+ }
127
+ //# sourceMappingURL=signTypedData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signTypedData.js","sourceRoot":"","sources":["../../../actions/account-client/signTypedData.ts"],"names":[],"mappings":"AAAA,wIAAwI;AAExI,OAAO,EASH,uBAAuB,EACvB,iBAAiB,EACpB,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAK/B,MAAsD,EACtD,EACI,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,MAAM,EACN,OAAO,EACP,WAAW,EACX,KAAK,EAAE,MAAM,EAC6C;IAE9D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,kCAAkC;SAC/C,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,MAAM,KAAK,GAAG;QACV,YAAY,EAAE,uBAAuB,CAAC,EAAE,MAAM,EAE7C,CAAC;QACF,GAAI,MAAqB;KAC5B,CAAA;IAED,iBAAiB,CAAC;QACd,MAAM;QACN,OAAO;QACP,WAAW;QACX,KAAK;KACe,CAAC,CAAA;IAEzB,OAAO,OAAO,CAAC,aAAa,CAAC;QACzB,MAAM;QACN,WAAW;QACX,KAAK;QACL,OAAO;KACa,CAAC,CAAA;AAC7B,CAAC"}
@@ -1,12 +1,14 @@
1
- import { prepareUserOperationRequest } from "permissionless/actions/smartAccount";
2
- import { AccountOrClientNotFoundError, parseAccount } from "permissionless/utils";
3
- import { getAction } from "viem/utils";
1
+ import { prepareUserOperation } from "viem/account-abstraction";
2
+ import { getAction, parseAccount } from "viem/utils";
3
+ import { AccountNotFoundError } from "../../errors";
4
4
  export async function signUserOperation(client, args) {
5
5
  const { account: account_ = client.account } = args;
6
6
  if (!account_)
7
- throw new AccountOrClientNotFoundError();
7
+ throw new AccountNotFoundError({
8
+ docsPath: "/docs/actions/wallet/sendTransaction"
9
+ });
8
10
  const account = parseAccount(account_);
9
- const userOperation = await getAction(client, (prepareUserOperationRequest), "prepareUserOperationRequest")({ ...args, account });
11
+ const userOperation = await getAction(client, prepareUserOperation, "prepareUserOperation")({ ...args, account });
10
12
  userOperation.signature = await account.signUserOperation(userOperation);
11
13
  return userOperation;
12
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signUserOperation.js","sourceRoot":"","sources":["../../../actions/account-client/signUserOperation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAA;AAWjF,OAAO,EACH,4BAA4B,EAC5B,YAAY,EACf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAqBtC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAUnC,MAA4C,EAC5C,IAEC;IAED,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAA;IACnD,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,4BAA4B,EAAE,CAAA;IAEvD,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAKpC,CAAA;IAED,MAAM,aAAa,GAAG,MAAM,SAAS,CACjC,MAAM,EACN,CAAA,2BAAqE,CAAA,EACrE,6BAA6B,CAChC,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAKnB,CAAC,CAAA;IAEF,aAAa,CAAC,SAAS,GAAG,MAAM,OAAO,CAAC,iBAAiB,CACrD,aAAgE,CACnE,CAAA;IAED,OAAO,aAAwD,CAAA;AACnE,CAAC"}
1
+ {"version":3,"file":"signUserOperation.js","sourceRoot":"","sources":["../../../actions/account-client/signUserOperation.ts"],"names":[],"mappings":"AACA,OAAO,EAKH,oBAAoB,EACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAUnD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAMnC,MAAyC,EACzC,IAAkE;IAElE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAA;IACnD,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,MAAM,aAAa,GAAG,MAAM,SAAS,CACjC,MAAM,EACN,oBAAoB,EACpB,sBAAsB,CACzB,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAoC,CAAC,CAAA;IAEzD,aAAa,CAAC,SAAS,GAAG,MAAM,OAAO,CAAC,iBAAiB,CACrD,aAA8B,CACjC,CAAA;IAED,OAAO,aAAa,CAAA;AACxB,CAAC"}
@@ -1,12 +1,14 @@
1
- import { sendTransactions } from "permissionless/actions/smartAccount";
2
- import { AccountOrClientNotFoundError, parseAccount } from "permissionless/utils";
3
- import { concatHex, encodeFunctionData, getAction, pad } from "viem/utils";
1
+ import { sendUserOperation } from "viem/account-abstraction";
2
+ import { concatHex, encodeFunctionData, getAction, pad, parseAccount } from "viem/utils";
4
3
  import { KernelV3AccountAbi } from "../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js";
5
4
  import { VALIDATOR_TYPE } from "../../constants.js";
5
+ import { AccountNotFoundError } from "../../errors/index.js";
6
6
  export async function uninstallPlugin(client, args) {
7
- const { account: account_ = client.account, middleware, plugin, hook } = args;
7
+ const { account: account_ = client.account, plugin, hook } = args;
8
8
  if (!account_)
9
- throw new AccountOrClientNotFoundError();
9
+ throw new AccountNotFoundError({
10
+ docsPath: "/docs/actions/wallet/sendTransaction"
11
+ });
10
12
  const account = parseAccount(account_);
11
13
  let validatorId;
12
14
  if ([VALIDATOR_TYPE.PERMISSION, VALIDATOR_TYPE.SECONDARY].includes(VALIDATOR_TYPE[plugin.validatorType])) {
@@ -23,9 +25,9 @@ export async function uninstallPlugin(client, args) {
23
25
  }
24
26
  const validatorData = await plugin.getEnableData(account.address);
25
27
  const hookData = (await hook?.getEnableData(account.address)) ?? "0x";
26
- return await getAction(client, (sendTransactions), "sendTransactions")({
28
+ return await getAction(client, sendUserOperation, "sendUserOperation")({
27
29
  ...args,
28
- transactions: [
30
+ calls: [
29
31
  {
30
32
  to: account.address,
31
33
  data: encodeFunctionData({
@@ -36,8 +38,7 @@ export async function uninstallPlugin(client, args) {
36
38
  value: 0n
37
39
  }
38
40
  ],
39
- account,
40
- middleware
41
+ account
41
42
  });
42
43
  }
43
44
  //# sourceMappingURL=uninstallPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"uninstallPlugin.js","sourceRoot":"","sources":["../../../actions/account-client/uninstallPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,gBAAgB,EACnB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,4BAA4B,EAC5B,YAAY,EACf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAA;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AA6BnD,MAAM,CAAC,KAAK,UAAU,eAAe,CAUjC,MAA4C,EAC5C,IAEC;IAED,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,UAAU,EACV,MAAM,EACN,IAAI,EACP,GAAG,IAAI,CAAA;IACR,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,4BAA4B,EAAE,CAAA;IAEvD,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAmC,CAAA;IAExE,IAAI,WAAgB,CAAA;IACpB,IACI,CAAC,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,QAAQ,CAC1D,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,CACvC,EACH,CAAC;QACC,WAAW,GAAG,SAAS,CAAC;YACpB,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC;YACpC,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE;gBACxB,IAAI,EAAE,EAAE;gBACR,GAAG,EAAE,OAAO;aACf,CAAC;SACL,CAAC,CAAA;IACN,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,oBAAoB,MAAM,CAAC,aAAa,SAAS,CAAC,CAAA;IACtE,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAEjE,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAA;IACrE,OAAO,MAAM,SAAS,CAClB,MAAM,EACN,CAAA,gBAA0D,CAAA,EAC1D,kBAAkB,CACrB,CAAC;QACE,GAAG,IAAI;QACP,YAAY,EAAE;YACV;gBACI,EAAE,EAAE,OAAO,CAAC,OAAO;gBACnB,IAAI,EAAE,kBAAkB,CAAC;oBACrB,GAAG,EAAE,kBAAkB;oBACvB,YAAY,EAAE,qBAAqB;oBACnC,IAAI,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,QAAQ,CAAC;iBAC/C,CAAC;gBACF,KAAK,EAAE,EAAE;aACZ;SACJ;QACD,OAAO;QACP,UAAU;KACb,CAAC,CAAA;AACN,CAAC"}
1
+ {"version":3,"file":"uninstallPlugin.js","sourceRoot":"","sources":["../../../actions/account-client/uninstallPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,iBAAiB,EACpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACH,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,GAAG,EACH,YAAY,EACf,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAA;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAe5D,MAAM,CAAC,KAAK,UAAU,eAAe,CAMjC,MAAyC,EACzC,IAAgE;IAEhE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;IACjE,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,IAAI,WAAgB,CAAA;IACpB,IACI,CAAC,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,QAAQ,CAC1D,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,CACvC,EACH,CAAC;QACC,WAAW,GAAG,SAAS,CAAC;YACpB,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC;YACpC,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE;gBACxB,IAAI,EAAE,EAAE;gBACR,GAAG,EAAE,OAAO;aACf,CAAC;SACL,CAAC,CAAA;IACN,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,oBAAoB,MAAM,CAAC,aAAa,SAAS,CAAC,CAAA;IACtE,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAEjE,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAA;IACrE,OAAO,MAAM,SAAS,CAClB,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,GAAG,IAAI;QACP,KAAK,EAAE;YACH;gBACI,EAAE,EAAE,OAAO,CAAC,OAAO;gBACnB,IAAI,EAAE,kBAAkB,CAAC;oBACrB,GAAG,EAAE,kBAAkB;oBACvB,YAAY,EAAE,qBAAqB;oBACnC,IAAI,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,QAAQ,CAAC;iBAC/C,CAAC;gBACF,KAAK,EAAE,EAAE;aACZ;SACJ;QACD,OAAO;KACqB,CAAC,CAAA;AACrC,CAAC"}
@@ -0,0 +1,18 @@
1
+ // Copied from: https://github.com/pimlicolabs/permissionless.js/blob/main/packages/permissionless/actions/smartAccount/writeContract.ts
2
+ import { encodeFunctionData } from "viem";
3
+ import { getAction } from "viem/utils";
4
+ import { sendTransaction } from "./sendTransaction.js";
5
+ export async function writeContract(client, { abi, address, args, dataSuffix, functionName, ...request }) {
6
+ const data = encodeFunctionData({
7
+ abi,
8
+ args,
9
+ functionName
10
+ });
11
+ const hash = await getAction(client, (sendTransaction), "sendTransaction")({
12
+ data: `${data}${dataSuffix ? dataSuffix.replace("0x", "") : ""}`,
13
+ to: address,
14
+ ...request
15
+ });
16
+ return hash;
17
+ }
18
+ //# sourceMappingURL=writeContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeContract.js","sourceRoot":"","sources":["../../../actions/account-client/writeContract.ts"],"names":[],"mappings":"AAAA,wIAAwI;AAExI,OAAO,EAWH,kBAAkB,EACrB,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,CAAC,KAAK,UAAU,aAAa,CAe/B,MAA2C,EAC3C,EACI,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,GAAG,OAAO,EAQb;IAED,MAAM,IAAI,GAAG,kBAAkB,CAAsB;QACjD,GAAG;QACH,IAAI;QACJ,YAAY;KACsC,CAAC,CAAA;IAEvD,MAAM,IAAI,GAAG,MAAM,SAAS,CACxB,MAAM,EACN,CAAA,eAA+C,CAAA,EAC/C,iBAAiB,CACpB,CAAC;QACE,IAAI,EAAE,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;QAChE,EAAE,EAAE,OAAO;QACX,GAAG,OAAO;KAKb,CAAC,CAAA;IACF,OAAO,IAAI,CAAA;AACf,CAAC"}
@@ -2,7 +2,12 @@ export { sponsorUserOperation } from "./paymaster/sponsorUserOperation.js";
2
2
  export { signUserOperation } from "./account-client/signUserOperation.js";
3
3
  export { getUserOperationGasPrice } from "./account-client/getUserOperationGasPrice.js";
4
4
  export { uninstallPlugin } from "./account-client/uninstallPlugin.js";
5
+ export { getKernelV3ModuleCurrentNonce } from "./account-client/getKernelV3ModuleCurrentNonce.js";
6
+ export { invalidateNonce } from "./account-client/invalidateNonce.js";
7
+ export { sendTransaction } from "./account-client/sendTransaction.js";
8
+ export { signMessage } from "./account-client/signMessage.js";
9
+ export { signTypedData } from "./account-client/signTypedData.js";
10
+ export { writeContract } from "./account-client/writeContract.js";
5
11
  export { changeSudoValidator } from "./account-client/changeSudoValidator.js";
6
12
  export { estimateGasInERC20 } from "./paymaster/estimateGasInERC20.js";
7
- export { sponsorUserOperationEip7677 } from "./paymaster/sponsorUserOperationEip7677.js";
8
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EAGvB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,iBAAiB,EAGpB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACH,wBAAwB,EAE3B,MAAM,8CAA8C,CAAA;AAErD,OAAO,EACH,eAAe,EAElB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,mBAAmB,EAEtB,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,kBAAkB,EAGrB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAGH,2BAA2B,EAC9B,MAAM,4CAA4C,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EAGvB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,iBAAiB,EAGpB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACH,wBAAwB,EAE3B,MAAM,8CAA8C,CAAA;AAErD,OAAO,EACH,eAAe,EAElB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAA;AAEjG,OAAO,EAEH,eAAe,EAClB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEjE,OAAO,EACH,mBAAmB,EAEtB,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,kBAAkB,EAGrB,MAAM,mCAAmC,CAAA"}
@@ -1,5 +1,5 @@
1
- import { ENTRYPOINT_ADDRESS_V06 } from "permissionless";
2
- import { deepHexlify } from "permissionless/utils";
1
+ import { entryPoint06Address } from "viem/account-abstraction";
2
+ import { deepHexlify } from "../../utils.js";
3
3
  /**
4
4
  * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
5
5
  */
@@ -14,7 +14,7 @@ export const estimateGasInERC20 = async (client, args) => {
14
14
  initCode: args.userOperation.initCode || "0x"
15
15
  },
16
16
  tokenAddress: args.gasTokenAddress,
17
- entryPointAddress: args.entryPoint ?? ENTRYPOINT_ADDRESS_V06
17
+ entryPointAddress: args.entryPoint ?? entryPoint06Address
18
18
  }
19
19
  ]
20
20
  });
@@ -1 +1 @@
1
- {"version":3,"file":"estimateGasInERC20.js","sourceRoot":"","sources":["../../../actions/paymaster/estimateGasInERC20.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAmBlD;;GAEG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACnC,MAA0C,EAC1C,IAAkC,EACG,EAAE;IACvC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM,EAAE;YACJ;gBACI,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,EAAY;gBACnC,MAAM,EAAE;oBACJ,GAAG,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC;oBAClC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,IAAI,IAAI;iBAChD;gBACD,YAAY,EAAE,IAAI,CAAC,eAAe;gBAClC,iBAAiB,EAAE,IAAI,CAAC,UAAU,IAAI,sBAAsB;aAC/D;SACJ;KACJ,CAAC,CAAA;IAEF,MAAM,MAAM,GAAkC;QAC1C,eAAe,EAAE,QAAQ,CAAC,eAAe;QACzC,aAAa,EAAE,QAAQ,CAAC,aAAa;KACxC,CAAA;IAED,MAAM,MAAM,GACR,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAEvE,OAAO,EAAE,MAAM,EAAE,CAAA;AACrB,CAAC,CAAA"}
1
+ {"version":3,"file":"estimateGasInERC20.js","sourceRoot":"","sources":["../../../actions/paymaster/estimateGasInERC20.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,mBAAmB,EACtB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAiB5C;;GAEG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAGnC,MAAiD,EACjD,IAAkC,EACG,EAAE;IACvC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM,EAAE;YACJ;gBACI,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,EAAY;gBACnC,MAAM,EAAE;oBACJ,GAAG,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC;oBAClC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,IAAI,IAAI;iBAChD;gBACD,YAAY,EAAE,IAAI,CAAC,eAAe;gBAClC,iBAAiB,EAAE,IAAI,CAAC,UAAU,IAAI,mBAAmB;aAC5D;SACJ;KACJ,CAAC,CAAA;IAEF,MAAM,MAAM,GAAkC;QAC1C,eAAe,EAAE,QAAQ,CAAC,eAAe;QACzC,aAAa,EAAE,QAAQ,CAAC,aAAa;KACxC,CAAA;IAED,MAAM,MAAM,GACR,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAEvE,OAAO,EAAE,MAAM,EAAE,CAAA;AACrB,CAAC,CAAA"}