viem 2.27.3 → 2.28.0-canary-20250422025603

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 (244) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
  3. package/_cjs/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js +257 -0
  4. package/_cjs/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js.map +1 -0
  5. package/_cjs/account-abstraction/accounts/implementations/toSoladySmartAccount.js.map +1 -1
  6. package/_cjs/account-abstraction/accounts/toSmartAccount.js +2 -2
  7. package/_cjs/account-abstraction/accounts/toSmartAccount.js.map +1 -1
  8. package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js +7 -1
  9. package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -1
  10. package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js +21 -1
  11. package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
  12. package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js +2 -2
  13. package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -1
  14. package/_cjs/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -1
  15. package/_cjs/account-abstraction/constants/abis.js +691 -1
  16. package/_cjs/account-abstraction/constants/abis.js.map +1 -1
  17. package/_cjs/account-abstraction/constants/address.js +2 -1
  18. package/_cjs/account-abstraction/constants/address.js.map +1 -1
  19. package/_cjs/account-abstraction/index.js +6 -2
  20. package/_cjs/account-abstraction/index.js.map +1 -1
  21. package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js +19 -0
  22. package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -1
  23. package/_cjs/account-abstraction/utils/userOperation/getInitCode.js +18 -0
  24. package/_cjs/account-abstraction/utils/userOperation/getInitCode.js.map +1 -0
  25. package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js +30 -39
  26. package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -1
  27. package/_cjs/account-abstraction/utils/userOperation/getUserOperationTypedData.js +31 -0
  28. package/_cjs/account-abstraction/utils/userOperation/getUserOperationTypedData.js.map +1 -0
  29. package/_cjs/account-abstraction/utils/userOperation/toPackedUserOperation.js +3 -2
  30. package/_cjs/account-abstraction/utils/userOperation/toPackedUserOperation.js.map +1 -1
  31. package/_cjs/actions/index.js +12 -1
  32. package/_cjs/actions/index.js.map +1 -1
  33. package/_cjs/{experimental/eip5792/actions → actions/wallet}/getCallsStatus.js +3 -3
  34. package/_cjs/actions/wallet/getCallsStatus.js.map +1 -0
  35. package/_cjs/{experimental/eip5792/actions → actions/wallet}/getCapabilities.js +1 -1
  36. package/{_esm/experimental/eip5792/actions → _cjs/actions/wallet}/getCapabilities.js.map +1 -1
  37. package/_cjs/{experimental/eip5792/actions → actions/wallet}/sendCalls.js +6 -6
  38. package/_cjs/actions/wallet/sendCalls.js.map +1 -0
  39. package/_cjs/actions/wallet/showCallsStatus.js.map +1 -0
  40. package/_cjs/{experimental/eip5792/actions → actions/wallet}/waitForCallsStatus.js +5 -5
  41. package/_cjs/actions/wallet/waitForCallsStatus.js.map +1 -0
  42. package/_cjs/clients/decorators/wallet.js +10 -0
  43. package/_cjs/clients/decorators/wallet.js.map +1 -1
  44. package/_cjs/constants/address.js +2 -1
  45. package/_cjs/constants/address.js.map +1 -1
  46. package/_cjs/errors/version.js +1 -1
  47. package/_cjs/errors/version.js.map +1 -1
  48. package/_cjs/experimental/eip5792/actions/writeContracts.js +1 -1
  49. package/_cjs/experimental/eip5792/actions/writeContracts.js.map +1 -1
  50. package/_cjs/experimental/eip5792/decorators/eip5792.js +5 -5
  51. package/_cjs/experimental/eip5792/decorators/eip5792.js.map +1 -1
  52. package/_cjs/experimental/index.js +6 -7
  53. package/_cjs/experimental/index.js.map +1 -1
  54. package/_cjs/index.js +11 -9
  55. package/_cjs/index.js.map +1 -1
  56. package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
  57. package/_esm/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js +271 -0
  58. package/_esm/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js.map +1 -0
  59. package/_esm/account-abstraction/accounts/implementations/toSoladySmartAccount.js.map +1 -1
  60. package/_esm/account-abstraction/accounts/toSmartAccount.js +2 -2
  61. package/_esm/account-abstraction/accounts/toSmartAccount.js.map +1 -1
  62. package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js +7 -1
  63. package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -1
  64. package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js +21 -1
  65. package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
  66. package/_esm/account-abstraction/actions/bundler/sendUserOperation.js +2 -2
  67. package/_esm/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -1
  68. package/_esm/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -1
  69. package/_esm/account-abstraction/constants/abis.js +690 -0
  70. package/_esm/account-abstraction/constants/abis.js.map +1 -1
  71. package/_esm/account-abstraction/constants/address.js +1 -0
  72. package/_esm/account-abstraction/constants/address.js.map +1 -1
  73. package/_esm/account-abstraction/index.js +3 -2
  74. package/_esm/account-abstraction/index.js.map +1 -1
  75. package/_esm/account-abstraction/utils/formatters/userOperationRequest.js +19 -0
  76. package/_esm/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -1
  77. package/_esm/account-abstraction/utils/userOperation/getInitCode.js +15 -0
  78. package/_esm/account-abstraction/utils/userOperation/getInitCode.js.map +1 -0
  79. package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js +30 -39
  80. package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -1
  81. package/_esm/account-abstraction/utils/userOperation/getUserOperationTypedData.js +28 -0
  82. package/_esm/account-abstraction/utils/userOperation/getUserOperationTypedData.js.map +1 -0
  83. package/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js +3 -2
  84. package/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js.map +1 -1
  85. package/_esm/actions/index.js +5 -0
  86. package/_esm/actions/index.js.map +1 -1
  87. package/_esm/{experimental/eip5792/actions → actions/wallet}/getCallsStatus.js +5 -5
  88. package/_esm/actions/wallet/getCallsStatus.js.map +1 -0
  89. package/_esm/{experimental/eip5792/actions → actions/wallet}/getCapabilities.js +3 -3
  90. package/_esm/actions/wallet/getCapabilities.js.map +1 -0
  91. package/_esm/{experimental/eip5792/actions → actions/wallet}/sendCalls.js +8 -8
  92. package/_esm/actions/wallet/sendCalls.js.map +1 -0
  93. package/_esm/{experimental/eip5792/actions → actions/wallet}/showCallsStatus.js +2 -2
  94. package/_esm/actions/wallet/showCallsStatus.js.map +1 -0
  95. package/_esm/{experimental/eip5792/actions → actions/wallet}/waitForCallsStatus.js +7 -7
  96. package/_esm/actions/wallet/waitForCallsStatus.js.map +1 -0
  97. package/_esm/clients/decorators/wallet.js +10 -0
  98. package/_esm/clients/decorators/wallet.js.map +1 -1
  99. package/_esm/constants/address.js +1 -0
  100. package/_esm/constants/address.js.map +1 -1
  101. package/_esm/errors/version.js +1 -1
  102. package/_esm/errors/version.js.map +1 -1
  103. package/_esm/experimental/eip5792/actions/writeContracts.js +2 -3
  104. package/_esm/experimental/eip5792/actions/writeContracts.js.map +1 -1
  105. package/_esm/experimental/eip5792/decorators/eip5792.js +6 -5
  106. package/_esm/experimental/eip5792/decorators/eip5792.js.map +1 -1
  107. package/_esm/experimental/index.js +21 -7
  108. package/_esm/experimental/index.js.map +1 -1
  109. package/_esm/index.js +1 -0
  110. package/_esm/index.js.map +1 -1
  111. package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts +1 -2
  112. package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts.map +1 -1
  113. package/_types/account-abstraction/accounts/implementations/toSimple7702SmartAccount.d.ts +311 -0
  114. package/_types/account-abstraction/accounts/implementations/toSimple7702SmartAccount.d.ts.map +1 -0
  115. package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts +1 -2
  116. package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts.map +1 -1
  117. package/_types/account-abstraction/accounts/types.d.ts +16 -3
  118. package/_types/account-abstraction/accounts/types.d.ts.map +1 -1
  119. package/_types/account-abstraction/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
  120. package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts +23 -6
  121. package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts.map +1 -1
  122. package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts +1 -1
  123. package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts.map +1 -1
  124. package/_types/account-abstraction/constants/abis.d.ts +830 -0
  125. package/_types/account-abstraction/constants/abis.d.ts.map +1 -1
  126. package/_types/account-abstraction/constants/address.d.ts +1 -0
  127. package/_types/account-abstraction/constants/address.d.ts.map +1 -1
  128. package/_types/account-abstraction/index.d.ts +3 -2
  129. package/_types/account-abstraction/index.d.ts.map +1 -1
  130. package/_types/account-abstraction/types/entryPointVersion.d.ts +1 -1
  131. package/_types/account-abstraction/types/entryPointVersion.d.ts.map +1 -1
  132. package/_types/account-abstraction/types/rpc.d.ts +6 -3
  133. package/_types/account-abstraction/types/rpc.d.ts.map +1 -1
  134. package/_types/account-abstraction/types/userOperation.d.ts +49 -5
  135. package/_types/account-abstraction/types/userOperation.d.ts.map +1 -1
  136. package/_types/account-abstraction/utils/formatters/userOperationRequest.d.ts.map +1 -1
  137. package/_types/account-abstraction/utils/userOperation/getInitCode.d.ts +3 -0
  138. package/_types/account-abstraction/utils/userOperation/getInitCode.d.ts.map +1 -0
  139. package/_types/account-abstraction/utils/userOperation/getUserOperationHash.d.ts.map +1 -1
  140. package/_types/account-abstraction/utils/userOperation/getUserOperationTypedData.d.ts +45 -0
  141. package/_types/account-abstraction/utils/userOperation/getUserOperationTypedData.d.ts.map +1 -0
  142. package/_types/account-abstraction/utils/userOperation/toPackedUserOperation.d.ts.map +1 -1
  143. package/_types/actions/index.d.ts +5 -0
  144. package/_types/actions/index.d.ts.map +1 -1
  145. package/_types/{experimental/eip5792/actions → actions/wallet}/getCallsStatus.d.ts +10 -10
  146. package/_types/actions/wallet/getCallsStatus.d.ts.map +1 -0
  147. package/_types/{experimental/eip5792/actions → actions/wallet}/getCapabilities.d.ts +9 -9
  148. package/_types/actions/wallet/getCapabilities.d.ts.map +1 -0
  149. package/_types/{experimental/eip5792/actions → actions/wallet}/sendCalls.d.ts +10 -10
  150. package/_types/actions/wallet/sendCalls.d.ts.map +1 -0
  151. package/_types/{experimental/eip5792/actions → actions/wallet}/showCallsStatus.d.ts +8 -8
  152. package/_types/actions/wallet/showCallsStatus.d.ts.map +1 -0
  153. package/_types/{experimental/eip5792/actions → actions/wallet}/waitForCallsStatus.d.ts +9 -9
  154. package/_types/actions/wallet/waitForCallsStatus.d.ts.map +1 -0
  155. package/_types/celo/chainConfig.d.ts +14 -14
  156. package/_types/celo/formatters.d.ts +7 -7
  157. package/_types/chains/definitions/abstract.d.ts +3 -3
  158. package/_types/chains/definitions/abstractTestnet.d.ts +3 -3
  159. package/_types/chains/definitions/celo.d.ts +14 -14
  160. package/_types/chains/definitions/celoAlfajores.d.ts +14 -14
  161. package/_types/chains/definitions/playfiAlbireo.d.ts +3 -3
  162. package/_types/chains/definitions/sophon.d.ts +3 -3
  163. package/_types/chains/definitions/sophonTestnet.d.ts +3 -3
  164. package/_types/chains/definitions/treasure.d.ts +3 -3
  165. package/_types/chains/definitions/treasureTopaz.d.ts +3 -3
  166. package/_types/chains/definitions/zksync.d.ts +3 -3
  167. package/_types/chains/definitions/zksyncInMemoryNode.d.ts +3 -3
  168. package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts +3 -3
  169. package/_types/chains/definitions/zksyncLocalHyperchain.d.ts +3 -3
  170. package/_types/chains/definitions/zksyncLocalNode.d.ts +3 -3
  171. package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts +3 -3
  172. package/_types/clients/decorators/wallet.d.ts +126 -0
  173. package/_types/clients/decorators/wallet.d.ts.map +1 -1
  174. package/_types/constants/address.d.ts +1 -0
  175. package/_types/constants/address.d.ts.map +1 -1
  176. package/_types/errors/version.d.ts +1 -1
  177. package/_types/errors/version.d.ts.map +1 -1
  178. package/_types/experimental/eip5792/actions/writeContracts.d.ts +1 -3
  179. package/_types/experimental/eip5792/actions/writeContracts.d.ts.map +1 -1
  180. package/_types/experimental/eip5792/decorators/eip5792.d.ts +5 -5
  181. package/_types/experimental/eip5792/decorators/eip5792.d.ts.map +1 -1
  182. package/_types/experimental/index.d.ts +63 -7
  183. package/_types/experimental/index.d.ts.map +1 -1
  184. package/_types/index.d.ts +6 -0
  185. package/_types/index.d.ts.map +1 -1
  186. package/_types/types/authorization.d.ts +1 -1
  187. package/_types/types/authorization.d.ts.map +1 -1
  188. package/_types/types/misc.d.ts +7 -7
  189. package/_types/types/misc.d.ts.map +1 -1
  190. package/_types/utils/formatters/transaction.d.ts +1 -1
  191. package/_types/utils/formatters/transactionRequest.d.ts +1 -1
  192. package/_types/zksync/chainConfig.d.ts +3 -3
  193. package/_types/zksync/formatters.d.ts +3 -3
  194. package/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.ts +1 -2
  195. package/account-abstraction/accounts/implementations/toSimple7702SmartAccount.ts +317 -0
  196. package/account-abstraction/accounts/implementations/toSoladySmartAccount.ts +1 -2
  197. package/account-abstraction/accounts/toSmartAccount.ts +2 -2
  198. package/account-abstraction/accounts/types.ts +26 -2
  199. package/account-abstraction/actions/bundler/estimateUserOperationGas.ts +8 -1
  200. package/account-abstraction/actions/bundler/prepareUserOperation.ts +56 -2
  201. package/account-abstraction/actions/bundler/sendUserOperation.ts +2 -2
  202. package/account-abstraction/actions/paymaster/getPaymasterData.ts +24 -0
  203. package/account-abstraction/constants/abis.ts +691 -0
  204. package/account-abstraction/constants/address.ts +2 -0
  205. package/account-abstraction/index.ts +12 -1
  206. package/account-abstraction/types/entryPointVersion.ts +1 -1
  207. package/account-abstraction/types/rpc.ts +6 -3
  208. package/account-abstraction/types/userOperation.ts +69 -3
  209. package/account-abstraction/utils/formatters/userOperationRequest.ts +21 -0
  210. package/account-abstraction/utils/userOperation/getInitCode.ts +21 -0
  211. package/account-abstraction/utils/userOperation/getUserOperationHash.ts +37 -50
  212. package/account-abstraction/utils/userOperation/getUserOperationTypedData.ts +42 -0
  213. package/account-abstraction/utils/userOperation/toPackedUserOperation.ts +2 -4
  214. package/actions/index.ts +31 -0
  215. package/{experimental/eip5792/actions → actions/wallet}/getCallsStatus.ts +13 -13
  216. package/{experimental/eip5792/actions → actions/wallet}/getCapabilities.ts +10 -10
  217. package/{experimental/eip5792/actions → actions/wallet}/sendCalls.ts +17 -17
  218. package/{experimental/eip5792/actions → actions/wallet}/showCallsStatus.ts +8 -8
  219. package/{experimental/eip5792/actions → actions/wallet}/waitForCallsStatus.ts +11 -11
  220. package/clients/decorators/wallet.ts +164 -0
  221. package/constants/address.ts +2 -0
  222. package/errors/version.ts +1 -1
  223. package/experimental/eip5792/actions/writeContracts.ts +8 -8
  224. package/experimental/eip5792/decorators/eip5792.ts +11 -9
  225. package/experimental/index.ts +33 -6
  226. package/index.ts +27 -0
  227. package/package.json +1 -1
  228. package/types/authorization.ts +1 -1
  229. package/types/misc.ts +7 -7
  230. package/_cjs/experimental/eip5792/actions/getCallsStatus.js.map +0 -1
  231. package/_cjs/experimental/eip5792/actions/getCapabilities.js.map +0 -1
  232. package/_cjs/experimental/eip5792/actions/sendCalls.js.map +0 -1
  233. package/_cjs/experimental/eip5792/actions/showCallsStatus.js.map +0 -1
  234. package/_cjs/experimental/eip5792/actions/waitForCallsStatus.js.map +0 -1
  235. package/_esm/experimental/eip5792/actions/getCallsStatus.js.map +0 -1
  236. package/_esm/experimental/eip5792/actions/sendCalls.js.map +0 -1
  237. package/_esm/experimental/eip5792/actions/showCallsStatus.js.map +0 -1
  238. package/_esm/experimental/eip5792/actions/waitForCallsStatus.js.map +0 -1
  239. package/_types/experimental/eip5792/actions/getCallsStatus.d.ts.map +0 -1
  240. package/_types/experimental/eip5792/actions/getCapabilities.d.ts.map +0 -1
  241. package/_types/experimental/eip5792/actions/sendCalls.d.ts.map +0 -1
  242. package/_types/experimental/eip5792/actions/showCallsStatus.d.ts.map +0 -1
  243. package/_types/experimental/eip5792/actions/waitForCallsStatus.d.ts.map +0 -1
  244. /package/_cjs/{experimental/eip5792/actions → actions/wallet}/showCallsStatus.js +0 -0
@@ -17,6 +17,12 @@ export {
17
17
  type ToSoladySmartAccountReturnType,
18
18
  toSoladySmartAccount,
19
19
  } from './accounts/implementations/toSoladySmartAccount.js'
20
+ export {
21
+ type Simple7702SmartAccountImplementation,
22
+ type ToSimple7702SmartAccountParameters,
23
+ type ToSimple7702SmartAccountReturnType,
24
+ toSimple7702SmartAccount,
25
+ } from './accounts/implementations/toSimple7702SmartAccount.js'
20
26
  export {
21
27
  type ToSmartAccountParameters,
22
28
  type ToSmartAccountReturnType,
@@ -112,10 +118,15 @@ export {
112
118
  createPaymasterClient,
113
119
  } from './clients/createPaymasterClient.js'
114
120
 
115
- export { entryPoint06Abi, entryPoint07Abi } from './constants/abis.js'
121
+ export {
122
+ entryPoint06Abi,
123
+ entryPoint07Abi,
124
+ entryPoint08Abi,
125
+ } from './constants/abis.js'
116
126
  export {
117
127
  entryPoint06Address,
118
128
  entryPoint07Address,
129
+ entryPoint08Address,
119
130
  } from './constants/address.js'
120
131
 
121
132
  export {
@@ -1,7 +1,7 @@
1
1
  import type { SmartAccount } from '../accounts/types.js'
2
2
 
3
3
  /** @link https://github.com/eth-infinitism/account-abstraction/releases */
4
- export type EntryPointVersion = '0.6' | '0.7'
4
+ export type EntryPointVersion = '0.6' | '0.7' | '0.8'
5
5
 
6
6
  export type DeriveEntryPointVersion<account extends SmartAccount | undefined> =
7
7
  account extends SmartAccount
@@ -1,4 +1,5 @@
1
1
  import type { Hex } from '../../types/misc.js'
2
+ import type { RpcAuthorization } from '../../types/rpc.js'
2
3
  import type { EntryPointVersion } from './entryPointVersion.js'
3
4
  import type {
4
5
  EstimateUserOperationGasReturnType,
@@ -14,11 +15,13 @@ export type RpcEstimateUserOperationGasReturnType<
14
15
 
15
16
  export type RpcGetUserOperationByHashReturnType<
16
17
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
17
- > = GetUserOperationByHashReturnType<entryPointVersion, Hex>
18
+ > = GetUserOperationByHashReturnType<entryPointVersion, Hex, Hex>
18
19
 
19
20
  export type RpcUserOperation<
20
21
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
21
- > = UserOperation<entryPointVersion, Hex>
22
+ > = UserOperation<entryPointVersion, Hex, Hex> & {
23
+ eip7702Auth?: RpcAuthorization
24
+ }
22
25
 
23
26
  export type RpcUserOperationReceipt<
24
27
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
@@ -26,4 +29,4 @@ export type RpcUserOperationReceipt<
26
29
 
27
30
  export type RpcUserOperationRequest<
28
31
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
29
- > = UserOperationRequest<entryPointVersion, Hex>
32
+ > = UserOperationRequest<entryPointVersion, Hex, Hex>
@@ -1,4 +1,5 @@
1
1
  import type { Address } from 'abitype'
2
+ import type { SignedAuthorization } from '../../types/authorization.js'
2
3
  import type { Log } from '../../types/log.js'
3
4
  import type { Hash, Hex } from '../../types/misc.js'
4
5
  import type { TransactionReceipt } from '../../types/transaction.js'
@@ -10,6 +11,15 @@ export type EstimateUserOperationGasReturnType<
10
11
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
11
12
  uint256 = bigint,
12
13
  > = OneOf<
14
+ | (entryPointVersion extends '0.8'
15
+ ? {
16
+ preVerificationGas: uint256
17
+ verificationGasLimit: uint256
18
+ callGasLimit: uint256
19
+ paymasterVerificationGasLimit?: uint256 | undefined
20
+ paymasterPostOpGasLimit?: uint256 | undefined
21
+ }
22
+ : never)
13
23
  | (entryPointVersion extends '0.7'
14
24
  ? {
15
25
  preVerificationGas: uint256
@@ -32,12 +42,13 @@ export type EstimateUserOperationGasReturnType<
32
42
  export type GetUserOperationByHashReturnType<
33
43
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
34
44
  uint256 = bigint,
45
+ uint32 = number,
35
46
  > = {
36
47
  blockHash: Hash
37
48
  blockNumber: uint256
38
49
  entryPoint: Address
39
50
  transactionHash: Hash
40
- userOperation: UserOperation<entryPointVersion, uint256>
51
+ userOperation: UserOperation<entryPointVersion, uint256, uint32>
41
52
  }
42
53
 
43
54
  /** @link https://eips.ethereum.org/EIPS/eip-4337#entrypoint-definition */
@@ -66,9 +77,48 @@ export type PackedUserOperation = {
66
77
  export type UserOperation<
67
78
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
68
79
  uint256 = bigint,
80
+ uint32 = number,
69
81
  > = OneOf<
82
+ | (entryPointVersion extends '0.8'
83
+ ? {
84
+ /** Authorization data. */
85
+ authorization?: SignedAuthorization<uint32> | undefined
86
+ /** The data to pass to the `sender` during the main execution call. */
87
+ callData: Hex
88
+ /** The amount of gas to allocate the main execution call */
89
+ callGasLimit: uint256
90
+ /** Account factory. Only for new accounts. */
91
+ factory?: Address | undefined
92
+ /** Data for account factory. */
93
+ factoryData?: Hex | undefined
94
+ /** Maximum fee per gas. */
95
+ maxFeePerGas: uint256
96
+ /** Maximum priority fee per gas. */
97
+ maxPriorityFeePerGas: uint256
98
+ /** Anti-replay parameter. */
99
+ nonce: uint256
100
+ /** Address of paymaster contract. */
101
+ paymaster?: Address | undefined
102
+ /** Data for paymaster. */
103
+ paymasterData?: Hex | undefined
104
+ /** The amount of gas to allocate for the paymaster post-operation code. */
105
+ paymasterPostOpGasLimit?: uint256 | undefined
106
+ /** The amount of gas to allocate for the paymaster validation code. */
107
+ paymasterVerificationGasLimit?: uint256 | undefined
108
+ /** Extra gas to pay the Bundler. */
109
+ preVerificationGas: uint256
110
+ /** The account making the operation. */
111
+ sender: Address
112
+ /** Data passed into the account to verify authorization. */
113
+ signature: Hex
114
+ /** The amount of gas to allocate for the verification step. */
115
+ verificationGasLimit: uint256
116
+ }
117
+ : never)
70
118
  | (entryPointVersion extends '0.7'
71
119
  ? {
120
+ /** Authorization data. */
121
+ authorization?: SignedAuthorization<uint32> | undefined
72
122
  /** The data to pass to the `sender` during the main execution call. */
73
123
  callData: Hex
74
124
  /** The amount of gas to allocate the main execution call */
@@ -103,6 +153,8 @@ export type UserOperation<
103
153
  : never)
104
154
  | (entryPointVersion extends '0.6'
105
155
  ? {
156
+ /** Authorization data. */
157
+ authorization?: SignedAuthorization<uint32> | undefined
106
158
  /** The data to pass to the `sender` during the main execution call. */
107
159
  callData: Hex
108
160
  /** The amount of gas to allocate the main execution call */
@@ -132,10 +184,24 @@ export type UserOperation<
132
184
  export type UserOperationRequest<
133
185
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
134
186
  uint256 = bigint,
187
+ uint32 = number,
135
188
  > = OneOf<
189
+ | (entryPointVersion extends '0.8'
190
+ ? UnionPartialBy<
191
+ UserOperation<'0.8', uint256, uint32>,
192
+ // We are able to calculate these via `prepareUserOperation`.
193
+ | keyof EstimateUserOperationGasReturnType<'0.8'>
194
+ | 'callData'
195
+ | 'maxFeePerGas'
196
+ | 'maxPriorityFeePerGas'
197
+ | 'nonce'
198
+ | 'sender'
199
+ | 'signature'
200
+ >
201
+ : never)
136
202
  | (entryPointVersion extends '0.7'
137
203
  ? UnionPartialBy<
138
- UserOperation<'0.7', uint256>,
204
+ UserOperation<'0.7', uint256, uint32>,
139
205
  // We are able to calculate these via `prepareUserOperation`.
140
206
  | keyof EstimateUserOperationGasReturnType<'0.7'>
141
207
  | 'callData'
@@ -148,7 +214,7 @@ export type UserOperationRequest<
148
214
  : never)
149
215
  | (entryPointVersion extends '0.6'
150
216
  ? UnionPartialBy<
151
- UserOperation<'0.6', uint256>,
217
+ UserOperation<'0.6', uint256, uint32>,
152
218
  // We are able to calculate these via `prepareUserOperation`.
153
219
  | keyof EstimateUserOperationGasReturnType<'0.6'>
154
220
  | 'callData'
@@ -1,6 +1,8 @@
1
1
  import type { ErrorType } from '../../../errors/utils.js'
2
+ import type { SignedAuthorization } from '../../../types/authorization.js'
2
3
  import type { ExactPartial } from '../../../types/utils.js'
3
4
  import { numberToHex } from '../../../utils/encoding/toHex.js'
5
+ import { pad } from '../../../utils/index.js'
4
6
  import type { RpcUserOperation } from '../../types/rpc.js'
5
7
  import type { UserOperation } from '../../types/userOperation.js'
6
8
 
@@ -48,6 +50,25 @@ export function formatUserOperationRequest(
48
50
  rpcRequest.signature = request.signature
49
51
  if (typeof request.verificationGasLimit !== 'undefined')
50
52
  rpcRequest.verificationGasLimit = numberToHex(request.verificationGasLimit)
53
+ if (typeof request.authorization !== 'undefined')
54
+ rpcRequest.eip7702Auth = formatAuthorization(request.authorization)
51
55
 
52
56
  return rpcRequest
53
57
  }
58
+
59
+ function formatAuthorization(authorization: SignedAuthorization) {
60
+ return {
61
+ address: authorization.address,
62
+ chainId: numberToHex(authorization.chainId),
63
+ nonce: numberToHex(authorization.nonce),
64
+ r: authorization.r
65
+ ? numberToHex(BigInt(authorization.r), { size: 32 })
66
+ : pad('0x', { size: 32 }),
67
+ s: authorization.s
68
+ ? numberToHex(BigInt(authorization.s), { size: 32 })
69
+ : pad('0x', { size: 32 }),
70
+ yParity: authorization.yParity
71
+ ? numberToHex(authorization.yParity, { size: 1 })
72
+ : pad('0x', { size: 32 }),
73
+ }
74
+ }
@@ -0,0 +1,21 @@
1
+ import { concat } from '../../../utils/data/concat.js'
2
+ import type { UserOperation } from '../../types/userOperation.js'
3
+
4
+ export function getInitCode(
5
+ userOperation: Pick<
6
+ UserOperation,
7
+ 'authorization' | 'factory' | 'factoryData'
8
+ >,
9
+ ) {
10
+ const { authorization, factory, factoryData } = userOperation
11
+ if (
12
+ factory === '0x7702' ||
13
+ factory === '0x7702000000000000000000000000000000000000'
14
+ ) {
15
+ if (!authorization) return '0x7702000000000000000000000000000000000000'
16
+ const delegation = authorization.address
17
+ return concat([delegation, factoryData ?? '0x'])
18
+ }
19
+ if (!factory) return '0x'
20
+ return concat([factory, factoryData ?? '0x'])
21
+ }
@@ -1,12 +1,14 @@
1
1
  import type { Address } from 'abitype'
2
- import type { Hash } from '../../../types/misc.js'
2
+
3
+ import type { Hash, Hex } from '../../../types/misc.js'
3
4
  import { encodeAbiParameters } from '../../../utils/abi/encodeAbiParameters.js'
4
- import { concat } from '../../../utils/data/concat.js'
5
- import { pad } from '../../../utils/data/pad.js'
6
- import { numberToHex } from '../../../utils/encoding/toHex.js'
7
5
  import { keccak256 } from '../../../utils/hash/keccak256.js'
6
+ import { hashTypedData } from '../../../utils/signature/hashTypedData.js'
8
7
  import type { EntryPointVersion } from '../../types/entryPointVersion.js'
9
8
  import type { UserOperation } from '../../types/userOperation.js'
9
+ import { getInitCode } from './getInitCode.js'
10
+ import { getUserOperationTypedData } from './getUserOperationTypedData.js'
11
+ import { toPackedUserOperation } from './toPackedUserOperation.js'
10
12
 
11
13
  export type GetUserOperationHashParameters<
12
14
  entryPointVersion extends EntryPointVersion = EntryPointVersion,
@@ -27,20 +29,36 @@ export function getUserOperationHash<
27
29
  const { chainId, entryPointAddress, entryPointVersion } = parameters
28
30
  const userOperation = parameters.userOperation as UserOperation
29
31
  const {
30
- callData,
32
+ authorization,
33
+ callData = '0x',
31
34
  callGasLimit,
32
- initCode,
33
35
  maxFeePerGas,
34
36
  maxPriorityFeePerGas,
35
37
  nonce,
36
- paymasterAndData,
38
+ paymasterAndData = '0x',
37
39
  preVerificationGas,
38
40
  sender,
39
41
  verificationGasLimit,
40
42
  } = userOperation
41
43
 
44
+ if (entryPointVersion === '0.8')
45
+ return hashTypedData(
46
+ getUserOperationTypedData({
47
+ chainId,
48
+ entryPointAddress,
49
+ userOperation,
50
+ }),
51
+ )
52
+
42
53
  const packedUserOp = (() => {
43
54
  if (entryPointVersion === '0.6') {
55
+ const factory = userOperation.initCode?.slice(0, 42) as Hex
56
+ const factoryData = userOperation.initCode?.slice(42) as Hex | undefined
57
+ const initCode = getInitCode({
58
+ authorization,
59
+ factory,
60
+ factoryData,
61
+ })
44
62
  return encodeAbiParameters(
45
63
  [
46
64
  { type: 'address' },
@@ -57,51 +75,20 @@ export function getUserOperationHash<
57
75
  [
58
76
  sender,
59
77
  nonce,
60
- keccak256(initCode ?? '0x'),
61
- keccak256(callData ?? '0x'),
78
+ keccak256(initCode),
79
+ keccak256(callData),
62
80
  callGasLimit,
63
81
  verificationGasLimit,
64
82
  preVerificationGas,
65
83
  maxFeePerGas,
66
84
  maxPriorityFeePerGas,
67
- keccak256(paymasterAndData ?? '0x'),
85
+ keccak256(paymasterAndData),
68
86
  ],
69
87
  )
70
88
  }
71
89
 
72
90
  if (entryPointVersion === '0.7') {
73
- const accountGasLimits = concat([
74
- pad(numberToHex(userOperation.verificationGasLimit), { size: 16 }),
75
- pad(numberToHex(userOperation.callGasLimit), { size: 16 }),
76
- ])
77
- const callData_hashed = keccak256(callData)
78
- const gasFees = concat([
79
- pad(numberToHex(userOperation.maxPriorityFeePerGas), { size: 16 }),
80
- pad(numberToHex(userOperation.maxFeePerGas), { size: 16 }),
81
- ])
82
- const initCode_hashed = keccak256(
83
- userOperation.factory && userOperation.factoryData
84
- ? concat([userOperation.factory, userOperation.factoryData])
85
- : '0x',
86
- )
87
- const paymasterAndData_hashed = keccak256(
88
- userOperation.paymaster
89
- ? concat([
90
- userOperation.paymaster,
91
- pad(
92
- numberToHex(userOperation.paymasterVerificationGasLimit || 0),
93
- {
94
- size: 16,
95
- },
96
- ),
97
- pad(numberToHex(userOperation.paymasterPostOpGasLimit || 0), {
98
- size: 16,
99
- }),
100
- userOperation.paymasterData || '0x',
101
- ])
102
- : '0x',
103
- )
104
-
91
+ const packedUserOp = toPackedUserOperation(userOperation)
105
92
  return encodeAbiParameters(
106
93
  [
107
94
  { type: 'address' },
@@ -114,14 +101,14 @@ export function getUserOperationHash<
114
101
  { type: 'bytes32' },
115
102
  ],
116
103
  [
117
- sender,
118
- nonce,
119
- initCode_hashed,
120
- callData_hashed,
121
- accountGasLimits,
122
- preVerificationGas,
123
- gasFees,
124
- paymasterAndData_hashed,
104
+ packedUserOp.sender,
105
+ packedUserOp.nonce,
106
+ keccak256(packedUserOp.initCode),
107
+ keccak256(packedUserOp.callData),
108
+ packedUserOp.accountGasLimits,
109
+ packedUserOp.preVerificationGas,
110
+ packedUserOp.gasFees,
111
+ keccak256(packedUserOp.paymasterAndData),
125
112
  ],
126
113
  )
127
114
  }
@@ -0,0 +1,42 @@
1
+ import type { Address } from 'abitype'
2
+
3
+ import type { TypedDataDefinition } from '../../../types/typedData.js'
4
+ import type { UserOperation } from '../../types/userOperation.js'
5
+ import { toPackedUserOperation } from './toPackedUserOperation.js'
6
+
7
+ export type GetUserOperationTypedDataParameters = {
8
+ chainId: number
9
+ entryPointAddress: Address
10
+ userOperation: UserOperation<'0.8'>
11
+ }
12
+
13
+ export function getUserOperationTypedData(
14
+ parameters: GetUserOperationTypedDataParameters,
15
+ ) {
16
+ const { chainId, entryPointAddress, userOperation } = parameters
17
+
18
+ const packedUserOp = toPackedUserOperation(userOperation)
19
+
20
+ return {
21
+ types: {
22
+ PackedUserOperation: [
23
+ { type: 'address', name: 'sender' },
24
+ { type: 'uint256', name: 'nonce' },
25
+ { type: 'bytes', name: 'initCode' },
26
+ { type: 'bytes', name: 'callData' },
27
+ { type: 'bytes32', name: 'accountGasLimits' },
28
+ { type: 'uint256', name: 'preVerificationGas' },
29
+ { type: 'bytes32', name: 'gasFees' },
30
+ { type: 'bytes', name: 'paymasterAndData' },
31
+ ],
32
+ },
33
+ primaryType: 'PackedUserOperation',
34
+ domain: {
35
+ name: 'ERC4337',
36
+ version: '1',
37
+ chainId,
38
+ verifyingContract: entryPointAddress,
39
+ },
40
+ message: packedUserOp,
41
+ } as const satisfies TypedDataDefinition
42
+ }
@@ -5,6 +5,7 @@ import type {
5
5
  PackedUserOperation,
6
6
  UserOperation,
7
7
  } from '../../types/userOperation.js'
8
+ import { getInitCode } from './getInitCode.js'
8
9
 
9
10
  export function toPackedUserOperation(
10
11
  userOperation: UserOperation,
@@ -12,8 +13,6 @@ export function toPackedUserOperation(
12
13
  const {
13
14
  callGasLimit,
14
15
  callData,
15
- factory,
16
- factoryData,
17
16
  maxPriorityFeePerGas,
18
17
  maxFeePerGas,
19
18
  paymaster,
@@ -29,8 +28,7 @@ export function toPackedUserOperation(
29
28
  pad(numberToHex(verificationGasLimit || 0n), { size: 16 }),
30
29
  pad(numberToHex(callGasLimit || 0n), { size: 16 }),
31
30
  ])
32
- const initCode =
33
- factory && factoryData ? concat([factory, factoryData]) : '0x'
31
+ const initCode = getInitCode(userOperation)
34
32
  const gasFees = concat([
35
33
  pad(numberToHex(maxPriorityFeePerGas || 0n), { size: 16 }),
36
34
  pad(numberToHex(maxFeePerGas || 0n), { size: 16 }),
package/actions/index.ts CHANGED
@@ -316,6 +316,37 @@ export {
316
316
  type GetPermissionsReturnType,
317
317
  getPermissions,
318
318
  } from './wallet/getPermissions.js'
319
+ export {
320
+ type GetCapabilitiesParameters,
321
+ type GetCapabilitiesErrorType,
322
+ type GetCapabilitiesReturnType,
323
+ getCapabilities,
324
+ } from './wallet/getCapabilities.js'
325
+ export {
326
+ type SendCallsErrorType,
327
+ type SendCallsParameters,
328
+ type SendCallsReturnType,
329
+ sendCalls,
330
+ } from './wallet/sendCalls.js'
331
+ export {
332
+ type GetCallsStatusErrorType,
333
+ type GetCallsStatusParameters,
334
+ type GetCallsStatusReturnType,
335
+ getCallsStatus,
336
+ } from './wallet/getCallsStatus.js'
337
+ export {
338
+ type ShowCallsStatusErrorType,
339
+ type ShowCallsStatusParameters,
340
+ type ShowCallsStatusReturnType,
341
+ showCallsStatus,
342
+ } from './wallet/showCallsStatus.js'
343
+ export {
344
+ type WaitForCallsStatusErrorType,
345
+ type WaitForCallsStatusParameters,
346
+ type WaitForCallsStatusReturnType,
347
+ type WaitForCallsStatusTimeoutErrorType,
348
+ waitForCallsStatus,
349
+ } from './wallet/waitForCallsStatus.js'
319
350
  export {
320
351
  type GetProofErrorType,
321
352
  type GetProofParameters,
@@ -1,16 +1,16 @@
1
- import type { Client } from '../../../clients/createClient.js'
2
- import type { Transport } from '../../../clients/transports/createTransport.js'
3
- import type { ErrorType } from '../../../errors/utils.js'
4
- import type { Account } from '../../../types/account.js'
5
- import type { Chain } from '../../../types/chain.js'
1
+ import type { Client } from '../../clients/createClient.js'
2
+ import type { Transport } from '../../clients/transports/createTransport.js'
3
+ import type { ErrorType } from '../../errors/utils.js'
4
+ import type { Account } from '../../types/account.js'
5
+ import type { Chain } from '../../types/chain.js'
6
6
  import type {
7
7
  WalletCapabilities,
8
8
  WalletGetCallsStatusReturnType,
9
- } from '../../../types/eip1193.js'
10
- import type { Prettify } from '../../../types/utils.js'
11
- import type { RequestErrorType } from '../../../utils/buildRequest.js'
12
- import { hexToBigInt, hexToNumber } from '../../../utils/encoding/fromHex.js'
13
- import { receiptStatuses } from '../../../utils/formatters/transactionReceipt.js'
9
+ } from '../../types/eip1193.js'
10
+ import type { Prettify } from '../../types/utils.js'
11
+ import type { RequestErrorType } from '../../utils/buildRequest.js'
12
+ import { hexToBigInt, hexToNumber } from '../../utils/encoding/fromHex.js'
13
+ import { receiptStatuses } from '../../utils/formatters/transactionReceipt.js'
14
14
 
15
15
  export type GetCallsStatusParameters = { id: string }
16
16
 
@@ -34,7 +34,7 @@ export type GetCallsStatusErrorType = RequestErrorType | ErrorType
34
34
  /**
35
35
  * Returns the status of a call batch that was sent via `sendCalls`.
36
36
  *
37
- * - Docs: https://viem.sh/experimental/eip5792/getCallsStatus
37
+ * - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus
38
38
  * - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)
39
39
  *
40
40
  * @param client - Client to use
@@ -43,7 +43,7 @@ export type GetCallsStatusErrorType = RequestErrorType | ErrorType
43
43
  * @example
44
44
  * import { createWalletClient, custom } from 'viem'
45
45
  * import { mainnet } from 'viem/chains'
46
- * import { getCallsStatus } from 'viem/experimental'
46
+ * import { getCallsStatus } from 'viem/actions'
47
47
  *
48
48
  * const client = createWalletClient({
49
49
  * chain: mainnet,
@@ -62,7 +62,7 @@ export async function getCallsStatus<
62
62
  atomic = false,
63
63
  chainId,
64
64
  receipts,
65
- version = '1.0',
65
+ version = '2.0.0',
66
66
  ...response
67
67
  } = await client.request({
68
68
  method: 'wallet_getCallsStatus',
@@ -1,16 +1,16 @@
1
1
  import type { Address } from 'abitype'
2
2
 
3
- import { parseAccount } from '../../../accounts/utils/parseAccount.js'
4
- import type { Client } from '../../../clients/createClient.js'
5
- import type { Transport } from '../../../clients/transports/createTransport.js'
6
- import type { ErrorType } from '../../../errors/utils.js'
7
- import type { Account } from '../../../types/account.js'
3
+ import { parseAccount } from '../../accounts/utils/parseAccount.js'
4
+ import type { Client } from '../../clients/createClient.js'
5
+ import type { Transport } from '../../clients/transports/createTransport.js'
6
+ import type { ErrorType } from '../../errors/utils.js'
7
+ import type { Account } from '../../types/account.js'
8
8
  import type {
9
9
  WalletCapabilities,
10
10
  WalletCapabilitiesRecord,
11
- } from '../../../types/eip1193.js'
12
- import type { Prettify } from '../../../types/utils.js'
13
- import type { RequestErrorType } from '../../../utils/buildRequest.js'
11
+ } from '../../types/eip1193.js'
12
+ import type { Prettify } from '../../types/utils.js'
13
+ import type { RequestErrorType } from '../../utils/buildRequest.js'
14
14
 
15
15
  export type GetCapabilitiesParameters<
16
16
  chainId extends number | undefined = undefined,
@@ -32,7 +32,7 @@ export type GetCapabilitiesErrorType = RequestErrorType | ErrorType
32
32
  /**
33
33
  * Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc).
34
34
  *
35
- * - Docs: https://viem.sh/experimental/eip5792/getCapabilities
35
+ * - Docs: https://viem.sh/docs/actions/wallet/getCapabilities
36
36
  * - JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792)
37
37
  *
38
38
  * @param client - Client to use
@@ -41,7 +41,7 @@ export type GetCapabilitiesErrorType = RequestErrorType | ErrorType
41
41
  * @example
42
42
  * import { createWalletClient, custom } from 'viem'
43
43
  * import { mainnet } from 'viem/chains'
44
- * import { getCapabilities } from 'viem/experimental'
44
+ * import { getCapabilities } from 'viem/actions'
45
45
  *
46
46
  * const client = createWalletClient({
47
47
  * chain: mainnet,
@@ -1,21 +1,21 @@
1
1
  import type { Address, Narrow } from 'abitype'
2
- import { parseAccount } from '../../../accounts/utils/parseAccount.js'
3
- import type { Client } from '../../../clients/createClient.js'
4
- import type { Transport } from '../../../clients/transports/createTransport.js'
5
- import { AccountNotFoundError } from '../../../errors/account.js'
6
- import type { BaseError } from '../../../errors/base.js'
7
- import type { ErrorType } from '../../../errors/utils.js'
8
- import type { Account, GetAccountParameter } from '../../../types/account.js'
9
- import type { Call, Calls } from '../../../types/calls.js'
10
- import type { Chain, DeriveChain } from '../../../types/chain.js'
2
+ import { parseAccount } from '../../accounts/utils/parseAccount.js'
3
+ import type { Client } from '../../clients/createClient.js'
4
+ import type { Transport } from '../../clients/transports/createTransport.js'
5
+ import { AccountNotFoundError } from '../../errors/account.js'
6
+ import type { BaseError } from '../../errors/base.js'
7
+ import type { ErrorType } from '../../errors/utils.js'
8
+ import type { Account, GetAccountParameter } from '../../types/account.js'
9
+ import type { Call, Calls } from '../../types/calls.js'
10
+ import type { Chain, DeriveChain } from '../../types/chain.js'
11
11
  import type {
12
12
  WalletCapabilities,
13
13
  WalletSendCallsParameters,
14
- } from '../../../types/eip1193.js'
15
- import { encodeFunctionData } from '../../../utils/abi/encodeFunctionData.js'
16
- import type { RequestErrorType } from '../../../utils/buildRequest.js'
17
- import { numberToHex } from '../../../utils/encoding/toHex.js'
18
- import { getTransactionError } from '../../../utils/errors/getTransactionError.js'
14
+ } from '../../types/eip1193.js'
15
+ import { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js'
16
+ import type { RequestErrorType } from '../../utils/buildRequest.js'
17
+ import { numberToHex } from '../../utils/encoding/toHex.js'
18
+ import { getTransactionError } from '../../utils/errors/getTransactionError.js'
19
19
 
20
20
  export type SendCallsParameters<
21
21
  chain extends Chain | undefined = Chain | undefined,
@@ -43,7 +43,7 @@ export type SendCallsErrorType = RequestErrorType | ErrorType
43
43
  /**
44
44
  * Requests the connected wallet to send a batch of calls.
45
45
  *
46
- * - Docs: https://viem.sh/experimental/eip5792/sendCalls
46
+ * - Docs: https://viem.sh/docs/actions/wallet/sendCalls
47
47
  * - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792)
48
48
  *
49
49
  * @param client - Client to use
@@ -52,7 +52,7 @@ export type SendCallsErrorType = RequestErrorType | ErrorType
52
52
  * @example
53
53
  * import { createWalletClient, custom } from 'viem'
54
54
  * import { mainnet } from 'viem/chains'
55
- * import { sendCalls } from 'viem/experimental'
55
+ * import { sendCalls } from 'viem/actions'
56
56
  *
57
57
  * const client = createWalletClient({
58
58
  * chain: mainnet,
@@ -87,7 +87,7 @@ export async function sendCalls<
87
87
  chain = client.chain,
88
88
  forceAtomic = false,
89
89
  id,
90
- version = '1.0',
90
+ version = '2.0.0',
91
91
  } = parameters
92
92
 
93
93
  if (typeof account_ === 'undefined')