@aastar/sdk 0.14.3 → 0.16.8

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 (958) hide show
  1. package/README.md +100 -120
  2. package/dist/account/src/accounts/simple.d.ts +18 -0
  3. package/{packages/account/src/accounts/simple.ts → dist/account/src/accounts/simple.js} +12 -47
  4. package/dist/account/src/eoa.d.ts +10 -0
  5. package/dist/account/src/eoa.js +21 -0
  6. package/dist/account/src/index.d.ts +19 -0
  7. package/dist/account/src/index.js +49 -0
  8. package/dist/core/src/abis/BLSAggregator.json +686 -0
  9. package/dist/core/src/abis/BLSValidator.json +42 -0
  10. package/dist/core/src/abis/DVTValidator.json +368 -0
  11. package/dist/core/src/abis/EntryPoint.json +1382 -0
  12. package/dist/core/src/abis/GToken.json +513 -0
  13. package/dist/core/src/abis/GTokenStaking.json +949 -0
  14. package/dist/core/src/abis/MySBT.json +1518 -0
  15. package/dist/core/src/abis/Paymaster.json +1143 -0
  16. package/dist/core/src/abis/PaymasterFactory.json +640 -0
  17. package/dist/core/src/abis/Registry.json +1942 -0
  18. package/dist/core/src/abis/ReputationSystem.json +699 -0
  19. package/dist/core/src/abis/SimpleAccount.json +560 -0
  20. package/dist/core/src/abis/SimpleAccountFactory.json +111 -0
  21. package/dist/core/src/abis/SuperPaymaster.json +1781 -0
  22. package/dist/core/src/abis/index.d.ts +1126 -0
  23. package/dist/core/src/abis/index.js +91 -0
  24. package/dist/core/src/abis/xPNTsFactory.json +718 -0
  25. package/dist/core/src/abis/xPNTsToken.json +1280 -0
  26. package/dist/core/src/actions/StateValidator.d.ts +68 -0
  27. package/dist/core/src/actions/StateValidator.js +187 -0
  28. package/dist/core/src/actions/account.d.ts +55 -0
  29. package/dist/core/src/actions/account.js +133 -0
  30. package/dist/core/src/actions/aggregator.d.ts +17 -0
  31. package/dist/core/src/actions/aggregator.js +31 -0
  32. package/dist/core/src/actions/dvt.d.ts +30 -0
  33. package/dist/core/src/actions/dvt.js +41 -0
  34. package/dist/core/src/actions/entryPoint.d.ts +90 -0
  35. package/dist/core/src/actions/entryPoint.js +211 -0
  36. package/dist/core/src/actions/factory.d.ts +215 -0
  37. package/dist/core/src/actions/factory.js +442 -0
  38. package/dist/core/src/actions/faucet.d.ts +48 -0
  39. package/dist/core/src/actions/faucet.js +337 -0
  40. package/dist/core/src/actions/gtokenExtended.d.ts +39 -0
  41. package/dist/core/src/actions/gtokenExtended.js +115 -0
  42. package/{packages/core/src/actions/index.ts → dist/core/src/actions/index.d.ts} +5 -0
  43. package/dist/core/src/actions/index.js +17 -0
  44. package/dist/core/src/actions/paymasterV4.d.ts +170 -0
  45. package/dist/core/src/actions/paymasterV4.js +334 -0
  46. package/dist/core/src/actions/registry.d.ts +246 -0
  47. package/dist/core/src/actions/registry.js +667 -0
  48. package/dist/core/src/actions/reputation.d.ts +129 -0
  49. package/dist/core/src/actions/reputation.js +281 -0
  50. package/dist/core/src/actions/sbt.d.ts +191 -0
  51. package/dist/core/src/actions/sbt.js +533 -0
  52. package/dist/core/src/actions/staking.d.ts +132 -0
  53. package/dist/core/src/actions/staking.js +330 -0
  54. package/dist/core/src/actions/superPaymaster.d.ts +237 -0
  55. package/dist/core/src/actions/superPaymaster.js +644 -0
  56. package/dist/core/src/actions/tokens.d.ts +229 -0
  57. package/dist/core/src/actions/tokens.js +415 -0
  58. package/dist/core/src/branding.d.ts +30 -0
  59. package/dist/core/src/branding.js +30 -0
  60. package/dist/core/src/clients/BaseClient.d.ts +25 -0
  61. package/dist/core/src/clients/BaseClient.js +66 -0
  62. package/dist/core/src/clients/types.d.ts +60 -0
  63. package/dist/core/src/clients/types.js +1 -0
  64. package/dist/core/src/clients.d.ts +5 -0
  65. package/dist/core/src/clients.js +11 -0
  66. package/dist/core/src/communities.d.ts +52 -0
  67. package/dist/core/src/communities.js +73 -0
  68. package/dist/core/src/config/ContractConfigManager.d.ts +20 -0
  69. package/dist/core/src/config/ContractConfigManager.js +48 -0
  70. package/dist/core/src/constants.d.ts +88 -0
  71. package/dist/core/src/constants.js +125 -0
  72. package/dist/core/src/contract-addresses.d.ts +110 -0
  73. package/dist/core/src/contract-addresses.js +99 -0
  74. package/dist/core/src/contracts.d.ts +424 -0
  75. package/dist/core/src/contracts.js +343 -0
  76. package/dist/core/src/crypto/blsSigner.d.ts +64 -0
  77. package/{packages/core/src/crypto/blsSigner.ts → dist/core/src/crypto/blsSigner.js} +23 -49
  78. package/dist/core/src/crypto/index.js +1 -0
  79. package/dist/core/src/index.d.ts +21 -0
  80. package/{packages/core/src/index.ts → dist/core/src/index.js} +4 -2
  81. package/dist/core/src/networks.d.ts +127 -0
  82. package/{ext/aastar-shared-config/src/networks.ts → dist/core/src/networks.js} +34 -33
  83. package/dist/core/src/requirementChecker.d.ts +38 -0
  84. package/{packages/core/src/requirementChecker.ts → dist/core/src/requirementChecker.js} +27 -113
  85. package/dist/core/src/roles.d.ts +204 -0
  86. package/dist/core/src/roles.js +211 -0
  87. package/dist/core/src/utils/validation.d.ts +24 -0
  88. package/dist/core/src/utils/validation.js +56 -0
  89. package/{packages/dapp/src/index.ts → dist/dapp/src/index.d.ts} +0 -1
  90. package/dist/dapp/src/index.js +3 -0
  91. package/dist/dapp/src/ui/hooks/useCreditScore.d.ts +13 -0
  92. package/{packages/dapp/src/ui/hooks/useCreditScore.ts → dist/dapp/src/ui/hooks/useCreditScore.js} +10 -22
  93. package/dist/dapp/src/ui/hooks/useSuperPaymaster.d.ts +8 -0
  94. package/{packages/dapp/src/ui/hooks/useSuperPaymaster.ts → dist/dapp/src/ui/hooks/useSuperPaymaster.js} +9 -17
  95. package/dist/dapp/src/ui/index.d.ts +4 -0
  96. package/{packages/dapp/src/ui/index.ts → dist/dapp/src/ui/index.js} +3 -8
  97. package/dist/identity/src/index.d.ts +46 -0
  98. package/dist/identity/src/index.js +94 -0
  99. package/dist/identity/src/mysbt.d.ts +13 -0
  100. package/{packages/identity/src/mysbt.ts → dist/identity/src/mysbt.js} +9 -20
  101. package/dist/paymaster/src/SuperPaymaster/index.d.ts +44 -0
  102. package/{packages/paymaster/src/SuperPaymaster/index.ts → dist/paymaster/src/SuperPaymaster/index.js} +29 -64
  103. package/dist/paymaster/src/V4/PaymasterClient.d.ts +79 -0
  104. package/dist/paymaster/src/V4/PaymasterClient.js +315 -0
  105. package/dist/paymaster/src/V4/PaymasterOperator.d.ts +41 -0
  106. package/dist/paymaster/src/V4/PaymasterOperator.js +241 -0
  107. package/dist/paymaster/src/V4/PaymasterUtils.d.ts +55 -0
  108. package/dist/paymaster/src/V4/PaymasterUtils.js +124 -0
  109. package/dist/paymaster/src/V4/SuperPaymasterClient.d.ts +21 -0
  110. package/dist/paymaster/src/V4/SuperPaymasterClient.js +73 -0
  111. package/dist/paymaster/src/V4/index.d.ts +4 -0
  112. package/dist/paymaster/src/V4/index.js +4 -0
  113. package/dist/paymaster/src/index.d.ts +2 -0
  114. package/{packages/paymaster/src/index.ts → dist/paymaster/src/index.js} +0 -1
  115. package/dist/sdk/src/clients/ExperimentClient.d.ts +34 -0
  116. package/dist/sdk/src/clients/ExperimentClient.js +58 -0
  117. package/dist/sdk/src/clients/ExperimentClient.test.d.ts +1 -0
  118. package/dist/sdk/src/clients/ExperimentClient.test.js +53 -0
  119. package/dist/sdk/src/clients/admin.d.ts +57 -0
  120. package/dist/sdk/src/clients/admin.js +105 -0
  121. package/dist/sdk/src/clients/admin.test.d.ts +1 -0
  122. package/dist/sdk/src/clients/admin.test.js +79 -0
  123. package/dist/sdk/src/clients/clients.test.d.ts +1 -0
  124. package/dist/sdk/src/clients/clients.test.js +91 -0
  125. package/dist/sdk/src/clients/community.d.ts +48 -0
  126. package/dist/sdk/src/clients/community.js +244 -0
  127. package/dist/sdk/src/clients/community.test.d.ts +1 -0
  128. package/dist/sdk/src/clients/community.test.js +99 -0
  129. package/dist/sdk/src/clients/endUser.d.ts +95 -0
  130. package/dist/sdk/src/clients/endUser.js +388 -0
  131. package/dist/sdk/src/clients/endUser.test.d.ts +1 -0
  132. package/dist/sdk/src/clients/endUser.test.js +188 -0
  133. package/dist/sdk/src/clients/operator.d.ts +96 -0
  134. package/dist/sdk/src/clients/operator.js +247 -0
  135. package/dist/sdk/src/clients/operator.test.d.ts +1 -0
  136. package/dist/sdk/src/clients/operator.test.js +139 -0
  137. package/dist/sdk/src/errors/AAStarError.d.ts +26 -0
  138. package/dist/sdk/src/errors/AAStarError.js +32 -0
  139. package/dist/sdk/src/errors/AAStarError.test.d.ts +1 -0
  140. package/dist/sdk/src/errors/AAStarError.test.js +74 -0
  141. package/dist/sdk/src/errors/decoder.d.ts +1 -0
  142. package/dist/sdk/src/errors/decoder.js +83 -0
  143. package/dist/sdk/src/errors/decoder.test.d.ts +1 -0
  144. package/dist/sdk/src/errors/decoder.test.js +90 -0
  145. package/dist/sdk/src/index.d.ts +16 -0
  146. package/dist/sdk/src/index.js +20 -0
  147. package/dist/sdk/src/node/index.d.ts +7 -0
  148. package/dist/sdk/src/node/index.js +7 -0
  149. package/dist/sdk/src/types/result.d.ts +15 -0
  150. package/dist/sdk/src/types/result.js +23 -0
  151. package/dist/sdk/src/utils/errorHandler.d.ts +40 -0
  152. package/{packages/sdk/src/utils/errorHandler.ts → dist/sdk/src/utils/errorHandler.js} +22 -75
  153. package/dist/sdk/src/utils/errorHandler.test.d.ts +1 -0
  154. package/dist/sdk/src/utils/errorHandler.test.js +89 -0
  155. package/dist/sdk/src/utils/eventDecoder.d.ts +7 -0
  156. package/dist/sdk/src/utils/eventDecoder.js +54 -0
  157. package/dist/sdk/src/utils/eventDecoder.test.d.ts +1 -0
  158. package/dist/sdk/src/utils/eventDecoder.test.js +48 -0
  159. package/dist/sdk/src/utils/funding.d.ts +115 -0
  160. package/{packages/sdk/src/utils/funding.ts → dist/sdk/src/utils/funding.js} +27 -119
  161. package/dist/sdk/src/utils/funding.test.d.ts +1 -0
  162. package/dist/sdk/src/utils/funding.test.js +105 -0
  163. package/dist/sdk/src/utils/keys.d.ts +73 -0
  164. package/{packages/sdk/src/utils/keys.ts → dist/sdk/src/utils/keys.js} +22 -44
  165. package/dist/sdk/src/utils/keys.test.d.ts +1 -0
  166. package/dist/sdk/src/utils/keys.test.js +81 -0
  167. package/dist/sdk/src/utils/roleData.d.ts +66 -0
  168. package/{packages/sdk/src/utils/roleData.ts → dist/sdk/src/utils/roleData.js} +36 -72
  169. package/dist/sdk/src/utils/roleData.test.d.ts +1 -0
  170. package/dist/sdk/src/utils/roleData.test.js +74 -0
  171. package/dist/sdk/src/utils/testScenarios.d.ts +33 -0
  172. package/dist/sdk/src/utils/testScenarios.js +85 -0
  173. package/dist/sdk/src/utils/testScenarios.test.d.ts +1 -0
  174. package/dist/sdk/src/utils/testScenarios.test.js +68 -0
  175. package/dist/sdk/src/utils/userOp.d.ts +78 -0
  176. package/dist/sdk/src/utils/userOp.js +195 -0
  177. package/dist/sdk/src/utils/userOp.test.d.ts +1 -0
  178. package/dist/sdk/src/utils/userOp.test.js +152 -0
  179. package/dist/tokens/src/index.d.ts +56 -0
  180. package/dist/tokens/src/index.js +230 -0
  181. package/examples/regression_test.d.ts +2 -0
  182. package/examples/regression_test.d.ts.map +1 -0
  183. package/examples/regression_test.js +89 -0
  184. package/examples/regression_test.js.map +1 -0
  185. package/package.json +40 -54
  186. package/scripts/v2_regression/00_validate_env.ts +28 -4
  187. package/scripts/v2_regression/01_setup_and_fund.ts +1 -1
  188. package/scripts/v2_regression/02_operator_onboarding.ts +16 -142
  189. package/scripts/v2_regression/03_community_registry.ts +24 -58
  190. package/scripts/v2_regression/04_enduser_flow.ts +16 -49
  191. package/scripts/v2_regression/05_admin_audit.ts +1 -1
  192. package/.eslintrc.js +0 -28
  193. package/.gitmodules +0 -9
  194. package/aastar-sdk.code-workspace +0 -14
  195. package/abis/BLSAggregator.json +0 -572
  196. package/abis/BLSValidator.json +0 -26
  197. package/abis/DVTValidator.json +0 -370
  198. package/abis/Eip7702Support.json +0 -24
  199. package/abis/EntryPoint.json +0 -1379
  200. package/abis/GToken.json +0 -479
  201. package/abis/GTokenStaking.json +0 -944
  202. package/abis/LegacyAccount.json +0 -625
  203. package/abis/MySBT.json +0 -1586
  204. package/abis/Paymaster.json +0 -1205
  205. package/abis/PaymasterFactory.json +0 -650
  206. package/abis/PaymasterV4_2.json +0 -1183
  207. package/abis/Registry.json +0 -1636
  208. package/abis/ReputationSystem.json +0 -477
  209. package/abis/SenderCreator.json +0 -99
  210. package/abis/Simple7702Account.json +0 -395
  211. package/abis/SimpleAccount.json +0 -625
  212. package/abis/SimpleAccountFactory.json +0 -108
  213. package/abis/SimpleAccountFactoryV08.json +0 -87
  214. package/abis/SimpleAccountV08.json +0 -557
  215. package/abis/SuperPaymaster.json +0 -1399
  216. package/abis/UserOperationLib.json +0 -57
  217. package/abis/aPNTs.json +0 -1173
  218. package/abis/xPNTsFactory.json +0 -728
  219. package/abis/xPNTsToken.json +0 -1173
  220. package/config/networks/README.md +0 -54
  221. package/config/networks/mainnet.env.example +0 -39
  222. package/config/networks/optimism-sepolia.env.example +0 -35
  223. package/config/networks/optimism.env.example +0 -36
  224. package/config/networks/sepolia.env.example +0 -36
  225. package/data/experiment_data.csv +0 -36
  226. package/data/industry_baseline_2025-12-23.json +0 -154
  227. package/data/industry_baseline_latest.json +0 -154
  228. package/docs/API_REFERENCE.md +0 -796
  229. package/docs/DAO_Mining_Distribution_Plan.md +0 -522
  230. package/docs/DOCUMENTATION_PLAN.md +0 -455
  231. package/docs/Plan.md +0 -266
  232. package/docs/Regression_Testing_Guide.md +0 -70
  233. package/docs/SDK_Optimization_Evaluation_Plan.md +0 -51
  234. package/docs/SEPOLIA_ENV_REFERENCE.md +0 -51
  235. package/docs/STAGE_3_SCENARIO_EXP_PLAN.md +0 -77
  236. package/docs/Script_Comparison_Report.md +0 -91
  237. package/docs/Sepolia_Latest_Deployment.md +0 -117
  238. package/docs/TEST_COVERAGE_MATRIX.md +0 -72
  239. package/docs/TODO_SDK_COVERAGE.md +0 -55
  240. package/docs/USER_CASE_DESIGN.md +0 -110
  241. package/docs/api/@aastar/account/README.md +0 -15
  242. package/docs/api/@aastar/account/classes/UserOpClient.md +0 -87
  243. package/docs/api/@aastar/account/functions/createEOAWalletClient.md +0 -21
  244. package/docs/api/@aastar/account/functions/getUserOpHash.md +0 -23
  245. package/docs/api/@aastar/account/functions/packUserOpLimits.md +0 -19
  246. package/docs/api/@aastar/account/functions/toSimpleSmartAccount.md +0 -83
  247. package/docs/api/@aastar/account/type-aliases/EOAWalletClient.md +0 -37
  248. package/docs/api/@aastar/account/type-aliases/SimpleSmartAccount.md +0 -39
  249. package/docs/api/@aastar/core/README.md +0 -136
  250. package/docs/api/@aastar/core/classes/BLSSigner.md +0 -147
  251. package/docs/api/@aastar/core/enumerations/NodeType.md +0 -33
  252. package/docs/api/@aastar/core/functions/aggregatorActions.md +0 -2714
  253. package/docs/api/@aastar/core/functions/createAAStarPublicClient.md +0 -3105
  254. package/docs/api/@aastar/core/functions/dvtActions.md +0 -2714
  255. package/docs/api/@aastar/core/functions/factoryActions.md +0 -2714
  256. package/docs/api/@aastar/core/functions/getAddressUrl.md +0 -32
  257. package/docs/api/@aastar/core/functions/getAllCommunityConfigs.md +0 -9
  258. package/docs/api/@aastar/core/functions/getAllV2Contracts.md +0 -20
  259. package/docs/api/@aastar/core/functions/getBlockExplorer.md +0 -26
  260. package/docs/api/@aastar/core/functions/getChainId.md +0 -26
  261. package/docs/api/@aastar/core/functions/getCommunities.md +0 -76
  262. package/docs/api/@aastar/core/functions/getCommunity.md +0 -32
  263. package/docs/api/@aastar/core/functions/getCommunityConfig.md +0 -15
  264. package/docs/api/@aastar/core/functions/getContract.md +0 -37
  265. package/docs/api/@aastar/core/functions/getContractNetworks.md +0 -18
  266. package/docs/api/@aastar/core/functions/getContracts.md +0 -178
  267. package/docs/api/@aastar/core/functions/getCoreContracts.md +0 -55
  268. package/docs/api/@aastar/core/functions/getDeploymentDate.md +0 -32
  269. package/docs/api/@aastar/core/functions/getEntryPoint.md +0 -25
  270. package/docs/api/@aastar/core/functions/getNetwork.md +0 -26
  271. package/docs/api/@aastar/core/functions/getPaymasterV4_1.md +0 -25
  272. package/docs/api/@aastar/core/functions/getRpcUrl.md +0 -25
  273. package/docs/api/@aastar/core/functions/getSimpleAccountFactory.md +0 -25
  274. package/docs/api/@aastar/core/functions/getSuperPaymasterV2.md +0 -25
  275. package/docs/api/@aastar/core/functions/getTestAccounts.md +0 -30
  276. package/docs/api/@aastar/core/functions/getTestTokenContracts.md +0 -38
  277. package/docs/api/@aastar/core/functions/getTokenContracts.md +0 -31
  278. package/docs/api/@aastar/core/functions/getTxUrl.md +0 -32
  279. package/docs/api/@aastar/core/functions/getV2ContractByAddress.md +0 -28
  280. package/docs/api/@aastar/core/functions/getV2ContractByName.md +0 -28
  281. package/docs/api/@aastar/core/functions/getV2ContractsByDate.md +0 -26
  282. package/docs/api/@aastar/core/functions/isContractNetworkSupported.md +0 -27
  283. package/docs/api/@aastar/core/functions/isRegisteredCommunity.md +0 -15
  284. package/docs/api/@aastar/core/functions/isV2Contract.md +0 -27
  285. package/docs/api/@aastar/core/functions/paymasterV4Actions.md +0 -2719
  286. package/docs/api/@aastar/core/functions/registryActions.md +0 -2720
  287. package/docs/api/@aastar/core/functions/reputationActions.md +0 -2720
  288. package/docs/api/@aastar/core/functions/sbtActions.md +0 -2720
  289. package/docs/api/@aastar/core/functions/stakingActions.md +0 -2720
  290. package/docs/api/@aastar/core/functions/superPaymasterActions.md +0 -2720
  291. package/docs/api/@aastar/core/functions/tokenActions.md +0 -2714
  292. package/docs/api/@aastar/core/interfaces/CommunityConfig.md +0 -81
  293. package/docs/api/@aastar/core/interfaces/ContractVersion.md +0 -63
  294. package/docs/api/@aastar/core/type-aliases/AggregatorActions.md +0 -79
  295. package/docs/api/@aastar/core/type-aliases/ContractCategory.md +0 -5
  296. package/docs/api/@aastar/core/type-aliases/ContractNetwork.md +0 -5
  297. package/docs/api/@aastar/core/type-aliases/DVTActions.md +0 -139
  298. package/docs/api/@aastar/core/type-aliases/FactoryActions.md +0 -99
  299. package/docs/api/@aastar/core/type-aliases/NetworkContracts.md +0 -5
  300. package/docs/api/@aastar/core/type-aliases/PaymasterV4Actions.md +0 -422
  301. package/docs/api/@aastar/core/type-aliases/RegistryActions.md +0 -263
  302. package/docs/api/@aastar/core/type-aliases/ReputationActions.md +0 -47
  303. package/docs/api/@aastar/core/type-aliases/RoleConfig.md +0 -83
  304. package/docs/api/@aastar/core/type-aliases/SBTActions.md +0 -203
  305. package/docs/api/@aastar/core/type-aliases/StakingActions.md +0 -179
  306. package/docs/api/@aastar/core/type-aliases/SuperPaymasterActions.md +0 -219
  307. package/docs/api/@aastar/core/type-aliases/SupportedNetwork.md +0 -3
  308. package/docs/api/@aastar/core/type-aliases/TokenActions.md +0 -151
  309. package/docs/api/@aastar/core/variables/AASTAR_COMMUNITY.md +0 -8
  310. package/docs/api/@aastar/core/variables/ALL_ADDRESSES.md +0 -71
  311. package/docs/api/@aastar/core/variables/BLSAggregatorABI.md +0 -3
  312. package/docs/api/@aastar/core/variables/BLSHelpers.md +0 -91
  313. package/docs/api/@aastar/core/variables/BPS_DENOMINATOR.md +0 -5
  314. package/docs/api/@aastar/core/variables/BRANDING.md +0 -67
  315. package/docs/api/@aastar/core/variables/BREAD_COMMUNITY.md +0 -8
  316. package/docs/api/@aastar/core/variables/COMMUNITIES.md +0 -5
  317. package/docs/api/@aastar/core/variables/COMMUNITY_OWNERS.md +0 -15
  318. package/docs/api/@aastar/core/variables/CONTRACTS.md +0 -163
  319. package/docs/api/@aastar/core/variables/CONTRACT_METADATA.md +0 -67
  320. package/docs/api/@aastar/core/variables/CORE_ADDRESSES.md +0 -35
  321. package/docs/api/@aastar/core/variables/DEFAULT_APNTS_PRICE_USD.md +0 -5
  322. package/docs/api/@aastar/core/variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md +0 -5
  323. package/docs/api/@aastar/core/variables/DEFAULT_USDT_MINT_AMOUNT.md +0 -5
  324. package/docs/api/@aastar/core/variables/DVTValidatorABI.md +0 -3
  325. package/docs/api/@aastar/core/variables/EntryPointABI.md +0 -3
  326. package/docs/api/@aastar/core/variables/FAUCET_API_URL.md +0 -5
  327. package/docs/api/@aastar/core/variables/GTokenABI.md +0 -3
  328. package/docs/api/@aastar/core/variables/GTokenStakingABI.md +0 -3
  329. package/docs/api/@aastar/core/variables/LINKS.md +0 -33
  330. package/docs/api/@aastar/core/variables/MAX_SERVICE_FEE.md +0 -5
  331. package/docs/api/@aastar/core/variables/MONITORING_ADDRESSES.md +0 -15
  332. package/docs/api/@aastar/core/variables/MySBTABI.md +0 -3
  333. package/docs/api/@aastar/core/variables/NETWORKS.md +0 -79
  334. package/docs/api/@aastar/core/variables/NODE_STAKE_AMOUNTS.md +0 -31
  335. package/docs/api/@aastar/core/variables/OFFICIAL_ADDRESSES.md +0 -11
  336. package/docs/api/@aastar/core/variables/PAYMASTER_ADDRESSES.md +0 -15
  337. package/docs/api/@aastar/core/variables/PaymasterABI.md +0 -3
  338. package/docs/api/@aastar/core/variables/PaymasterFactoryABI.md +0 -3
  339. package/docs/api/@aastar/core/variables/PaymasterV4ABI.md +0 -3
  340. package/docs/api/@aastar/core/variables/ROLE_ANODE.md +0 -3
  341. package/docs/api/@aastar/core/variables/ROLE_COMMUNITY.md +0 -3
  342. package/docs/api/@aastar/core/variables/ROLE_ENDUSER.md +0 -5
  343. package/docs/api/@aastar/core/variables/ROLE_KMS.md +0 -3
  344. package/docs/api/@aastar/core/variables/ROLE_PAYMASTER_AOA.md +0 -3
  345. package/docs/api/@aastar/core/variables/ROLE_PAYMASTER_SUPER.md +0 -3
  346. package/docs/api/@aastar/core/variables/RegistryABI.md +0 -3
  347. package/docs/api/@aastar/core/variables/ReputationSystemABI.md +0 -3
  348. package/docs/api/@aastar/core/variables/ReputationSystemV3ABI.md +0 -3
  349. package/docs/api/@aastar/core/variables/SEPOLIA_CONTRACTS.md +0 -159
  350. package/docs/api/@aastar/core/variables/SEPOLIA_V2_VERSIONS.md +0 -67
  351. package/docs/api/@aastar/core/variables/SERVICE_FEE_RATE.md +0 -5
  352. package/docs/api/@aastar/core/variables/Simple7702AccountABI.md +0 -3
  353. package/docs/api/@aastar/core/variables/SimpleAccountABI.md +0 -3
  354. package/docs/api/@aastar/core/variables/SimpleAccountFactoryABI.md +0 -3
  355. package/docs/api/@aastar/core/variables/SimpleAccountFactoryV08ABI.md +0 -3
  356. package/docs/api/@aastar/core/variables/SimpleAccountV08ABI.md +0 -3
  357. package/docs/api/@aastar/core/variables/SuperPaymasterABI.md +0 -3
  358. package/docs/api/@aastar/core/variables/SuperPaymasterV3ABI.md +0 -3
  359. package/docs/api/@aastar/core/variables/TEST_ACCOUNT_ADDRESSES.md +0 -11
  360. package/docs/api/@aastar/core/variables/TEST_ACCOUNT_POOL_SIZE.md +0 -5
  361. package/docs/api/@aastar/core/variables/TEST_COMMUNITIES.md +0 -19
  362. package/docs/api/@aastar/core/variables/TEST_TOKEN_ADDRESSES.md +0 -19
  363. package/docs/api/@aastar/core/variables/TOKEN_ADDRESSES.md +0 -11
  364. package/docs/api/@aastar/core/variables/V2_SUMMARY.md +0 -39
  365. package/docs/api/@aastar/core/variables/xPNTsFactoryABI.md +0 -3
  366. package/docs/api/@aastar/core/variables/xPNTsTokenABI.md +0 -3
  367. package/docs/api/@aastar/paymaster/README.md +0 -14
  368. package/docs/api/@aastar/paymaster/classes/SuperPaymasterClient.md +0 -163
  369. package/docs/api/@aastar/paymaster/functions/checkEligibility.md +0 -28
  370. package/docs/api/@aastar/paymaster/functions/getPaymasterV4Middleware.md +0 -32
  371. package/docs/api/@aastar/paymaster/functions/getSuperPaymasterMiddleware.md +0 -32
  372. package/docs/api/@aastar/paymaster/type-aliases/PaymasterConfig.md +0 -35
  373. package/docs/api/@aastar/paymaster/type-aliases/PaymasterV4MiddlewareConfig.md +0 -35
  374. package/docs/api/@aastar/tokens/README.md +0 -3
  375. package/docs/api/@aastar/tokens/classes/FinanceClient.md +0 -8653
  376. package/docs/api/README.md +0 -6
  377. package/docs/examples/community-flow.md +0 -28
  378. package/docs/examples/enduser-flow.md +0 -24
  379. package/docs/examples/index.md +0 -18
  380. package/docs/examples/multi-chain.md +0 -31
  381. package/docs/examples/operator-flow.md +0 -28
  382. package/docs/guide/CLI_GUIDE.md +0 -65
  383. package/docs/guide/DOCUMENTATION_PLAN.md +0 -455
  384. package/docs/guide/Security-solution.md +0 -106
  385. package/docs/guide/TEST_COMMANDS.md +0 -320
  386. package/docs/guide/getting-started.md +0 -133
  387. package/docs/guide/installation.md +0 -40
  388. package/docs/guide/paper-data-collection.md +0 -69
  389. package/docs/guide/quick-start.md +0 -52
  390. package/docs/guide/task_breakdown.md +0 -121
  391. package/docs/old-solution.md +0 -1078
  392. package/docs/paper-data-collection.md +0 -69
  393. package/docs/technical_plan.md +0 -510
  394. package/docs/zh/examples/community-flow.md +0 -38
  395. package/docs/zh/examples/complete-workflow.md +0 -10
  396. package/docs/zh/examples/enduser-flow.md +0 -33
  397. package/docs/zh/examples/index.md +0 -18
  398. package/docs/zh/examples/multi-chain.md +0 -46
  399. package/docs/zh/examples/operator-flow.md +0 -37
  400. package/docs/zh/guide/CLI_GUIDE.md +0 -48
  401. package/docs/zh/guide/DOCUMENTATION_PLAN.md +0 -455
  402. package/docs/zh/guide/Plan.md +0 -266
  403. package/docs/zh/guide/SDK_Optimization_Evaluation_Plan.md +0 -51
  404. package/docs/zh/guide/Security-solution.md +0 -106
  405. package/docs/zh/guide/TEST_COMMANDS.md +0 -125
  406. package/docs/zh/guide/TEST_COVERAGE_MATRIX.md +0 -72
  407. package/docs/zh/guide/concepts/account-abstraction.md +0 -95
  408. package/docs/zh/guide/concepts/rainbow-bridge.md +0 -68
  409. package/docs/zh/guide/concepts/reputation.md +0 -95
  410. package/docs/zh/guide/concepts/superpaymaster.md +0 -141
  411. package/docs/zh/guide/getting-started.md +0 -133
  412. package/docs/zh/guide/installation.md +0 -107
  413. package/docs/zh/guide/old-solution.md +0 -1078
  414. package/docs/zh/guide/paper-data-collection.md +0 -69
  415. package/docs/zh/guide/quick-start.md +0 -134
  416. package/docs/zh/guide/sdk-readme.md +0 -253
  417. package/docs/zh/guide/task_breakdown.md +0 -76
  418. package/docs/zh/guide/technical_plan.md +0 -510
  419. package/docs/zh/guide/use-cases/community-management.md +0 -141
  420. package/docs/zh/guide/use-cases/gasless-transactions.md +0 -71
  421. package/docs/zh/guide/use-cases/operator-staking.md +0 -84
  422. package/docs/zh/guide/use-cases/yop.md +0 -72
  423. package/examples/sdk-demo/DEVELOPER_GUIDE.md +0 -159
  424. package/examples/sdk-demo/README.md +0 -30
  425. package/examples/sdk-demo/usage.ts +0 -137
  426. package/ext/aastar-shared-config/.env.example +0 -6
  427. package/ext/aastar-shared-config/.github/workflows/check-secrets.yml +0 -257
  428. package/ext/aastar-shared-config/AGENTS.md +0 -21
  429. package/ext/aastar-shared-config/CHANGELOG.md +0 -99
  430. package/ext/aastar-shared-config/LICENSE +0 -21
  431. package/ext/aastar-shared-config/QUICK_START.md +0 -215
  432. package/ext/aastar-shared-config/README.md +0 -412
  433. package/ext/aastar-shared-config/SHARED_CONFIG_SUMMARY.md +0 -273
  434. package/ext/aastar-shared-config/check-locker-status.mjs +0 -7
  435. package/ext/aastar-shared-config/favicon.ico +0 -0
  436. package/ext/aastar-shared-config/generate-comparison-table.sh +0 -67
  437. package/ext/aastar-shared-config/package.json +0 -46
  438. package/ext/aastar-shared-config/pnpm-lock.yaml +0 -1182
  439. package/ext/aastar-shared-config/src/abis/BLSAggregator.json +0 -1
  440. package/ext/aastar-shared-config/src/abis/DVTValidator.json +0 -1
  441. package/ext/aastar-shared-config/src/abis/GToken.json +0 -1
  442. package/ext/aastar-shared-config/src/abis/GTokenStaking.json +0 -1
  443. package/ext/aastar-shared-config/src/abis/MySBT.json +0 -1
  444. package/ext/aastar-shared-config/src/abis/PaymasterFactory.json +0 -1
  445. package/ext/aastar-shared-config/src/abis/PaymasterV4.json +0 -1098
  446. package/ext/aastar-shared-config/src/abis/Registry.json +0 -1
  447. package/ext/aastar-shared-config/src/abis/SimpleAccount.json +0 -557
  448. package/ext/aastar-shared-config/src/abis/SimpleAccountFactory.json +0 -87
  449. package/ext/aastar-shared-config/src/abis/SuperPaymasterV2.json +0 -1
  450. package/ext/aastar-shared-config/src/abis/index.ts +0 -45
  451. package/ext/aastar-shared-config/src/abis/xPNTsFactory.json +0 -1
  452. package/ext/aastar-shared-config/src/abis/xPNTsToken.json +0 -1
  453. package/ext/aastar-shared-config/src/branding.ts +0 -32
  454. package/ext/aastar-shared-config/src/communities.ts +0 -93
  455. package/ext/aastar-shared-config/src/constants.ts +0 -67
  456. package/ext/aastar-shared-config/src/contract-addresses.ts +0 -95
  457. package/ext/aastar-shared-config/src/contract-versions.ts +0 -374
  458. package/ext/aastar-shared-config/src/contracts.ts +0 -414
  459. package/ext/aastar-shared-config/src/index.ts +0 -14
  460. package/ext/aastar-shared-config/sync-abis.sh +0 -92
  461. package/ext/aastar-shared-config/sync-versions.mjs +0 -150
  462. package/ext/aastar-shared-config/tsconfig.json +0 -18
  463. package/ext/aastar-shared-config/tsup.config.ts +0 -10
  464. package/ext/aastar-shared-config/verify-all.sh +0 -207
  465. package/ext/aastar-shared-config/verify-contracts.sh +0 -85
  466. package/ext/aastar-shared-config/verify-mysbt-v243.mjs +0 -27
  467. package/ext/aastar-shared-config/verify-onchain-versions.mjs +0 -93
  468. package/ext/permissionless.js/.changeset/README.md +0 -8
  469. package/ext/permissionless.js/.changeset/config.json +0 -11
  470. package/ext/permissionless.js/.env-example +0 -2
  471. package/ext/permissionless.js/.github/actions/install-dependencies/action.yml +0 -17
  472. package/ext/permissionless.js/.github/dependabot.yaml +0 -10
  473. package/ext/permissionless.js/.github/workflows/canary.yml +0 -49
  474. package/ext/permissionless.js/.github/workflows/on-pull-request.yml +0 -61
  475. package/ext/permissionless.js/.github/workflows/on-push-to-main.yml +0 -59
  476. package/ext/permissionless.js/.github/workflows/prune-tags.yml +0 -92
  477. package/ext/permissionless.js/.github/workflows/verify.yml +0 -114
  478. package/ext/permissionless.js/.size-limit.json +0 -13
  479. package/ext/permissionless.js/LICENSE +0 -21
  480. package/ext/permissionless.js/assets/banner.png +0 -0
  481. package/ext/permissionless.js/biome.json +0 -46
  482. package/ext/permissionless.js/bun.lock +0 -2340
  483. package/ext/permissionless.js/bun.lockb +0 -0
  484. package/ext/permissionless.js/package.json +0 -82
  485. package/ext/permissionless.js/packages/mock-paymaster/CHANGELOG.md +0 -31
  486. package/ext/permissionless.js/packages/mock-paymaster/constants.ts +0 -84
  487. package/ext/permissionless.js/packages/mock-paymaster/helpers/abi.ts +0 -1048
  488. package/ext/permissionless.js/packages/mock-paymaster/helpers/erc20-utils.ts +0 -105
  489. package/ext/permissionless.js/packages/mock-paymaster/helpers/schema.ts +0 -307
  490. package/ext/permissionless.js/packages/mock-paymaster/helpers/utils.ts +0 -78
  491. package/ext/permissionless.js/packages/mock-paymaster/index.ts +0 -63
  492. package/ext/permissionless.js/packages/mock-paymaster/package.json +0 -33
  493. package/ext/permissionless.js/packages/mock-paymaster/relay.ts +0 -424
  494. package/ext/permissionless.js/packages/mock-paymaster/setup.ts +0 -163
  495. package/ext/permissionless.js/packages/mock-paymaster/singletonPaymasters.ts +0 -230
  496. package/ext/permissionless.js/packages/permissionless/CHANGELOG.md +0 -893
  497. package/ext/permissionless.js/packages/permissionless/README.md +0 -122
  498. package/ext/permissionless.js/packages/permissionless/accounts/biconomy/abi/BiconomySmartAccountAbi.ts +0 -128
  499. package/ext/permissionless.js/packages/permissionless/accounts/biconomy/toBiconomySmartAccount.ts +0 -374
  500. package/ext/permissionless.js/packages/permissionless/accounts/decodeCalls.test.ts +0 -505
  501. package/ext/permissionless.js/packages/permissionless/accounts/etherspot/abi/EtherspotBootstrapAbi.ts +0 -94
  502. package/ext/permissionless.js/packages/permissionless/accounts/etherspot/constants.ts +0 -27
  503. package/ext/permissionless.js/packages/permissionless/accounts/etherspot/toEtherspotSmartAccount.ts +0 -369
  504. package/ext/permissionless.js/packages/permissionless/accounts/etherspot/utils/getInitMSAData.ts +0 -56
  505. package/ext/permissionless.js/packages/permissionless/accounts/etherspot/utils/getNonceKey.ts +0 -21
  506. package/ext/permissionless.js/packages/permissionless/accounts/etherspot/utils/wrapMessageHash.ts +0 -43
  507. package/ext/permissionless.js/packages/permissionless/accounts/index.ts +0 -86
  508. package/ext/permissionless.js/packages/permissionless/accounts/kernel/abi/KernelAccountAbi.ts +0 -87
  509. package/ext/permissionless.js/packages/permissionless/accounts/kernel/abi/KernelV3AccountAbi.ts +0 -813
  510. package/ext/permissionless.js/packages/permissionless/accounts/kernel/abi/KernelV3FactoryAbi.ts +0 -12
  511. package/ext/permissionless.js/packages/permissionless/accounts/kernel/abi/KernelV3MetaFactoryAbi.ts +0 -17
  512. package/ext/permissionless.js/packages/permissionless/accounts/kernel/constants.ts +0 -14
  513. package/ext/permissionless.js/packages/permissionless/accounts/kernel/to7702KernelSmartAccount.ts +0 -63
  514. package/ext/permissionless.js/packages/permissionless/accounts/kernel/toEcdsaKernelSmartAccount.ts +0 -62
  515. package/ext/permissionless.js/packages/permissionless/accounts/kernel/toKernelSmartAccount.ts +0 -984
  516. package/ext/permissionless.js/packages/permissionless/accounts/kernel/utils/decodeCallData.ts +0 -43
  517. package/ext/permissionless.js/packages/permissionless/accounts/kernel/utils/encodeCallData.ts +0 -57
  518. package/ext/permissionless.js/packages/permissionless/accounts/kernel/utils/getNonceKey.ts +0 -33
  519. package/ext/permissionless.js/packages/permissionless/accounts/kernel/utils/isKernelV2.ts +0 -6
  520. package/ext/permissionless.js/packages/permissionless/accounts/kernel/utils/isWebAuthnAccount.ts +0 -8
  521. package/ext/permissionless.js/packages/permissionless/accounts/kernel/utils/signMessage.ts +0 -115
  522. package/ext/permissionless.js/packages/permissionless/accounts/kernel/utils/signTypedData.ts +0 -97
  523. package/ext/permissionless.js/packages/permissionless/accounts/kernel/utils/wrapMessageHash.ts +0 -44
  524. package/ext/permissionless.js/packages/permissionless/accounts/light/toLightSmartAccount.ts +0 -496
  525. package/ext/permissionless.js/packages/permissionless/accounts/nexus/toNexusSmartAccount.ts +0 -351
  526. package/ext/permissionless.js/packages/permissionless/accounts/safe/index.ts +0 -14
  527. package/ext/permissionless.js/packages/permissionless/accounts/safe/signUserOperation.test.ts +0 -275
  528. package/ext/permissionless.js/packages/permissionless/accounts/safe/signUserOperation.ts +0 -316
  529. package/ext/permissionless.js/packages/permissionless/accounts/safe/toSafeSmartAccount.ts +0 -1980
  530. package/ext/permissionless.js/packages/permissionless/accounts/simple/to7702SimpleSmartAccount.ts +0 -51
  531. package/ext/permissionless.js/packages/permissionless/accounts/simple/toSimpleSmartAccount.ts +0 -585
  532. package/ext/permissionless.js/packages/permissionless/accounts/thirdweb/toThirdwebSmartAccount.ts +0 -221
  533. package/ext/permissionless.js/packages/permissionless/accounts/thirdweb/utils/decodeCallData.ts +0 -87
  534. package/ext/permissionless.js/packages/permissionless/accounts/thirdweb/utils/encodeCallData.ts +0 -81
  535. package/ext/permissionless.js/packages/permissionless/accounts/thirdweb/utils/getAccountAddress.ts +0 -48
  536. package/ext/permissionless.js/packages/permissionless/accounts/thirdweb/utils/getFactoryData.ts +0 -40
  537. package/ext/permissionless.js/packages/permissionless/accounts/thirdweb/utils/signMessage.ts +0 -33
  538. package/ext/permissionless.js/packages/permissionless/accounts/thirdweb/utils/signTypedData.ts +0 -67
  539. package/ext/permissionless.js/packages/permissionless/accounts/trust/toTrustSmartAccount.ts +0 -232
  540. package/ext/permissionless.js/packages/permissionless/accounts/trust/utils/decodeCallData.ts +0 -87
  541. package/ext/permissionless.js/packages/permissionless/accounts/trust/utils/encodeCallData.ts +0 -81
  542. package/ext/permissionless.js/packages/permissionless/accounts/trust/utils/getFactoryData.ts +0 -51
  543. package/ext/permissionless.js/packages/permissionless/actions/erc7579/accountId.test.ts +0 -39
  544. package/ext/permissionless.js/packages/permissionless/actions/erc7579/accountId.ts +0 -93
  545. package/ext/permissionless.js/packages/permissionless/actions/erc7579/installModule.test.ts +0 -216
  546. package/ext/permissionless.js/packages/permissionless/actions/erc7579/installModule.ts +0 -99
  547. package/ext/permissionless.js/packages/permissionless/actions/erc7579/installModules.test.ts +0 -237
  548. package/ext/permissionless.js/packages/permissionless/actions/erc7579/installModules.ts +0 -96
  549. package/ext/permissionless.js/packages/permissionless/actions/erc7579/isModuleInstalled.test.ts +0 -72
  550. package/ext/permissionless.js/packages/permissionless/actions/erc7579/isModuleInstalled.ts +0 -132
  551. package/ext/permissionless.js/packages/permissionless/actions/erc7579/supportsExecutionMode.test.ts +0 -108
  552. package/ext/permissionless.js/packages/permissionless/actions/erc7579/supportsExecutionMode.ts +0 -158
  553. package/ext/permissionless.js/packages/permissionless/actions/erc7579/supportsModule.test.ts +0 -35
  554. package/ext/permissionless.js/packages/permissionless/actions/erc7579/supportsModule.ts +0 -120
  555. package/ext/permissionless.js/packages/permissionless/actions/erc7579/uninstallModule.test.ts +0 -129
  556. package/ext/permissionless.js/packages/permissionless/actions/erc7579/uninstallModule.ts +0 -98
  557. package/ext/permissionless.js/packages/permissionless/actions/erc7579/uninstallModules.test.ts +0 -117
  558. package/ext/permissionless.js/packages/permissionless/actions/erc7579/uninstallModules.ts +0 -87
  559. package/ext/permissionless.js/packages/permissionless/actions/erc7579.ts +0 -103
  560. package/ext/permissionless.js/packages/permissionless/actions/etherspot/getUserOperationGasPrice.ts +0 -32
  561. package/ext/permissionless.js/packages/permissionless/actions/etherspot.ts +0 -4
  562. package/ext/permissionless.js/packages/permissionless/actions/index.ts +0 -9
  563. package/ext/permissionless.js/packages/permissionless/actions/package.json +0 -6
  564. package/ext/permissionless.js/packages/permissionless/actions/passkeyServer/getCredentials.ts +0 -47
  565. package/ext/permissionless.js/packages/permissionless/actions/passkeyServer/startAuthentication.ts +0 -39
  566. package/ext/permissionless.js/packages/permissionless/actions/passkeyServer/startRegistration.ts +0 -126
  567. package/ext/permissionless.js/packages/permissionless/actions/passkeyServer/verifyAuthentication.ts +0 -142
  568. package/ext/permissionless.js/packages/permissionless/actions/passkeyServer/verifyRegistration.ts +0 -132
  569. package/ext/permissionless.js/packages/permissionless/actions/passkeyServer.ts +0 -17
  570. package/ext/permissionless.js/packages/permissionless/actions/pimlico/estimateErc20PaymasterCost.ts +0 -102
  571. package/ext/permissionless.js/packages/permissionless/actions/pimlico/getTokenQuotes.test.ts +0 -90
  572. package/ext/permissionless.js/packages/permissionless/actions/pimlico/getTokenQuotes.ts +0 -77
  573. package/ext/permissionless.js/packages/permissionless/actions/pimlico/getUserOperationGasPrice.test.ts +0 -82
  574. package/ext/permissionless.js/packages/permissionless/actions/pimlico/getUserOperationGasPrice.ts +0 -67
  575. package/ext/permissionless.js/packages/permissionless/actions/pimlico/getUserOperationStatus.test.ts +0 -199
  576. package/ext/permissionless.js/packages/permissionless/actions/pimlico/getUserOperationStatus.ts +0 -49
  577. package/ext/permissionless.js/packages/permissionless/actions/pimlico/sendCompressedUserOperation.ts +0 -59
  578. package/ext/permissionless.js/packages/permissionless/actions/pimlico/sponsorUserOperation.test.ts +0 -236
  579. package/ext/permissionless.js/packages/permissionless/actions/pimlico/sponsorUserOperation.ts +0 -151
  580. package/ext/permissionless.js/packages/permissionless/actions/pimlico/validateSponsorshipPolicies.test.ts +0 -153
  581. package/ext/permissionless.js/packages/permissionless/actions/pimlico/validateSponsorshipPolicies.ts +0 -74
  582. package/ext/permissionless.js/packages/permissionless/actions/pimlico.ts +0 -38
  583. package/ext/permissionless.js/packages/permissionless/actions/public/getAccountNonce.test.ts +0 -96
  584. package/ext/permissionless.js/packages/permissionless/actions/public/getAccountNonce.ts +0 -75
  585. package/ext/permissionless.js/packages/permissionless/actions/public/getSenderAddress.test.ts +0 -154
  586. package/ext/permissionless.js/packages/permissionless/actions/public/getSenderAddress.ts +0 -129
  587. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/getCallsStatus.test.ts +0 -255
  588. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/getCallsStatus.ts +0 -91
  589. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/sendCalls.test.ts +0 -571
  590. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/sendCalls.ts +0 -38
  591. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/sendTransaction.test.ts +0 -416
  592. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/sendTransaction.ts +0 -133
  593. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/signMessage.test.ts +0 -219
  594. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/signMessage.ts +0 -73
  595. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/signTypedData.test.ts +0 -228
  596. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/signTypedData.ts +0 -157
  597. package/ext/permissionless.js/packages/permissionless/actions/smartAccount/writeContract.ts +0 -70
  598. package/ext/permissionless.js/packages/permissionless/actions/smartAccount.ts +0 -7
  599. package/ext/permissionless.js/packages/permissionless/clients/createSmartAccountClient.ts +0 -181
  600. package/ext/permissionless.js/packages/permissionless/clients/decorators/passkeyServer.ts +0 -57
  601. package/ext/permissionless.js/packages/permissionless/clients/decorators/pimlico.ts +0 -189
  602. package/ext/permissionless.js/packages/permissionless/clients/decorators/smartAccount.ts +0 -350
  603. package/ext/permissionless.js/packages/permissionless/clients/index.ts +0 -2
  604. package/ext/permissionless.js/packages/permissionless/clients/passkeyServer.ts +0 -69
  605. package/ext/permissionless.js/packages/permissionless/clients/pimlico.ts +0 -124
  606. package/ext/permissionless.js/packages/permissionless/errors/index.ts +0 -17
  607. package/ext/permissionless.js/packages/permissionless/experimental/pimlico/index.ts +0 -1
  608. package/ext/permissionless.js/packages/permissionless/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.test.ts +0 -523
  609. package/ext/permissionless.js/packages/permissionless/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts +0 -369
  610. package/ext/permissionless.js/packages/permissionless/index.ts +0 -3
  611. package/ext/permissionless.js/packages/permissionless/package.json +0 -102
  612. package/ext/permissionless.js/packages/permissionless/types/etherspot.ts +0 -12
  613. package/ext/permissionless.js/packages/permissionless/types/package.json +0 -6
  614. package/ext/permissionless.js/packages/permissionless/types/passkeyServer.ts +0 -125
  615. package/ext/permissionless.js/packages/permissionless/types/pimlico.ts +0 -151
  616. package/ext/permissionless.js/packages/permissionless/utils/decode7579Calls.ts +0 -133
  617. package/ext/permissionless.js/packages/permissionless/utils/decodeNonce.test.ts +0 -40
  618. package/ext/permissionless.js/packages/permissionless/utils/decodeNonce.ts +0 -10
  619. package/ext/permissionless.js/packages/permissionless/utils/deepHexlify.test.ts +0 -57
  620. package/ext/permissionless.js/packages/permissionless/utils/deepHexlify.ts +0 -35
  621. package/ext/permissionless.js/packages/permissionless/utils/encode7579Calls.test.ts +0 -69
  622. package/ext/permissionless.js/packages/permissionless/utils/encode7579Calls.ts +0 -114
  623. package/ext/permissionless.js/packages/permissionless/utils/encodeInstallModule.ts +0 -91
  624. package/ext/permissionless.js/packages/permissionless/utils/encodeNonce.test.ts +0 -38
  625. package/ext/permissionless.js/packages/permissionless/utils/encodeNonce.ts +0 -8
  626. package/ext/permissionless.js/packages/permissionless/utils/encodeUninstallModule.ts +0 -88
  627. package/ext/permissionless.js/packages/permissionless/utils/erc20AllowanceOverride.test.ts +0 -59
  628. package/ext/permissionless.js/packages/permissionless/utils/erc20AllowanceOverride.ts +0 -66
  629. package/ext/permissionless.js/packages/permissionless/utils/erc20BalanceOverride.test.ts +0 -57
  630. package/ext/permissionless.js/packages/permissionless/utils/erc20BalanceOverride.ts +0 -49
  631. package/ext/permissionless.js/packages/permissionless/utils/getAddressFromInitCodeOrPaymasterAndData.test.ts +0 -31
  632. package/ext/permissionless.js/packages/permissionless/utils/getAddressFromInitCodeOrPaymasterAndData.ts +0 -13
  633. package/ext/permissionless.js/packages/permissionless/utils/getEstimationCallData.ts +0 -297
  634. package/ext/permissionless.js/packages/permissionless/utils/getPackedUserOperation.test.ts +0 -204
  635. package/ext/permissionless.js/packages/permissionless/utils/getPackedUserOperation.ts +0 -122
  636. package/ext/permissionless.js/packages/permissionless/utils/getRequiredPrefund.test.ts +0 -90
  637. package/ext/permissionless.js/packages/permissionless/utils/getRequiredPrefund.ts +0 -56
  638. package/ext/permissionless.js/packages/permissionless/utils/index.ts +0 -43
  639. package/ext/permissionless.js/packages/permissionless/utils/isSmartAccountDeployed.ts +0 -13
  640. package/ext/permissionless.js/packages/permissionless/utils/ox.ts +0 -48
  641. package/ext/permissionless.js/packages/permissionless/utils/toOwner.ts +0 -89
  642. package/ext/permissionless.js/packages/permissionless/vitest.config.ts +0 -31
  643. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/biconomy.ts +0 -22
  644. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/etherspot.ts +0 -12
  645. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/kernel.ts +0 -63
  646. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/light.ts +0 -10
  647. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/nexus.ts +0 -16
  648. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/safe.ts +0 -75
  649. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/simple.ts +0 -16
  650. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/thirdweb.ts +0 -7
  651. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/accounts/trust.ts +0 -26
  652. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/core.ts +0 -24
  653. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/constants/index.ts +0 -10
  654. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/index.ts +0 -783
  655. package/ext/permissionless.js/packages/permissionless-test/mock-aa-infra/alto/instance.ts +0 -290
  656. package/ext/permissionless.js/packages/permissionless-test/src/testWithRpc.ts +0 -128
  657. package/ext/permissionless.js/packages/permissionless-test/src/types.ts +0 -12
  658. package/ext/permissionless.js/packages/permissionless-test/src/utils.ts +0 -1091
  659. package/ext/permissionless.js/packages/wagmi/CHANGELOG.md +0 -53
  660. package/ext/permissionless.js/packages/wagmi/README.md +0 -93
  661. package/ext/permissionless.js/packages/wagmi/context.ts +0 -22
  662. package/ext/permissionless.js/packages/wagmi/hooks/useAvailableCapabilities.ts +0 -43
  663. package/ext/permissionless.js/packages/wagmi/hooks/useSendTransaction.ts +0 -164
  664. package/ext/permissionless.js/packages/wagmi/hooks/useWaitForTransactionReceipt.ts +0 -427
  665. package/ext/permissionless.js/packages/wagmi/index.ts +0 -15
  666. package/ext/permissionless.js/packages/wagmi/package.json +0 -26
  667. package/ext/permissionless.js/packages/wagmi/utils/observe.ts +0 -76
  668. package/ext/permissionless.js/packages/wagmi-demo/README.md +0 -1
  669. package/ext/permissionless.js/packages/wagmi-demo/biome.json +0 -13
  670. package/ext/permissionless.js/packages/wagmi-demo/index.html +0 -12
  671. package/ext/permissionless.js/packages/wagmi-demo/package.json +0 -16
  672. package/ext/permissionless.js/packages/wagmi-demo/src/App.tsx +0 -98
  673. package/ext/permissionless.js/packages/wagmi-demo/src/PasskeyServerDemo.tsx +0 -286
  674. package/ext/permissionless.js/packages/wagmi-demo/src/PasskeysDemo.tsx +0 -457
  675. package/ext/permissionless.js/packages/wagmi-demo/src/index.css +0 -21
  676. package/ext/permissionless.js/packages/wagmi-demo/src/main.tsx +0 -275
  677. package/ext/permissionless.js/packages/wagmi-demo/src/vite-env.d.ts +0 -1
  678. package/ext/permissionless.js/packages/wagmi-demo/src/wagmi.ts +0 -33
  679. package/ext/permissionless.js/packages/wagmi-demo/tsconfig.json +0 -25
  680. package/ext/permissionless.js/packages/wagmi-demo/tsconfig.node.json +0 -12
  681. package/ext/permissionless.js/packages/wagmi-demo/vite.config.ts +0 -7
  682. package/ext/permissionless.js/tsconfig/tsconfig.base.json +0 -42
  683. package/ext/permissionless.js/tsconfig/tsconfig.mock-paymaster.cjs.json +0 -11
  684. package/ext/permissionless.js/tsconfig/tsconfig.mock-paymaster.esm.json +0 -9
  685. package/ext/permissionless.js/tsconfig/tsconfig.mock-paymaster.json +0 -17
  686. package/ext/permissionless.js/tsconfig/tsconfig.mock-paymaster.types.json +0 -13
  687. package/ext/permissionless.js/tsconfig/tsconfig.permissionless.cjs.json +0 -11
  688. package/ext/permissionless.js/tsconfig/tsconfig.permissionless.esm.json +0 -9
  689. package/ext/permissionless.js/tsconfig/tsconfig.permissionless.json +0 -18
  690. package/ext/permissionless.js/tsconfig/tsconfig.permissionless.types.json +0 -13
  691. package/ext/permissionless.js/tsconfig/tsconfig.wagmi.esm.json +0 -8
  692. package/ext/permissionless.js/tsconfig/tsconfig.wagmi.json +0 -19
  693. package/ext/permissionless.js/tsconfig/tsconfig.wagmi.types.json +0 -12
  694. package/extract_abis.sh +0 -140
  695. package/extract_addresses_to_env.sh +0 -67
  696. package/final_safe_harmonize.py +0 -77
  697. package/lib/SHARED_CONFIG_REFERENCE.md +0 -133
  698. package/lib/shared-config/.env.example +0 -6
  699. package/lib/shared-config/.github/workflows/check-secrets.yml +0 -257
  700. package/lib/shared-config/AGENTS.md +0 -21
  701. package/lib/shared-config/CHANGELOG.md +0 -99
  702. package/lib/shared-config/LICENSE +0 -21
  703. package/lib/shared-config/QUICK_START.md +0 -215
  704. package/lib/shared-config/README.md +0 -412
  705. package/lib/shared-config/SHARED_CONFIG_SUMMARY.md +0 -273
  706. package/lib/shared-config/check-locker-status.mjs +0 -7
  707. package/lib/shared-config/favicon.ico +0 -0
  708. package/lib/shared-config/generate-comparison-table.sh +0 -67
  709. package/lib/shared-config/package.json +0 -46
  710. package/lib/shared-config/pnpm-lock.yaml +0 -1182
  711. package/lib/shared-config/src/abis/BLSAggregator.json +0 -1
  712. package/lib/shared-config/src/abis/DVTValidator.json +0 -1
  713. package/lib/shared-config/src/abis/GToken.json +0 -1
  714. package/lib/shared-config/src/abis/GTokenStaking.json +0 -1
  715. package/lib/shared-config/src/abis/MySBT.json +0 -1
  716. package/lib/shared-config/src/abis/PaymasterFactory.json +0 -1
  717. package/lib/shared-config/src/abis/PaymasterV4.json +0 -1098
  718. package/lib/shared-config/src/abis/Registry.json +0 -1
  719. package/lib/shared-config/src/abis/SimpleAccount.json +0 -557
  720. package/lib/shared-config/src/abis/SimpleAccountFactory.json +0 -87
  721. package/lib/shared-config/src/abis/SuperPaymasterV2.json +0 -1
  722. package/lib/shared-config/src/abis/index.ts +0 -45
  723. package/lib/shared-config/src/abis/xPNTsFactory.json +0 -1
  724. package/lib/shared-config/src/abis/xPNTsToken.json +0 -1
  725. package/lib/shared-config/src/branding.ts +0 -32
  726. package/lib/shared-config/src/communities.ts +0 -93
  727. package/lib/shared-config/src/constants.ts +0 -67
  728. package/lib/shared-config/src/contract-addresses.ts +0 -95
  729. package/lib/shared-config/src/contract-versions.ts +0 -374
  730. package/lib/shared-config/src/contracts.ts +0 -414
  731. package/lib/shared-config/src/index.ts +0 -14
  732. package/lib/shared-config/src/networks.ts +0 -117
  733. package/lib/shared-config/sync-abis.sh +0 -92
  734. package/lib/shared-config/sync-versions.mjs +0 -150
  735. package/lib/shared-config/tsconfig.json +0 -18
  736. package/lib/shared-config/tsup.config.ts +0 -10
  737. package/lib/shared-config/verify-all.sh +0 -207
  738. package/lib/shared-config/verify-contracts.sh +0 -85
  739. package/lib/shared-config/verify-mysbt-v243.mjs +0 -27
  740. package/lib/shared-config/verify-onchain-versions.mjs +0 -93
  741. package/packages/account/package.json +0 -20
  742. package/packages/account/src/eoa.ts +0 -31
  743. package/packages/account/src/index.ts +0 -61
  744. package/packages/account/tsconfig.json +0 -12
  745. package/packages/analytics/package.json +0 -21
  746. package/packages/analytics/src/index.ts +0 -145
  747. package/packages/analytics/tsconfig.json +0 -16
  748. package/packages/community/package.json +0 -22
  749. package/packages/community/src/index.ts +0 -306
  750. package/packages/community/tsconfig.json +0 -8
  751. package/packages/core/package.json +0 -22
  752. package/packages/core/src/abis/BLSAggregator.json +0 -572
  753. package/packages/core/src/abis/BLSValidator.json +0 -26
  754. package/packages/core/src/abis/DVTValidator.json +0 -370
  755. package/packages/core/src/abis/Eip7702Support.json +0 -24
  756. package/packages/core/src/abis/EntryPoint.json +0 -1379
  757. package/packages/core/src/abis/GToken.json +0 -523
  758. package/packages/core/src/abis/GTokenStaking.json +0 -931
  759. package/packages/core/src/abis/LegacyAccount.json +0 -625
  760. package/packages/core/src/abis/MySBT.json +0 -1586
  761. package/packages/core/src/abis/Paymaster.json +0 -1205
  762. package/packages/core/src/abis/PaymasterFactory.json +0 -650
  763. package/packages/core/src/abis/PaymasterV4_2.json +0 -1183
  764. package/packages/core/src/abis/Registry.json +0 -1636
  765. package/packages/core/src/abis/ReputationSystem.json +0 -477
  766. package/packages/core/src/abis/SenderCreator.json +0 -99
  767. package/packages/core/src/abis/Simple7702Account.json +0 -395
  768. package/packages/core/src/abis/SimpleAccount.json +0 -625
  769. package/packages/core/src/abis/SimpleAccountFactory.json +0 -108
  770. package/packages/core/src/abis/SimpleAccountFactoryV08.json +0 -87
  771. package/packages/core/src/abis/SimpleAccountV08.json +0 -557
  772. package/packages/core/src/abis/SuperPaymaster.json +0 -1399
  773. package/packages/core/src/abis/UserOperationLib.json +0 -57
  774. package/packages/core/src/abis/aPNTs.json +0 -1173
  775. package/packages/core/src/abis/index.ts +0 -68
  776. package/packages/core/src/abis/xPNTsFactory.json +0 -728
  777. package/packages/core/src/abis/xPNTsToken.json +0 -1173
  778. package/packages/core/src/actions/aggregator.ts +0 -41
  779. package/packages/core/src/actions/dvt.ts +0 -53
  780. package/packages/core/src/actions/factory.ts +0 -41
  781. package/packages/core/src/actions/paymasterV4.ts +0 -263
  782. package/packages/core/src/actions/registry.ts +0 -120
  783. package/packages/core/src/actions/reputation.ts +0 -27
  784. package/packages/core/src/actions/sbt.ts +0 -97
  785. package/packages/core/src/actions/staking.ts +0 -79
  786. package/packages/core/src/actions/superPaymaster.ts +0 -117
  787. package/packages/core/src/actions/tokens.ts +0 -65
  788. package/packages/core/src/branding.ts +0 -32
  789. package/packages/core/src/clients.ts +0 -13
  790. package/packages/core/src/communities.ts +0 -93
  791. package/packages/core/src/constants.ts +0 -81
  792. package/packages/core/src/contract-addresses.ts +0 -101
  793. package/packages/core/src/contract-versions.ts +0 -374
  794. package/packages/core/src/contracts.ts +0 -414
  795. package/packages/core/src/networks.ts +0 -127
  796. package/packages/core/src/roles.ts +0 -244
  797. package/packages/core/src/utils.ts +0 -23
  798. package/packages/core/tsconfig.json +0 -12
  799. package/packages/dapp/package.json +0 -27
  800. package/packages/dapp/src/ui/components/EvaluationPanel.tsx +0 -40
  801. package/packages/dapp/tsconfig.json +0 -13
  802. package/packages/enduser/package.json +0 -21
  803. package/packages/enduser/src/index.ts +0 -138
  804. package/packages/enduser/tsconfig.json +0 -8
  805. package/packages/identity/package.json +0 -22
  806. package/packages/identity/src/index.ts +0 -82
  807. package/packages/identity/tsconfig.json +0 -12
  808. package/packages/operator/package.json +0 -21
  809. package/packages/operator/src/index.ts +0 -172
  810. package/packages/operator/tsconfig.json +0 -8
  811. package/packages/paymaster/package.json +0 -22
  812. package/packages/paymaster/src/V4/index.ts +0 -123
  813. package/packages/paymaster/tsconfig.json +0 -12
  814. package/packages/sdk/README.md +0 -150
  815. package/packages/sdk/aastar/package.json +0 -21
  816. package/packages/sdk/aastar/src/index.ts +0 -3
  817. package/packages/sdk/aastar/tsconfig.json +0 -8
  818. package/packages/sdk/package.json +0 -32
  819. package/packages/sdk/src/clients/admin.ts +0 -54
  820. package/packages/sdk/src/clients/community.ts +0 -403
  821. package/packages/sdk/src/clients/endUser.ts +0 -173
  822. package/packages/sdk/src/clients/operator.ts +0 -277
  823. package/packages/sdk/src/errors/decoder.ts +0 -48
  824. package/packages/sdk/src/index.ts +0 -20
  825. package/packages/sdk/src/utils/validation.ts +0 -356
  826. package/packages/sdk/tsconfig.json +0 -12
  827. package/packages/tokens/package.json +0 -22
  828. package/packages/tokens/src/index.ts +0 -245
  829. package/packages/tokens/tsconfig.json +0 -12
  830. package/pnpm-workspace.yaml +0 -2
  831. package/run_full_regression.sh +0 -215
  832. package/run_sdk_regression.sh +0 -213
  833. package/safe_harmonize.py +0 -107
  834. package/scripts/00_utils.ts +0 -59
  835. package/scripts/00_verify_phase1.ts +0 -130
  836. package/scripts/01_1_prep_gtoken.ts +0 -81
  837. package/scripts/01_2_register_sbt.ts +0 -88
  838. package/scripts/01_3_prep_tokens_paymaster.ts +0 -102
  839. package/scripts/01_prepare_all.ts +0 -271
  840. package/scripts/02_test_eoa.ts +0 -50
  841. package/scripts/03_test_standard_aa.ts +0 -173
  842. package/scripts/04_0_check_deploy.ts +0 -24
  843. package/scripts/04_1_check_allowance.ts +0 -44
  844. package/scripts/04_2_construct_verify.ts +0 -96
  845. package/scripts/04_3_verify_estimate.ts +0 -66
  846. package/scripts/04_4_verify_pack.ts +0 -74
  847. package/scripts/04_test_paymaster_v4.ts +0 -217
  848. package/scripts/05_1_deposit.ts +0 -48
  849. package/scripts/05_test_superpaymaster.ts +0 -380
  850. package/scripts/06_local_test_v3_admin.ts +0 -163
  851. package/scripts/06_local_test_v3_execution.ts +0 -132
  852. package/scripts/06_local_test_v3_full.ts +0 -490
  853. package/scripts/06_local_test_v3_funding.ts +0 -124
  854. package/scripts/06_local_test_v3_reputation.ts +0 -234
  855. package/scripts/07_local_test_v3_audit.ts +0 -181
  856. package/scripts/08_local_test_registry_lifecycle.ts +0 -382
  857. package/scripts/09_local_test_community_lifecycle.ts +0 -384
  858. package/scripts/09_local_test_community_simple.ts +0 -108
  859. package/scripts/09_scenario_bread_independent.ts +0 -247
  860. package/scripts/10_scenario_super_shared.ts +0 -196
  861. package/scripts/10_test_protocol_admin_full.ts +0 -173
  862. package/scripts/11_scenario_hacker_defense.ts +0 -104
  863. package/scripts/11_test_core_flows_full.ts +0 -279
  864. package/scripts/12_test_slash_mechanism.ts +0 -205
  865. package/scripts/12_test_slash_queries.ts +0 -83
  866. package/scripts/12_test_staking_exit.ts +0 -152
  867. package/scripts/12_test_staking_slash.ts +0 -301
  868. package/scripts/12_test_tier2_slash.ts +0 -139
  869. package/scripts/13_test_sbt_burn_linkage.ts +0 -266
  870. package/scripts/14_test_credit_redesign.ts +0 -266
  871. package/scripts/15_test_bls_full.ts +0 -125
  872. package/scripts/15_test_dvt_bls_full.ts +0 -133
  873. package/scripts/17_test_cross_role_collaboration.ts +0 -95
  874. package/scripts/18_sdk_e2e_verification.ts +0 -67
  875. package/scripts/18_test_dvt_sdk_flow.ts +0 -138
  876. package/scripts/18_test_lifecycle_completion.ts +0 -144
  877. package/scripts/19_sdk_experiment_runner.ts +0 -89
  878. package/scripts/19_sdk_experiment_runner.ts.backup +0 -391
  879. package/scripts/20_sdk_full_capability.ts +0 -95
  880. package/scripts/20_test_superpaymaster_new_apis.ts +0 -193
  881. package/scripts/21_test_paymasterv4_complete.ts +0 -341
  882. package/scripts/22_test_bls_signing.ts +0 -260
  883. package/scripts/23_test_middleware.ts +0 -197
  884. package/scripts/98_edge_reentrancy.ts +0 -85
  885. package/scripts/99_bug_hunting_fast.ts +0 -216
  886. package/scripts/collect_industry_baseline.ts +0 -236
  887. package/scripts/complete_env_config.ts +0 -97
  888. package/scripts/debug_account_c.ts +0 -43
  889. package/scripts/debug_bls.ts +0 -58
  890. package/scripts/debug_config_v036.ts +0 -13
  891. package/scripts/debug_contracts.ts +0 -2
  892. package/scripts/debug_env.ts +0 -69
  893. package/scripts/debug_find_paymaster.ts +0 -98
  894. package/scripts/debug_isolated_registration.ts +0 -256
  895. package/scripts/debug_paymaster_config.ts +0 -19
  896. package/scripts/debug_pim_addr.ts +0 -23
  897. package/scripts/debug_pm_status.ts +0 -51
  898. package/scripts/debug_registry.ts +0 -39
  899. package/scripts/debug_registry_setup.ts +0 -129
  900. package/scripts/debug_sanity.ts +0 -32
  901. package/scripts/debug_shared_config.ts +0 -10
  902. package/scripts/debug_token_compat.ts +0 -51
  903. package/scripts/debug_tokens.ts +0 -41
  904. package/scripts/debug_vcheck.ts +0 -33
  905. package/scripts/deploy_and_init_v3.sh +0 -134
  906. package/scripts/deploy_anvil_accounts.ts +0 -144
  907. package/scripts/deploy_paymaster_v4.ts +0 -139
  908. package/scripts/deploy_test_accounts.ts +0 -401
  909. package/scripts/experiment/stage3/SETUP_GUIDE.md +0 -258
  910. package/scripts/experiment/stage3/archived_scripts/00_token_distribution.ts +0 -78
  911. package/scripts/experiment/stage3/archived_scripts/01_dao_launch.ts +0 -96
  912. package/scripts/experiment/stage3/archived_scripts/01b_bread_launch.ts +0 -112
  913. package/scripts/experiment/stage3/archived_scripts/02_operator_setup.ts +0 -84
  914. package/scripts/experiment/stage3/archived_scripts/02b_operator_b_setup.ts +0 -104
  915. package/scripts/experiment/stage3/archived_scripts/02c_finalize_operators.ts +0 -86
  916. package/scripts/experiment/stage3/archived_scripts/02d_operator_collateral.ts +0 -89
  917. package/scripts/experiment/stage3/archived_scripts/03_user_onboarding.ts +0 -83
  918. package/scripts/experiment/stage3/archived_scripts/03b_deploy_aa_account.ts +0 -61
  919. package/scripts/experiment/stage3/archived_scripts/03c_aa_onboarding.ts +0 -104
  920. package/scripts/experiment/stage3/archived_scripts/03d_mint_points.ts +0 -60
  921. package/scripts/experiment/stage3/archived_scripts/04_benchmarking.ts +0 -100
  922. package/scripts/experiment/stage3/archived_scripts/05_multi_op_setup.ts +0 -149
  923. package/scripts/experiment/stage3/archived_scripts/README.md +0 -58
  924. package/scripts/experiment/stage3/archived_scripts/check_roles.ts +0 -29
  925. package/scripts/experiment/stage3/archived_scripts/decode_error.ts +0 -23
  926. package/scripts/experiment/stage3/archived_scripts/fund_user.ts +0 -51
  927. package/scripts/experiment/stage3/archived_scripts/gen_b_key.ts +0 -3
  928. package/scripts/experiment/stage3/archived_scripts/gen_keys.ts +0 -4
  929. package/scripts/experiment/stage3/archived_scripts/setup.ts +0 -105
  930. package/scripts/experiment/stage3/archived_scripts/test_key.ts +0 -4
  931. package/scripts/experiment/stage3/archived_scripts/verify_state.ts +0 -59
  932. package/scripts/experiment/stage3/refactored/00_token_distribution.ts +0 -46
  933. package/scripts/experiment/stage3/refactored/02_operator_setup.ts +0 -65
  934. package/scripts/experiment/stage3/refactored/03_user_onboarding.ts +0 -68
  935. package/scripts/experiment/stage3/refactored/05_multi_op_setup.ts +0 -63
  936. package/scripts/experiment/stage3/refactored/README.md +0 -71
  937. package/scripts/extract-docs.sh +0 -72
  938. package/scripts/generate_env_from_deployment.ts +0 -109
  939. package/scripts/publish_all.sh +0 -39
  940. package/scripts/quick_setup.ts +0 -124
  941. package/scripts/run_automated_experiment.sh +0 -121
  942. package/scripts/run_daily_experiment.ts +0 -70
  943. package/scripts/security_audit.sh +0 -172
  944. package/scripts/sync_config_to_env.ts +0 -88
  945. package/scripts/test_groups.ts +0 -267
  946. package/scripts/test_multi_community_anvil.ts +0 -276
  947. package/scripts/test_new_sdk_apis_sepolia.ts +0 -115
  948. package/scripts/test_sdk_join_idempotent.ts +0 -233
  949. package/scripts/test_simple_sepolia.ts +0 -44
  950. package/scripts/v2_regression/README.md +0 -161
  951. package/scripts/validate_environment.ts +0 -140
  952. package/sdk_experiment_data.csv +0 -2
  953. package/surgical_harmonize.py +0 -83
  954. package/tsconfig.json +0 -15
  955. package/typedoc.json +0 -25
  956. /package/{packages/core/src/crypto/index.ts → dist/core/src/crypto/index.d.ts} +0 -0
  957. /package/{packages/sdk/examples → examples}/config.json +0 -0
  958. /package/{packages/sdk/examples → examples}/regression_test.ts +0 -0
@@ -1,2720 +0,0 @@
1
- > **registryActions**(`address`): (`client`) => [`RegistryActions`](../type-aliases/RegistryActions.md)
2
-
3
- Defined in: [packages/core/src/actions/registry.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/de58973e339aee27579a805788c7048e2d9099f3/packages/core/src/actions/registry.ts#L30)
4
-
5
- ## Parameters
6
-
7
- ### address
8
-
9
- `` `0x${string}` ``
10
-
11
- ## Returns
12
-
13
- > (`client`): [`RegistryActions`](../type-aliases/RegistryActions.md)
14
-
15
- ### Parameters
16
-
17
- #### client
18
-
19
- \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<readonly \[\{ `Method`: `"eth_getFilterChanges"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: ...[] \| ...[]; \}, \{ `Method`: `"eth_getFilterLogs"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: [`RpcLog`](https://viem.sh/docs/index.html)[]; \}, \{ `Method`: `"eth_uninstallFilter"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: `boolean`; \}\]\>; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<readonly \[\{ `Method`: `"eth_getFilterChanges"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: ...[] \| ...[]; \}, \{ `Method`: `"eth_getFilterLogs"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: [`RpcLog`](https://viem.sh/docs/index.html)[]; \}, \{ `Method`: `"eth_uninstallFilter"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: `boolean`; \}\]\>; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\<Extract\<(...), (...)\> & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\<request, "kzg"\>))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \}
20
-
21
- ##### account
22
-
23
- `undefined`
24
-
25
- The Account of the Client.
26
-
27
- ##### batch?
28
-
29
- \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}
30
-
31
- Flags for batch settings.
32
-
33
- ##### batch.multicall?
34
-
35
- `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}
36
-
37
- Toggle to enable `eth_call` multicall aggregation.
38
-
39
- ##### cacheTime
40
-
41
- `number`
42
-
43
- Time (in ms) that cached data will remain in memory.
44
-
45
- ##### call
46
-
47
- (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>
48
-
49
- Executes a new message call immediately without submitting a transaction to the network.
50
-
51
- - Docs: https://viem.sh/docs/actions/public/call
52
- - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call)
53
-
54
- **Example**
55
-
56
- ```ts
57
- import { createPublicClient, http } from 'viem'
58
- import { mainnet } from 'viem/chains'
59
-
60
- const client = createPublicClient({
61
- chain: mainnet,
62
- transport: http(),
63
- })
64
- const data = await client.call({
65
- account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
66
- data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
67
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
68
- })
69
- ```
70
-
71
- ##### ccipRead?
72
-
73
- `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}
74
-
75
- [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration.
76
-
77
- ##### chain
78
-
79
- [`Chain`](https://viem.sh/docs/index.html) \| `undefined`
80
-
81
- Chain for the client.
82
-
83
- ##### createAccessList
84
-
85
- (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>
86
-
87
- Creates an EIP-2930 access list that you can include in a transaction.
88
-
89
- - Docs: https://viem.sh/docs/actions/public/createAccessList
90
- - JSON-RPC Methods: `eth_createAccessList`
91
-
92
- **Example**
93
-
94
- ```ts
95
- import { createPublicClient, http } from 'viem'
96
- import { mainnet } from 'viem/chains'
97
-
98
- const client = createPublicClient({
99
- chain: mainnet,
100
- transport: http(),
101
- })
102
-
103
- const data = await client.createAccessList({
104
- data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
105
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
106
- })
107
- ```
108
-
109
- ##### createBlockFilter
110
-
111
- () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<readonly \[\{ `Method`: `"eth_getFilterChanges"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: ...[] \| ...[]; \}, \{ `Method`: `"eth_getFilterLogs"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: [`RpcLog`](https://viem.sh/docs/index.html)[]; \}, \{ `Method`: `"eth_uninstallFilter"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: `boolean`; \}\]\>; `type`: `"block"`; \}\>
112
-
113
- Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
114
-
115
- - Docs: https://viem.sh/docs/actions/public/createBlockFilter
116
- - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)
117
-
118
- **Example**
119
-
120
- ```ts
121
- import { createPublicClient, createBlockFilter, http } from 'viem'
122
- import { mainnet } from 'viem/chains'
123
-
124
- const client = createPublicClient({
125
- chain: mainnet,
126
- transport: http(),
127
- })
128
- const filter = await createBlockFilter(client)
129
- // { id: "0x345a6572337856574a76364e457a4366", type: 'block' }
130
- ```
131
-
132
- ##### createContractEventFilter
133
-
134
- \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>
135
-
136
- Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs).
137
-
138
- - Docs: https://viem.sh/docs/contract/createContractEventFilter
139
-
140
- **Example**
141
-
142
- ```ts
143
- import { createPublicClient, http, parseAbi } from 'viem'
144
- import { mainnet } from 'viem/chains'
145
-
146
- const client = createPublicClient({
147
- chain: mainnet,
148
- transport: http(),
149
- })
150
- const filter = await client.createContractEventFilter({
151
- abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
152
- })
153
- ```
154
-
155
- ##### createEventFilter
156
-
157
- \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>
158
-
159
- Creates a [`Filter`](https://viem.sh/docs/glossary/types#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
160
-
161
- - Docs: https://viem.sh/docs/actions/public/createEventFilter
162
- - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
163
-
164
- **Example**
165
-
166
- ```ts
167
- import { createPublicClient, http } from 'viem'
168
- import { mainnet } from 'viem/chains'
169
-
170
- const client = createPublicClient({
171
- chain: mainnet,
172
- transport: http(),
173
- })
174
- const filter = await client.createEventFilter({
175
- address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',
176
- })
177
- ```
178
-
179
- ##### createPendingTransactionFilter
180
-
181
- () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<readonly \[\{ `Method`: `"eth_getFilterChanges"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: ...[] \| ...[]; \}, \{ `Method`: `"eth_getFilterLogs"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: [`RpcLog`](https://viem.sh/docs/index.html)[]; \}, \{ `Method`: `"eth_uninstallFilter"`; `Parameters`: \[`` `0x${(...)}` ``\]; `ReturnType`: `boolean`; \}\]\>; `type`: `"transaction"`; \}\>
182
-
183
- Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
184
-
185
- - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter
186
- - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
187
-
188
- **Example**
189
-
190
- ```ts
191
- import { createPublicClient, http } from 'viem'
192
- import { mainnet } from 'viem/chains'
193
-
194
- const client = createPublicClient({
195
- chain: mainnet,
196
- transport: http(),
197
- })
198
- const filter = await client.createPendingTransactionFilter()
199
- // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' }
200
- ```
201
-
202
- ##### estimateContractGas
203
-
204
- \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>
205
-
206
- Estimates the gas required to successfully execute a contract write function call.
207
-
208
- - Docs: https://viem.sh/docs/contract/estimateContractGas
209
-
210
- **Remarks**
211
-
212
- Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
213
-
214
- **Example**
215
-
216
- ```ts
217
- import { createPublicClient, http, parseAbi } from 'viem'
218
- import { mainnet } from 'viem/chains'
219
-
220
- const client = createPublicClient({
221
- chain: mainnet,
222
- transport: http(),
223
- })
224
- const gas = await client.estimateContractGas({
225
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
226
- abi: parseAbi(['function mint() public']),
227
- functionName: 'mint',
228
- account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
229
- })
230
- ```
231
-
232
- ##### estimateFeesPerGas
233
-
234
- \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>
235
-
236
- Returns an estimate for the fees per gas for a transaction to be included
237
- in the next block.
238
-
239
- - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas
240
-
241
- **Example**
242
-
243
- ```ts
244
- import { createPublicClient, http } from 'viem'
245
- import { mainnet } from 'viem/chains'
246
-
247
- const client = createPublicClient({
248
- chain: mainnet,
249
- transport: http(),
250
- })
251
- const maxPriorityFeePerGas = await client.estimateFeesPerGas()
252
- // { maxFeePerGas: ..., maxPriorityFeePerGas: ... }
253
- ```
254
-
255
- ##### estimateGas
256
-
257
- (`args`) => `Promise`\<`bigint`\>
258
-
259
- Estimates the gas necessary to complete a transaction without submitting it to the network.
260
-
261
- - Docs: https://viem.sh/docs/actions/public/estimateGas
262
- - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)
263
-
264
- **Example**
265
-
266
- ```ts
267
- import { createPublicClient, http, parseEther } from 'viem'
268
- import { mainnet } from 'viem/chains'
269
-
270
- const client = createPublicClient({
271
- chain: mainnet,
272
- transport: http(),
273
- })
274
- const gasEstimate = await client.estimateGas({
275
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
276
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
277
- value: parseEther('1'),
278
- })
279
- ```
280
-
281
- ##### estimateMaxPriorityFeePerGas
282
-
283
- \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>
284
-
285
- Returns an estimate for the max priority fee per gas (in wei) for a transaction
286
- to be included in the next block.
287
-
288
- - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas
289
-
290
- **Example**
291
-
292
- ```ts
293
- import { createPublicClient, http } from 'viem'
294
- import { mainnet } from 'viem/chains'
295
-
296
- const client = createPublicClient({
297
- chain: mainnet,
298
- transport: http(),
299
- })
300
- const maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas()
301
- // 10000000n
302
- ```
303
-
304
- ##### experimental_blockTag?
305
-
306
- [`BlockTag`](https://viem.sh/docs/index.html)
307
-
308
- Default block tag to use for RPC requests.
309
-
310
- ##### extend
311
-
312
- \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>
313
-
314
- ##### fillTransaction
315
-
316
- \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>
317
-
318
- Fills a transaction request with the necessary fields to be signed over.
319
-
320
- - Docs: https://viem.sh/docs/actions/public/fillTransaction
321
-
322
- **Example**
323
-
324
- ```ts
325
- import { createPublicClient, http } from 'viem'
326
- import { mainnet } from 'viem/chains'
327
-
328
- const client = createPublicClient({
329
- chain: mainnet,
330
- transport: http(),
331
- })
332
- const result = await client.fillTransaction({
333
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
334
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
335
- value: parseEther('1'),
336
- })
337
- ```
338
-
339
- ##### getBalance
340
-
341
- (`args`) => `Promise`\<`bigint`\>
342
-
343
- Returns the balance of an address in wei.
344
-
345
- - Docs: https://viem.sh/docs/actions/public/getBalance
346
- - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)
347
-
348
- **Remarks**
349
-
350
- You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther).
351
-
352
- ```ts
353
- const balance = await getBalance(client, {
354
- address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
355
- blockTag: 'safe'
356
- })
357
- const balanceAsEther = formatEther(balance)
358
- // "6.942"
359
- ```
360
-
361
- **Example**
362
-
363
- ```ts
364
- import { createPublicClient, http } from 'viem'
365
- import { mainnet } from 'viem/chains'
366
-
367
- const client = createPublicClient({
368
- chain: mainnet,
369
- transport: http(),
370
- })
371
- const balance = await client.getBalance({
372
- address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
373
- })
374
- // 10000000000000000000000n (wei)
375
- ```
376
-
377
- ##### getBlobBaseFee
378
-
379
- () => `Promise`\<`bigint`\>
380
-
381
- Returns the base fee per blob gas in wei.
382
-
383
- - Docs: https://viem.sh/docs/actions/public/getBlobBaseFee
384
- - JSON-RPC Methods: [`eth_blobBaseFee`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blobBaseFee)
385
-
386
- **Example**
387
-
388
- ```ts
389
- import { createPublicClient, http } from 'viem'
390
- import { mainnet } from 'viem/chains'
391
- import { getBlobBaseFee } from 'viem/public'
392
-
393
- const client = createPublicClient({
394
- chain: mainnet,
395
- transport: http(),
396
- })
397
- const blobBaseFee = await client.getBlobBaseFee()
398
- ```
399
-
400
- ##### getBlock
401
-
402
- \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>
403
-
404
- Returns information about a block at a block number, hash, or tag.
405
-
406
- - Docs: https://viem.sh/docs/actions/public/getBlock
407
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_fetching-blocks
408
- - JSON-RPC Methods:
409
- - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.
410
- - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.
411
-
412
- **Example**
413
-
414
- ```ts
415
- import { createPublicClient, http } from 'viem'
416
- import { mainnet } from 'viem/chains'
417
-
418
- const client = createPublicClient({
419
- chain: mainnet,
420
- transport: http(),
421
- })
422
- const block = await client.getBlock()
423
- ```
424
-
425
- ##### getBlockNumber
426
-
427
- (`args?`) => `Promise`\<`bigint`\>
428
-
429
- Returns the number of the most recent block seen.
430
-
431
- - Docs: https://viem.sh/docs/actions/public/getBlockNumber
432
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_fetching-blocks
433
- - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)
434
-
435
- **Example**
436
-
437
- ```ts
438
- import { createPublicClient, http } from 'viem'
439
- import { mainnet } from 'viem/chains'
440
-
441
- const client = createPublicClient({
442
- chain: mainnet,
443
- transport: http(),
444
- })
445
- const blockNumber = await client.getBlockNumber()
446
- // 69420n
447
- ```
448
-
449
- ##### getBlockTransactionCount
450
-
451
- (`args?`) => `Promise`\<`number`\>
452
-
453
- Returns the number of Transactions at a block number, hash, or tag.
454
-
455
- - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount
456
- - JSON-RPC Methods:
457
- - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.
458
- - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.
459
-
460
- **Example**
461
-
462
- ```ts
463
- import { createPublicClient, http } from 'viem'
464
- import { mainnet } from 'viem/chains'
465
-
466
- const client = createPublicClient({
467
- chain: mainnet,
468
- transport: http(),
469
- })
470
- const count = await client.getBlockTransactionCount()
471
- ```
472
-
473
- ##### getBytecode
474
-
475
- (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>
476
-
477
- **Deprecated**
478
-
479
- Use `getCode` instead.
480
-
481
- ##### getChainId
482
-
483
- () => `Promise`\<`number`\>
484
-
485
- Returns the chain ID associated with the current network.
486
-
487
- - Docs: https://viem.sh/docs/actions/public/getChainId
488
- - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)
489
-
490
- **Example**
491
-
492
- ```ts
493
- import { createPublicClient, http } from 'viem'
494
- import { mainnet } from 'viem/chains'
495
-
496
- const client = createPublicClient({
497
- chain: mainnet,
498
- transport: http(),
499
- })
500
- const chainId = await client.getChainId()
501
- // 1
502
- ```
503
-
504
- ##### getCode
505
-
506
- (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>
507
-
508
- Retrieves the bytecode at an address.
509
-
510
- - Docs: https://viem.sh/docs/contract/getCode
511
- - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)
512
-
513
- **Example**
514
-
515
- ```ts
516
- import { createPublicClient, http } from 'viem'
517
- import { mainnet } from 'viem/chains'
518
-
519
- const client = createPublicClient({
520
- chain: mainnet,
521
- transport: http(),
522
- })
523
- const code = await client.getCode({
524
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
525
- })
526
- ```
527
-
528
- ##### getContractEvents
529
-
530
- \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>
531
-
532
- Returns a list of event logs emitted by a contract.
533
-
534
- - Docs: https://viem.sh/docs/actions/public/getContractEvents
535
- - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
536
-
537
- **Example**
538
-
539
- ```ts
540
- import { createPublicClient, http } from 'viem'
541
- import { mainnet } from 'viem/chains'
542
- import { wagmiAbi } from './abi'
543
-
544
- const client = createPublicClient({
545
- chain: mainnet,
546
- transport: http(),
547
- })
548
- const logs = await client.getContractEvents(client, {
549
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
550
- abi: wagmiAbi,
551
- eventName: 'Transfer'
552
- })
553
- ```
554
-
555
- ##### getEip712Domain
556
-
557
- (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>
558
-
559
- Reads the EIP-712 domain from a contract, based on the ERC-5267 specification.
560
-
561
- **Example**
562
-
563
- ```ts
564
- import { createPublicClient, http } from 'viem'
565
- import { mainnet } from 'viem/chains'
566
-
567
- const client = createPublicClient({
568
- chain: mainnet,
569
- transport: http(),
570
- })
571
-
572
- const domain = await client.getEip712Domain({
573
- address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
574
- })
575
- // {
576
- // domain: {
577
- // name: 'ExampleContract',
578
- // version: '1',
579
- // chainId: 1,
580
- // verifyingContract: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
581
- // },
582
- // fields: '0x0f',
583
- // extensions: [],
584
- // }
585
- ```
586
-
587
- ##### getEnsAddress
588
-
589
- (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>
590
-
591
- Gets address for ENS name.
592
-
593
- - Docs: https://viem.sh/docs/ens/actions/getEnsAddress
594
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
595
-
596
- **Remarks**
597
-
598
- Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
599
-
600
- Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
601
-
602
- **Example**
603
-
604
- ```ts
605
- import { createPublicClient, http } from 'viem'
606
- import { mainnet } from 'viem/chains'
607
- import { normalize } from 'viem/ens'
608
-
609
- const client = createPublicClient({
610
- chain: mainnet,
611
- transport: http(),
612
- })
613
- const ensAddress = await client.getEnsAddress({
614
- name: normalize('wevm.eth'),
615
- })
616
- // '0xd2135CfB216b74109775236E36d4b433F1DF507B'
617
- ```
618
-
619
- ##### getEnsAvatar
620
-
621
- (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>
622
-
623
- Gets the avatar of an ENS name.
624
-
625
- - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar
626
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
627
-
628
- **Remarks**
629
-
630
- Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText) with `key` set to `'avatar'`.
631
-
632
- Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
633
-
634
- **Example**
635
-
636
- ```ts
637
- import { createPublicClient, http } from 'viem'
638
- import { mainnet } from 'viem/chains'
639
- import { normalize } from 'viem/ens'
640
-
641
- const client = createPublicClient({
642
- chain: mainnet,
643
- transport: http(),
644
- })
645
- const ensAvatar = await client.getEnsAvatar({
646
- name: normalize('wevm.eth'),
647
- })
648
- // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio'
649
- ```
650
-
651
- ##### getEnsName
652
-
653
- (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>
654
-
655
- Gets primary name for specified address.
656
-
657
- - Docs: https://viem.sh/docs/ens/actions/getEnsName
658
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
659
-
660
- **Remarks**
661
-
662
- Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name.
663
-
664
- **Example**
665
-
666
- ```ts
667
- import { createPublicClient, http } from 'viem'
668
- import { mainnet } from 'viem/chains'
669
-
670
- const client = createPublicClient({
671
- chain: mainnet,
672
- transport: http(),
673
- })
674
- const ensName = await client.getEnsName({
675
- address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
676
- })
677
- // 'wevm.eth'
678
- ```
679
-
680
- ##### getEnsResolver
681
-
682
- (`args`) => `Promise`\<`` `0x${string}` ``\>
683
-
684
- Gets resolver for ENS name.
685
-
686
- - Docs: https://viem.sh/docs/ens/actions/getEnsResolver
687
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
688
-
689
- **Remarks**
690
-
691
- Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name.
692
-
693
- Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
694
-
695
- **Example**
696
-
697
- ```ts
698
- import { createPublicClient, http } from 'viem'
699
- import { mainnet } from 'viem/chains'
700
- import { normalize } from 'viem/ens'
701
-
702
- const client = createPublicClient({
703
- chain: mainnet,
704
- transport: http(),
705
- })
706
- const resolverAddress = await client.getEnsResolver({
707
- name: normalize('wevm.eth'),
708
- })
709
- // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'
710
- ```
711
-
712
- ##### getEnsText
713
-
714
- (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>
715
-
716
- Gets a text record for specified ENS name.
717
-
718
- - Docs: https://viem.sh/docs/ens/actions/getEnsResolver
719
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
720
-
721
- **Remarks**
722
-
723
- Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
724
-
725
- Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
726
-
727
- **Example**
728
-
729
- ```ts
730
- import { createPublicClient, http } from 'viem'
731
- import { mainnet } from 'viem/chains'
732
- import { normalize } from 'viem/ens'
733
-
734
- const client = createPublicClient({
735
- chain: mainnet,
736
- transport: http(),
737
- })
738
- const twitterRecord = await client.getEnsText({
739
- name: normalize('wevm.eth'),
740
- key: 'com.twitter',
741
- })
742
- // 'wevm_dev'
743
- ```
744
-
745
- ##### getFeeHistory
746
-
747
- (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>
748
-
749
- Returns a collection of historical gas information.
750
-
751
- - Docs: https://viem.sh/docs/actions/public/getFeeHistory
752
- - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)
753
-
754
- **Example**
755
-
756
- ```ts
757
- import { createPublicClient, http } from 'viem'
758
- import { mainnet } from 'viem/chains'
759
-
760
- const client = createPublicClient({
761
- chain: mainnet,
762
- transport: http(),
763
- })
764
- const feeHistory = await client.getFeeHistory({
765
- blockCount: 4,
766
- rewardPercentiles: [25, 75],
767
- })
768
- ```
769
-
770
- ##### getFilterChanges
771
-
772
- \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>
773
-
774
- Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.
775
-
776
- - Docs: https://viem.sh/docs/actions/public/getFilterChanges
777
- - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)
778
-
779
- **Remarks**
780
-
781
- A Filter can be created from the following actions:
782
-
783
- - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
784
- - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
785
- - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
786
- - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
787
-
788
- Depending on the type of filter, the return value will be different:
789
-
790
- - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs.
791
- - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes.
792
- - If the filter was created with `createBlockFilter`, it returns a list of block hashes.
793
-
794
- **Examples**
795
-
796
- ```ts
797
- // Blocks
798
- import { createPublicClient, http } from 'viem'
799
- import { mainnet } from 'viem/chains'
800
-
801
- const client = createPublicClient({
802
- chain: mainnet,
803
- transport: http(),
804
- })
805
- const filter = await client.createBlockFilter()
806
- const hashes = await client.getFilterChanges({ filter })
807
- ```
808
-
809
- ```ts
810
- // Contract Events
811
- import { createPublicClient, http, parseAbi } from 'viem'
812
- import { mainnet } from 'viem/chains'
813
-
814
- const client = createPublicClient({
815
- chain: mainnet,
816
- transport: http(),
817
- })
818
- const filter = await client.createContractEventFilter({
819
- address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
820
- abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
821
- eventName: 'Transfer',
822
- })
823
- const logs = await client.getFilterChanges({ filter })
824
- ```
825
-
826
- ```ts
827
- // Raw Events
828
- import { createPublicClient, http, parseAbiItem } from 'viem'
829
- import { mainnet } from 'viem/chains'
830
-
831
- const client = createPublicClient({
832
- chain: mainnet,
833
- transport: http(),
834
- })
835
- const filter = await client.createEventFilter({
836
- address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
837
- event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),
838
- })
839
- const logs = await client.getFilterChanges({ filter })
840
- ```
841
-
842
- ```ts
843
- // Transactions
844
- import { createPublicClient, http } from 'viem'
845
- import { mainnet } from 'viem/chains'
846
-
847
- const client = createPublicClient({
848
- chain: mainnet,
849
- transport: http(),
850
- })
851
- const filter = await client.createPendingTransactionFilter()
852
- const hashes = await client.getFilterChanges({ filter })
853
- ```
854
-
855
- ##### getFilterLogs
856
-
857
- \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>
858
-
859
- Returns a list of event logs since the filter was created.
860
-
861
- - Docs: https://viem.sh/docs/actions/public/getFilterLogs
862
- - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)
863
-
864
- **Remarks**
865
-
866
- `getFilterLogs` is only compatible with **event filters**.
867
-
868
- **Example**
869
-
870
- ```ts
871
- import { createPublicClient, http, parseAbiItem } from 'viem'
872
- import { mainnet } from 'viem/chains'
873
-
874
- const client = createPublicClient({
875
- chain: mainnet,
876
- transport: http(),
877
- })
878
- const filter = await client.createEventFilter({
879
- address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
880
- event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),
881
- })
882
- const logs = await client.getFilterLogs({ filter })
883
- ```
884
-
885
- ##### getGasPrice
886
-
887
- () => `Promise`\<`bigint`\>
888
-
889
- Returns the current price of gas (in wei).
890
-
891
- - Docs: https://viem.sh/docs/actions/public/getGasPrice
892
- - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)
893
-
894
- **Example**
895
-
896
- ```ts
897
- import { createPublicClient, http } from 'viem'
898
- import { mainnet } from 'viem/chains'
899
-
900
- const client = createPublicClient({
901
- chain: mainnet,
902
- transport: http(),
903
- })
904
- const gasPrice = await client.getGasPrice()
905
- ```
906
-
907
- ##### getLogs
908
-
909
- \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>
910
-
911
- Returns a list of event logs matching the provided parameters.
912
-
913
- - Docs: https://viem.sh/docs/actions/public/getLogs
914
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/logs_event-logs
915
- - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
916
-
917
- **Example**
918
-
919
- ```ts
920
- import { createPublicClient, http, parseAbiItem } from 'viem'
921
- import { mainnet } from 'viem/chains'
922
-
923
- const client = createPublicClient({
924
- chain: mainnet,
925
- transport: http(),
926
- })
927
- const logs = await client.getLogs()
928
- ```
929
-
930
- ##### getProof
931
-
932
- (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>
933
-
934
- Returns the account and storage values of the specified account including the Merkle-proof.
935
-
936
- - Docs: https://viem.sh/docs/actions/public/getProof
937
- - JSON-RPC Methods:
938
- - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186)
939
-
940
- **Example**
941
-
942
- ```ts
943
- import { createPublicClient, http } from 'viem'
944
- import { mainnet } from 'viem/chains'
945
-
946
- const client = createPublicClient({
947
- chain: mainnet,
948
- transport: http(),
949
- })
950
- const block = await client.getProof({
951
- address: '0x...',
952
- storageKeys: ['0x...'],
953
- })
954
- ```
955
-
956
- ##### getStorageAt
957
-
958
- (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>
959
-
960
- Returns the value from a storage slot at a given address.
961
-
962
- - Docs: https://viem.sh/docs/contract/getStorageAt
963
- - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)
964
-
965
- **Example**
966
-
967
- ```ts
968
- import { createPublicClient, http } from 'viem'
969
- import { mainnet } from 'viem/chains'
970
- import { getStorageAt } from 'viem/contract'
971
-
972
- const client = createPublicClient({
973
- chain: mainnet,
974
- transport: http(),
975
- })
976
- const code = await client.getStorageAt({
977
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
978
- slot: toHex(0),
979
- })
980
- ```
981
-
982
- ##### getTransaction
983
-
984
- \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>
985
-
986
- Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
987
-
988
- - Docs: https://viem.sh/docs/actions/public/getTransaction
989
- - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions
990
- - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)
991
-
992
- **Example**
993
-
994
- ```ts
995
- import { createPublicClient, http } from 'viem'
996
- import { mainnet } from 'viem/chains'
997
-
998
- const client = createPublicClient({
999
- chain: mainnet,
1000
- transport: http(),
1001
- })
1002
- const transaction = await client.getTransaction({
1003
- hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
1004
- })
1005
- ```
1006
-
1007
- ##### getTransactionConfirmations
1008
-
1009
- (`args`) => `Promise`\<`bigint`\>
1010
-
1011
- Returns the number of blocks passed (confirmations) since the transaction was processed on a block.
1012
-
1013
- - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations
1014
- - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions
1015
- - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)
1016
-
1017
- **Example**
1018
-
1019
- ```ts
1020
- import { createPublicClient, http } from 'viem'
1021
- import { mainnet } from 'viem/chains'
1022
-
1023
- const client = createPublicClient({
1024
- chain: mainnet,
1025
- transport: http(),
1026
- })
1027
- const confirmations = await client.getTransactionConfirmations({
1028
- hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
1029
- })
1030
- ```
1031
-
1032
- ##### getTransactionCount
1033
-
1034
- (`args`) => `Promise`\<`number`\>
1035
-
1036
- Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
1037
-
1038
- - Docs: https://viem.sh/docs/actions/public/getTransactionCount
1039
- - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
1040
-
1041
- **Example**
1042
-
1043
- ```ts
1044
- import { createPublicClient, http } from 'viem'
1045
- import { mainnet } from 'viem/chains'
1046
-
1047
- const client = createPublicClient({
1048
- chain: mainnet,
1049
- transport: http(),
1050
- })
1051
- const transactionCount = await client.getTransactionCount({
1052
- address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1053
- })
1054
- ```
1055
-
1056
- ##### getTransactionReceipt
1057
-
1058
- (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>
1059
-
1060
- Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
1061
-
1062
- - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt
1063
- - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions
1064
- - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt)
1065
-
1066
- **Example**
1067
-
1068
- ```ts
1069
- import { createPublicClient, http } from 'viem'
1070
- import { mainnet } from 'viem/chains'
1071
-
1072
- const client = createPublicClient({
1073
- chain: mainnet,
1074
- transport: http(),
1075
- })
1076
- const transactionReceipt = await client.getTransactionReceipt({
1077
- hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
1078
- })
1079
- ```
1080
-
1081
- ##### key
1082
-
1083
- `string`
1084
-
1085
- A key for the client.
1086
-
1087
- ##### multicall
1088
-
1089
- \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>
1090
-
1091
- Similar to [`readContract`](https://viem.sh/docs/contract/readContract), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
1092
-
1093
- - Docs: https://viem.sh/docs/contract/multicall
1094
-
1095
- **Example**
1096
-
1097
- ```ts
1098
- import { createPublicClient, http, parseAbi } from 'viem'
1099
- import { mainnet } from 'viem/chains'
1100
-
1101
- const client = createPublicClient({
1102
- chain: mainnet,
1103
- transport: http(),
1104
- })
1105
- const abi = parseAbi([
1106
- 'function balanceOf(address) view returns (uint256)',
1107
- 'function totalSupply() view returns (uint256)',
1108
- ])
1109
- const result = await client.multicall({
1110
- contracts: [
1111
- {
1112
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
1113
- abi,
1114
- functionName: 'balanceOf',
1115
- args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],
1116
- },
1117
- {
1118
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
1119
- abi,
1120
- functionName: 'totalSupply',
1121
- },
1122
- ],
1123
- })
1124
- // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]
1125
- ```
1126
-
1127
- ##### name
1128
-
1129
- `string`
1130
-
1131
- A name for the client.
1132
-
1133
- ##### pollingInterval
1134
-
1135
- `number`
1136
-
1137
- Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds.
1138
-
1139
- ##### prepareTransactionRequest
1140
-
1141
- \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\<Extract\<(...), (...)\> & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\<request, "kzg"\>))\[K\] \}\>
1142
-
1143
- Prepares a transaction request for signing.
1144
-
1145
- - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest
1146
-
1147
- **Examples**
1148
-
1149
- ```ts
1150
- import { createWalletClient, custom } from 'viem'
1151
- import { mainnet } from 'viem/chains'
1152
-
1153
- const client = createWalletClient({
1154
- chain: mainnet,
1155
- transport: custom(window.ethereum),
1156
- })
1157
- const request = await client.prepareTransactionRequest({
1158
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1159
- to: '0x0000000000000000000000000000000000000000',
1160
- value: 1n,
1161
- })
1162
- ```
1163
-
1164
- ```ts
1165
- // Account Hoisting
1166
- import { createWalletClient, http } from 'viem'
1167
- import { privateKeyToAccount } from 'viem/accounts'
1168
- import { mainnet } from 'viem/chains'
1169
-
1170
- const client = createWalletClient({
1171
- account: privateKeyToAccount('0x…'),
1172
- chain: mainnet,
1173
- transport: custom(window.ethereum),
1174
- })
1175
- const request = await client.prepareTransactionRequest({
1176
- to: '0x0000000000000000000000000000000000000000',
1177
- value: 1n,
1178
- })
1179
- ```
1180
-
1181
- ##### readContract
1182
-
1183
- \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>
1184
-
1185
- Calls a read-only function on a contract, and returns the response.
1186
-
1187
- - Docs: https://viem.sh/docs/contract/readContract
1188
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_reading-contracts
1189
-
1190
- **Remarks**
1191
-
1192
- A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.
1193
-
1194
- Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
1195
-
1196
- **Example**
1197
-
1198
- ```ts
1199
- import { createPublicClient, http, parseAbi } from 'viem'
1200
- import { mainnet } from 'viem/chains'
1201
- import { readContract } from 'viem/contract'
1202
-
1203
- const client = createPublicClient({
1204
- chain: mainnet,
1205
- transport: http(),
1206
- })
1207
- const result = await client.readContract({
1208
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
1209
- abi: parseAbi(['function balanceOf(address) view returns (uint256)']),
1210
- functionName: 'balanceOf',
1211
- args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],
1212
- })
1213
- // 424122n
1214
- ```
1215
-
1216
- ##### request
1217
-
1218
- [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>
1219
-
1220
- Request function wrapped with friendly error handling
1221
-
1222
- ##### sendRawTransaction
1223
-
1224
- (`args`) => `Promise`\<`` `0x${string}` ``\>
1225
-
1226
- Sends a **signed** transaction to the network
1227
-
1228
- - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction
1229
- - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/)
1230
-
1231
- **Example**
1232
-
1233
- ```ts
1234
- import { createWalletClient, custom } from 'viem'
1235
- import { mainnet } from 'viem/chains'
1236
- import { sendRawTransaction } from 'viem/wallet'
1237
-
1238
- const client = createWalletClient({
1239
- chain: mainnet,
1240
- transport: custom(window.ethereum),
1241
- })
1242
-
1243
- const hash = await client.sendRawTransaction({
1244
- serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'
1245
- })
1246
- ```
1247
-
1248
- ##### sendRawTransactionSync
1249
-
1250
- (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>
1251
-
1252
- Sends a **signed** transaction to the network
1253
-
1254
- - Docs: https://viem.sh/docs/actions/wallet/sendRawTransactionSync
1255
- - JSON-RPC Method: [`eth_sendRawTransactionSync`](https://eips.ethereum.org/EIPS/eip-7966)
1256
-
1257
- **Example**
1258
-
1259
- ```ts
1260
- import { createWalletClient, custom } from 'viem'
1261
- import { mainnet } from 'viem/chains'
1262
- import { sendRawTransactionSync } from 'viem/wallet'
1263
-
1264
- const client = createWalletClient({
1265
- chain: mainnet,
1266
- transport: custom(window.ethereum),
1267
- })
1268
-
1269
- const receipt = await client.sendRawTransactionSync({
1270
- serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'
1271
- })
1272
- ```
1273
-
1274
- ##### simulate
1275
-
1276
- \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>
1277
-
1278
- **Deprecated**
1279
-
1280
- Use `simulateBlocks` instead.
1281
-
1282
- ##### simulateBlocks
1283
-
1284
- \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>
1285
-
1286
- Simulates a set of calls on block(s) with optional block and state overrides.
1287
-
1288
- **Example**
1289
-
1290
- ```ts
1291
- import { createPublicClient, http, parseEther } from 'viem'
1292
- import { mainnet } from 'viem/chains'
1293
-
1294
- const client = createPublicClient({
1295
- chain: mainnet,
1296
- transport: http(),
1297
- })
1298
-
1299
- const result = await client.simulateBlocks({
1300
- blocks: [{
1301
- blockOverrides: {
1302
- number: 69420n,
1303
- },
1304
- calls: [{
1305
- {
1306
- account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929',
1307
- data: '0xdeadbeef',
1308
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
1309
- },
1310
- {
1311
- account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929',
1312
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
1313
- value: parseEther('1'),
1314
- },
1315
- }],
1316
- stateOverrides: [{
1317
- address: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929',
1318
- balance: parseEther('10'),
1319
- }],
1320
- }]
1321
- })
1322
- ```
1323
-
1324
- ##### simulateCalls
1325
-
1326
- \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>
1327
-
1328
- Simulates a set of calls.
1329
-
1330
- **Example**
1331
-
1332
- ```ts
1333
- import { createPublicClient, http, parseEther } from 'viem'
1334
- import { mainnet } from 'viem/chains'
1335
-
1336
- const client = createPublicClient({
1337
- chain: mainnet,
1338
- transport: http(),
1339
- })
1340
-
1341
- const result = await client.simulateCalls({
1342
- account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929',
1343
- calls: [{
1344
- {
1345
- data: '0xdeadbeef',
1346
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
1347
- },
1348
- {
1349
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
1350
- value: parseEther('1'),
1351
- },
1352
- ]
1353
- })
1354
- ```
1355
-
1356
- ##### simulateContract
1357
-
1358
- \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>
1359
-
1360
- Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.
1361
-
1362
- - Docs: https://viem.sh/docs/contract/simulateContract
1363
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts
1364
-
1365
- **Remarks**
1366
-
1367
- This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract), but also supports contract write functions.
1368
-
1369
- Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
1370
-
1371
- **Example**
1372
-
1373
- ```ts
1374
- import { createPublicClient, http } from 'viem'
1375
- import { mainnet } from 'viem/chains'
1376
-
1377
- const client = createPublicClient({
1378
- chain: mainnet,
1379
- transport: http(),
1380
- })
1381
- const result = await client.simulateContract({
1382
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
1383
- abi: parseAbi(['function mint(uint32) view returns (uint32)']),
1384
- functionName: 'mint',
1385
- args: ['69420'],
1386
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1387
- })
1388
- ```
1389
-
1390
- ##### transport
1391
-
1392
- [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>
1393
-
1394
- The RPC transport
1395
-
1396
- ##### type
1397
-
1398
- `string`
1399
-
1400
- The type of client.
1401
-
1402
- ##### uid
1403
-
1404
- `string`
1405
-
1406
- A unique ID for the client.
1407
-
1408
- ##### uninstallFilter
1409
-
1410
- (`args`) => `Promise`\<`boolean`\>
1411
-
1412
- Destroys a Filter that was created from one of the following Actions:
1413
-
1414
- - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
1415
- - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
1416
- - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
1417
-
1418
- - Docs: https://viem.sh/docs/actions/public/uninstallFilter
1419
- - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
1420
-
1421
- **Example**
1422
-
1423
- ```ts
1424
- import { createPublicClient, http } from 'viem'
1425
- import { mainnet } from 'viem/chains'
1426
- import { createPendingTransactionFilter, uninstallFilter } from 'viem/public'
1427
-
1428
- const filter = await client.createPendingTransactionFilter()
1429
- const uninstalled = await client.uninstallFilter({ filter })
1430
- // true
1431
- ```
1432
-
1433
- ##### verifyHash
1434
-
1435
- (`args`) => `Promise`\<`boolean`\>
1436
-
1437
- Verify that a hash was signed by the provided address.
1438
-
1439
- - Docs [https://viem.sh/docs/actions/public/verifyHash](https://viem.sh/docs/actions/public/verifyHash)
1440
-
1441
- ##### verifyMessage
1442
-
1443
- (`args`) => `Promise`\<`boolean`\>
1444
-
1445
- Verify that a message was signed by the provided address.
1446
-
1447
- Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492).
1448
-
1449
- - Docs [https://viem.sh/docs/actions/public/verifyMessage](https://viem.sh/docs/actions/public/verifyMessage)
1450
-
1451
- ##### verifySiweMessage
1452
-
1453
- (`args`) => `Promise`\<`boolean`\>
1454
-
1455
- Verifies [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361) formatted message was signed.
1456
-
1457
- Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492).
1458
-
1459
- - Docs [https://viem.sh/docs/siwe/actions/verifySiweMessage](https://viem.sh/docs/siwe/actions/verifySiweMessage)
1460
-
1461
- ##### verifyTypedData
1462
-
1463
- (`args`) => `Promise`\<`boolean`\>
1464
-
1465
- Verify that typed data was signed by the provided address.
1466
-
1467
- - Docs [https://viem.sh/docs/actions/public/verifyTypedData](https://viem.sh/docs/actions/public/verifyTypedData)
1468
-
1469
- ##### waitForTransactionReceipt
1470
-
1471
- (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>
1472
-
1473
- Waits for the [Transaction](https://viem.sh/docs/glossary/terms#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt). If the Transaction reverts, then the action will throw an error.
1474
-
1475
- - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt
1476
- - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions
1477
- - JSON-RPC Methods:
1478
- - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed.
1479
- - If a Transaction has been replaced:
1480
- - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions
1481
- - Checks if one of the Transactions is a replacement
1482
- - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt).
1483
-
1484
- **Remarks**
1485
-
1486
- The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions).
1487
-
1488
- Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce.
1489
-
1490
- There are 3 types of Transaction Replacement reasons:
1491
-
1492
- - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`)
1493
- - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`)
1494
- - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`)
1495
-
1496
- **Example**
1497
-
1498
- ```ts
1499
- import { createPublicClient, http } from 'viem'
1500
- import { mainnet } from 'viem/chains'
1501
-
1502
- const client = createPublicClient({
1503
- chain: mainnet,
1504
- transport: http(),
1505
- })
1506
- const transactionReceipt = await client.waitForTransactionReceipt({
1507
- hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
1508
- })
1509
- ```
1510
-
1511
- ##### watchBlockNumber
1512
-
1513
- (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html)
1514
-
1515
- Watches and returns incoming block numbers.
1516
-
1517
- - Docs: https://viem.sh/docs/actions/public/watchBlockNumber
1518
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_watching-blocks
1519
- - JSON-RPC Methods:
1520
- - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval.
1521
- - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
1522
-
1523
- **Example**
1524
-
1525
- ```ts
1526
- import { createPublicClient, http } from 'viem'
1527
- import { mainnet } from 'viem/chains'
1528
-
1529
- const client = createPublicClient({
1530
- chain: mainnet,
1531
- transport: http(),
1532
- })
1533
- const unwatch = await client.watchBlockNumber({
1534
- onBlockNumber: (blockNumber) => console.log(blockNumber),
1535
- })
1536
- ```
1537
-
1538
- ##### watchBlocks
1539
-
1540
- \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html)
1541
-
1542
- Watches and returns information for incoming blocks.
1543
-
1544
- - Docs: https://viem.sh/docs/actions/public/watchBlocks
1545
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_watching-blocks
1546
- - JSON-RPC Methods:
1547
- - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval.
1548
- - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
1549
-
1550
- **Example**
1551
-
1552
- ```ts
1553
- import { createPublicClient, http } from 'viem'
1554
- import { mainnet } from 'viem/chains'
1555
-
1556
- const client = createPublicClient({
1557
- chain: mainnet,
1558
- transport: http(),
1559
- })
1560
- const unwatch = await client.watchBlocks({
1561
- onBlock: (block) => console.log(block),
1562
- })
1563
- ```
1564
-
1565
- ##### watchContractEvent
1566
-
1567
- \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html)
1568
-
1569
- Watches and returns emitted contract event logs.
1570
-
1571
- - Docs: https://viem.sh/docs/contract/watchContractEvent
1572
-
1573
- **Remarks**
1574
-
1575
- This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent#onLogs).
1576
-
1577
- `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
1578
-
1579
- **Example**
1580
-
1581
- ```ts
1582
- import { createPublicClient, http, parseAbi } from 'viem'
1583
- import { mainnet } from 'viem/chains'
1584
-
1585
- const client = createPublicClient({
1586
- chain: mainnet,
1587
- transport: http(),
1588
- })
1589
- const unwatch = client.watchContractEvent({
1590
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
1591
- abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']),
1592
- eventName: 'Transfer',
1593
- args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },
1594
- onLogs: (logs) => console.log(logs),
1595
- })
1596
- ```
1597
-
1598
- ##### watchEvent
1599
-
1600
- \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html)
1601
-
1602
- Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log).
1603
-
1604
- - Docs: https://viem.sh/docs/actions/public/watchEvent
1605
- - JSON-RPC Methods:
1606
- - **RPC Provider supports `eth_newFilter`:**
1607
- - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize).
1608
- - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges).
1609
- - **RPC Provider does not support `eth_newFilter`:**
1610
- - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval.
1611
-
1612
- **Remarks**
1613
-
1614
- This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent#onLogs).
1615
-
1616
- `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
1617
-
1618
- **Example**
1619
-
1620
- ```ts
1621
- import { createPublicClient, http } from 'viem'
1622
- import { mainnet } from 'viem/chains'
1623
-
1624
- const client = createPublicClient({
1625
- chain: mainnet,
1626
- transport: http(),
1627
- })
1628
- const unwatch = client.watchEvent({
1629
- onLogs: (logs) => console.log(logs),
1630
- })
1631
- ```
1632
-
1633
- ##### watchPendingTransactions
1634
-
1635
- (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html)
1636
-
1637
- Watches and returns pending transaction hashes.
1638
-
1639
- - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions
1640
- - JSON-RPC Methods:
1641
- - When `poll: true`
1642
- - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter.
1643
- - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval.
1644
- - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newPendingTransactions"` event.
1645
-
1646
- **Remarks**
1647
-
1648
- This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions#ontransactions).
1649
-
1650
- **Example**
1651
-
1652
- ```ts
1653
- import { createPublicClient, http } from 'viem'
1654
- import { mainnet } from 'viem/chains'
1655
-
1656
- const client = createPublicClient({
1657
- chain: mainnet,
1658
- transport: http(),
1659
- })
1660
- const unwatch = await client.watchPendingTransactions({
1661
- onTransactions: (hashes) => console.log(hashes),
1662
- })
1663
- ```
1664
-
1665
- |
1666
-
1667
- \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\<Capabilities\<\{ atomic?: ...; paymasterService?: ...; unstable\_addSubAccount?: ...; \[key: ...\]: ... \}\>, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\<Extract\<(...), (...)\> & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\<request, "kzg"\>))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \}
1668
-
1669
- ##### account
1670
-
1671
- [`Account`](https://viem.sh/docs/index.html) \| `undefined`
1672
-
1673
- The Account of the Client.
1674
-
1675
- ##### addChain
1676
-
1677
- (`args`) => `Promise`\<`void`\>
1678
-
1679
- Adds an EVM chain to the wallet.
1680
-
1681
- - Docs: https://viem.sh/docs/actions/wallet/addChain
1682
- - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085)
1683
-
1684
- **Example**
1685
-
1686
- ```ts
1687
- import { createWalletClient, custom } from 'viem'
1688
- import { optimism } from 'viem/chains'
1689
-
1690
- const client = createWalletClient({
1691
- transport: custom(window.ethereum),
1692
- })
1693
- await client.addChain({ chain: optimism })
1694
- ```
1695
-
1696
- ##### batch?
1697
-
1698
- \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}
1699
-
1700
- Flags for batch settings.
1701
-
1702
- ##### batch.multicall?
1703
-
1704
- `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}
1705
-
1706
- Toggle to enable `eth_call` multicall aggregation.
1707
-
1708
- ##### cacheTime
1709
-
1710
- `number`
1711
-
1712
- Time (in ms) that cached data will remain in memory.
1713
-
1714
- ##### ccipRead?
1715
-
1716
- `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}
1717
-
1718
- [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration.
1719
-
1720
- ##### chain
1721
-
1722
- [`Chain`](https://viem.sh/docs/index.html) \| `undefined`
1723
-
1724
- Chain for the client.
1725
-
1726
- ##### deployContract
1727
-
1728
- \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>
1729
-
1730
- Deploys a contract to the network, given bytecode and constructor arguments.
1731
-
1732
- - Docs: https://viem.sh/docs/contract/deployContract
1733
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_deploying-contracts
1734
-
1735
- **Example**
1736
-
1737
- ```ts
1738
- import { createWalletClient, http } from 'viem'
1739
- import { privateKeyToAccount } from 'viem/accounts'
1740
- import { mainnet } from 'viem/chains'
1741
-
1742
- const client = createWalletClient({
1743
- account: privateKeyToAccount('0x…'),
1744
- chain: mainnet,
1745
- transport: http(),
1746
- })
1747
- const hash = await client.deployContract({
1748
- abi: [],
1749
- account: '0x…,
1750
- bytecode: '0x608060405260405161083e38038061083e833981016040819052610...',
1751
- })
1752
- ```
1753
-
1754
- ##### experimental_blockTag?
1755
-
1756
- [`BlockTag`](https://viem.sh/docs/index.html)
1757
-
1758
- Default block tag to use for RPC requests.
1759
-
1760
- ##### extend
1761
-
1762
- \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>
1763
-
1764
- ##### fillTransaction
1765
-
1766
- \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>
1767
-
1768
- Fills a transaction request with the necessary fields to be signed over.
1769
-
1770
- - Docs: https://viem.sh/docs/actions/public/fillTransaction
1771
-
1772
- **Example**
1773
-
1774
- ```ts
1775
- import { createWalletClient, custom } from 'viem'
1776
- import { mainnet } from 'viem/chains'
1777
-
1778
- const client = createWalletClient({
1779
- chain: mainnet,
1780
- transport: custom(window.ethereum),
1781
- })
1782
- const result = await client.fillTransaction({
1783
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1784
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
1785
- value: parseEther('1'),
1786
- })
1787
- ```
1788
-
1789
- ##### getAddresses
1790
-
1791
- () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>
1792
-
1793
- Returns a list of account addresses owned by the wallet or client.
1794
-
1795
- - Docs: https://viem.sh/docs/actions/wallet/getAddresses
1796
- - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts)
1797
-
1798
- **Example**
1799
-
1800
- ```ts
1801
- import { createWalletClient, custom } from 'viem'
1802
- import { mainnet } from 'viem/chains'
1803
-
1804
- const client = createWalletClient({
1805
- chain: mainnet,
1806
- transport: custom(window.ethereum),
1807
- })
1808
- const accounts = await client.getAddresses()
1809
- ```
1810
-
1811
- ##### getCallsStatus
1812
-
1813
- (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>
1814
-
1815
- Returns the status of a call batch that was sent via `sendCalls`.
1816
-
1817
- - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus
1818
- - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)
1819
-
1820
- **Example**
1821
-
1822
- ```ts
1823
- import { createWalletClient, custom } from 'viem'
1824
- import { mainnet } from 'viem/chains'
1825
-
1826
- const client = createWalletClient({
1827
- chain: mainnet,
1828
- transport: custom(window.ethereum),
1829
- })
1830
-
1831
- const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' })
1832
- ```
1833
-
1834
- ##### getCapabilities
1835
-
1836
- \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\<Capabilities\<\{ atomic?: ...; paymasterService?: ...; unstable\_addSubAccount?: ...; \[key: ...\]: ... \}\>, number\>)\[K\] \}\>
1837
-
1838
- Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc).
1839
-
1840
- - Docs: https://viem.sh/docs/actions/wallet/getCapabilities
1841
- - JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792)
1842
-
1843
- **Example**
1844
-
1845
- ```ts
1846
- import { createWalletClient, custom } from 'viem'
1847
- import { mainnet } from 'viem/chains'
1848
-
1849
- const client = createWalletClient({
1850
- chain: mainnet,
1851
- transport: custom(window.ethereum),
1852
- })
1853
-
1854
- const capabilities = await client.getCapabilities({
1855
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1856
- })
1857
- ```
1858
-
1859
- ##### getChainId
1860
-
1861
- () => `Promise`\<`number`\>
1862
-
1863
- Returns the chain ID associated with the current network.
1864
-
1865
- - Docs: https://viem.sh/docs/actions/public/getChainId
1866
- - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)
1867
-
1868
- **Example**
1869
-
1870
- ```ts
1871
- import { createWalletClient, http } from 'viem'
1872
- import { mainnet } from 'viem/chains'
1873
-
1874
- const client = createWalletClient({
1875
- chain: mainnet,
1876
- transport: custom(window.ethereum),
1877
- })
1878
- const chainId = await client.getChainId()
1879
- // 1
1880
- ```
1881
-
1882
- ##### getPermissions
1883
-
1884
- () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>
1885
-
1886
- Gets the wallets current permissions.
1887
-
1888
- - Docs: https://viem.sh/docs/actions/wallet/getPermissions
1889
- - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255)
1890
-
1891
- **Example**
1892
-
1893
- ```ts
1894
- import { createWalletClient, custom } from 'viem'
1895
- import { mainnet } from 'viem/chains'
1896
-
1897
- const client = createWalletClient({
1898
- chain: mainnet,
1899
- transport: custom(window.ethereum),
1900
- })
1901
- const permissions = await client.getPermissions()
1902
- ```
1903
-
1904
- ##### key
1905
-
1906
- `string`
1907
-
1908
- A key for the client.
1909
-
1910
- ##### name
1911
-
1912
- `string`
1913
-
1914
- A name for the client.
1915
-
1916
- ##### pollingInterval
1917
-
1918
- `number`
1919
-
1920
- Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds.
1921
-
1922
- ##### prepareAuthorization
1923
-
1924
- (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>
1925
-
1926
- Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing.
1927
- This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`).
1928
-
1929
- With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object.
1930
-
1931
- **Examples**
1932
-
1933
- ```ts
1934
- import { createWalletClient, http } from 'viem'
1935
- import { privateKeyToAccount } from 'viem/accounts'
1936
- import { mainnet } from 'viem/chains'
1937
-
1938
- const client = createWalletClient({
1939
- chain: mainnet,
1940
- transport: http(),
1941
- })
1942
-
1943
- const authorization = await client.prepareAuthorization({
1944
- account: privateKeyToAccount('0x..'),
1945
- contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1946
- })
1947
- ```
1948
-
1949
- ```ts
1950
- // Account Hoisting
1951
- import { createWalletClient, http } from 'viem'
1952
- import { privateKeyToAccount } from 'viem/accounts'
1953
- import { mainnet } from 'viem/chains'
1954
-
1955
- const client = createWalletClient({
1956
- account: privateKeyToAccount('0x…'),
1957
- chain: mainnet,
1958
- transport: http(),
1959
- })
1960
-
1961
- const authorization = await client.prepareAuthorization({
1962
- contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1963
- })
1964
- ```
1965
-
1966
- ##### prepareTransactionRequest
1967
-
1968
- \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\<Extract\<(...), (...)\> & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\<request, "kzg"\>))\[K\] \}\>
1969
-
1970
- Prepares a transaction request for signing.
1971
-
1972
- - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest
1973
-
1974
- **Examples**
1975
-
1976
- ```ts
1977
- import { createWalletClient, custom } from 'viem'
1978
- import { mainnet } from 'viem/chains'
1979
-
1980
- const client = createWalletClient({
1981
- chain: mainnet,
1982
- transport: custom(window.ethereum),
1983
- })
1984
- const request = await client.prepareTransactionRequest({
1985
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1986
- to: '0x0000000000000000000000000000000000000000',
1987
- value: 1n,
1988
- })
1989
- ```
1990
-
1991
- ```ts
1992
- // Account Hoisting
1993
- import { createWalletClient, http } from 'viem'
1994
- import { privateKeyToAccount } from 'viem/accounts'
1995
- import { mainnet } from 'viem/chains'
1996
-
1997
- const client = createWalletClient({
1998
- account: privateKeyToAccount('0x…'),
1999
- chain: mainnet,
2000
- transport: custom(window.ethereum),
2001
- })
2002
- const request = await client.prepareTransactionRequest({
2003
- to: '0x0000000000000000000000000000000000000000',
2004
- value: 1n,
2005
- })
2006
- ```
2007
-
2008
- ##### request
2009
-
2010
- [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>
2011
-
2012
- Request function wrapped with friendly error handling
2013
-
2014
- ##### requestAddresses
2015
-
2016
- () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>
2017
-
2018
- Requests a list of accounts managed by a wallet.
2019
-
2020
- - Docs: https://viem.sh/docs/actions/wallet/requestAddresses
2021
- - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102)
2022
-
2023
- Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses).
2024
-
2025
- This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts.
2026
-
2027
- **Example**
2028
-
2029
- ```ts
2030
- import { createWalletClient, custom } from 'viem'
2031
- import { mainnet } from 'viem/chains'
2032
-
2033
- const client = createWalletClient({
2034
- chain: mainnet,
2035
- transport: custom(window.ethereum),
2036
- })
2037
- const accounts = await client.requestAddresses()
2038
- ```
2039
-
2040
- ##### requestPermissions
2041
-
2042
- (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>
2043
-
2044
- Requests permissions for a wallet.
2045
-
2046
- - Docs: https://viem.sh/docs/actions/wallet/requestPermissions
2047
- - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255)
2048
-
2049
- **Example**
2050
-
2051
- ```ts
2052
- import { createWalletClient, custom } from 'viem'
2053
- import { mainnet } from 'viem/chains'
2054
-
2055
- const client = createWalletClient({
2056
- chain: mainnet,
2057
- transport: custom(window.ethereum),
2058
- })
2059
- const permissions = await client.requestPermissions({
2060
- eth_accounts: {}
2061
- })
2062
- ```
2063
-
2064
- ##### sendCalls
2065
-
2066
- \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>
2067
-
2068
- Requests the connected wallet to send a batch of calls.
2069
-
2070
- - Docs: https://viem.sh/docs/actions/wallet/sendCalls
2071
- - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792)
2072
-
2073
- **Example**
2074
-
2075
- ```ts
2076
- import { createWalletClient, custom } from 'viem'
2077
- import { mainnet } from 'viem/chains'
2078
-
2079
- const client = createWalletClient({
2080
- chain: mainnet,
2081
- transport: custom(window.ethereum),
2082
- })
2083
-
2084
- const id = await client.sendCalls({
2085
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2086
- calls: [
2087
- {
2088
- data: '0xdeadbeef',
2089
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
2090
- },
2091
- {
2092
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
2093
- value: 69420n,
2094
- },
2095
- ],
2096
- })
2097
- ```
2098
-
2099
- ##### sendCallsSync
2100
-
2101
- \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>
2102
-
2103
- Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block.
2104
-
2105
- - Docs: https://viem.sh/docs/actions/wallet/sendCallsSync
2106
- - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792)
2107
-
2108
- **Example**
2109
-
2110
- ```ts
2111
- import { createWalletClient, custom } from 'viem'
2112
- import { mainnet } from 'viem/chains'
2113
-
2114
- const client = createWalletClient({
2115
- chain: mainnet,
2116
- transport: custom(window.ethereum),
2117
- })
2118
-
2119
- const status = await client.sendCallsSync({
2120
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2121
- calls: [
2122
- {
2123
- data: '0xdeadbeef',
2124
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
2125
- },
2126
- {
2127
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
2128
- value: 69420n,
2129
- },
2130
- ],
2131
- })
2132
- ```
2133
-
2134
- ##### sendRawTransaction
2135
-
2136
- (`args`) => `Promise`\<`` `0x${string}` ``\>
2137
-
2138
- Sends a **signed** transaction to the network
2139
-
2140
- - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction
2141
- - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/)
2142
-
2143
- **Example**
2144
-
2145
- ```ts
2146
- import { createWalletClient, custom } from 'viem'
2147
- import { mainnet } from 'viem/chains'
2148
- import { sendRawTransaction } from 'viem/wallet'
2149
-
2150
- const client = createWalletClient({
2151
- chain: mainnet,
2152
- transport: custom(window.ethereum),
2153
- })
2154
-
2155
- const hash = await client.sendRawTransaction({
2156
- serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'
2157
- })
2158
- ```
2159
-
2160
- ##### sendRawTransactionSync
2161
-
2162
- (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>
2163
-
2164
- Sends a **signed** transaction to the network synchronously,
2165
- and waits for the transaction to be included in a block.
2166
-
2167
- - Docs: https://viem.sh/docs/actions/wallet/sendRawTransactionSync
2168
- - JSON-RPC Method: [`eth_sendRawTransactionSync`](https://eips.ethereum.org/EIPS/eip-7966)
2169
-
2170
- **Example**
2171
-
2172
- ```ts
2173
- import { createWalletClient, custom } from 'viem'
2174
- import { mainnet } from 'viem/chains'
2175
- import { sendRawTransactionSync } from 'viem/wallet'
2176
-
2177
- const client = createWalletClient({
2178
- chain: mainnet,
2179
- transport: custom(window.ethereum),
2180
- })
2181
-
2182
- const receipt = await client.sendRawTransactionSync({
2183
- serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'
2184
- })
2185
- ```
2186
-
2187
- ##### sendTransaction
2188
-
2189
- \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>
2190
-
2191
- Creates, signs, and sends a new transaction to the network.
2192
-
2193
- - Docs: https://viem.sh/docs/actions/wallet/sendTransaction
2194
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions
2195
- - JSON-RPC Methods:
2196
- - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)
2197
- - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)
2198
-
2199
- **Examples**
2200
-
2201
- ```ts
2202
- import { createWalletClient, custom } from 'viem'
2203
- import { mainnet } from 'viem/chains'
2204
-
2205
- const client = createWalletClient({
2206
- chain: mainnet,
2207
- transport: custom(window.ethereum),
2208
- })
2209
- const hash = await client.sendTransaction({
2210
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2211
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
2212
- value: 1000000000000000000n,
2213
- })
2214
- ```
2215
-
2216
- ```ts
2217
- // Account Hoisting
2218
- import { createWalletClient, http } from 'viem'
2219
- import { privateKeyToAccount } from 'viem/accounts'
2220
- import { mainnet } from 'viem/chains'
2221
-
2222
- const client = createWalletClient({
2223
- account: privateKeyToAccount('0x…'),
2224
- chain: mainnet,
2225
- transport: http(),
2226
- })
2227
- const hash = await client.sendTransaction({
2228
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
2229
- value: 1000000000000000000n,
2230
- })
2231
- ```
2232
-
2233
- ##### sendTransactionSync
2234
-
2235
- \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>
2236
-
2237
- Creates, signs, and sends a new transaction to the network synchronously.
2238
- Returns the transaction receipt.
2239
-
2240
- - Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync
2241
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions
2242
- - JSON-RPC Methods:
2243
- - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)
2244
- - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)
2245
-
2246
- **Examples**
2247
-
2248
- ```ts
2249
- import { createWalletClient, custom } from 'viem'
2250
- import { mainnet } from 'viem/chains'
2251
-
2252
- const client = createWalletClient({
2253
- chain: mainnet,
2254
- transport: custom(window.ethereum),
2255
- })
2256
- const receipt = await client.sendTransactionSync({
2257
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2258
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
2259
- value: 1000000000000000000n,
2260
- })
2261
- ```
2262
-
2263
- ```ts
2264
- // Account Hoisting
2265
- import { createWalletClient, http } from 'viem'
2266
- import { privateKeyToAccount } from 'viem/accounts'
2267
- import { mainnet } from 'viem/chains'
2268
-
2269
- const client = createWalletClient({
2270
- account: privateKeyToAccount('0x…'),
2271
- chain: mainnet,
2272
- transport: http(),
2273
- })
2274
- const receipt = await client.sendTransactionSync({
2275
- to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
2276
- value: 1000000000000000000n,
2277
- })
2278
- ```
2279
-
2280
- ##### showCallsStatus
2281
-
2282
- (`parameters`) => `Promise`\<`void`\>
2283
-
2284
- Requests for the wallet to show information about a call batch
2285
- that was sent via `sendCalls`.
2286
-
2287
- - Docs: https://viem.sh/docs/actions/wallet/showCallsStatus
2288
- - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)
2289
-
2290
- **Example**
2291
-
2292
- ```ts
2293
- import { createWalletClient, custom } from 'viem'
2294
- import { mainnet } from 'viem/chains'
2295
-
2296
- const client = createWalletClient({
2297
- chain: mainnet,
2298
- transport: custom(window.ethereum),
2299
- })
2300
-
2301
- await client.showCallsStatus({ id: '0xdeadbeef' })
2302
- ```
2303
-
2304
- ##### signAuthorization
2305
-
2306
- (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>
2307
-
2308
- Signs an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object.
2309
-
2310
- With the calculated signature, you can:
2311
- - use [`verifyAuthorization`](https://viem.sh/docs/eip7702/verifyAuthorization) to verify the signed Authorization object,
2312
- - use [`recoverAuthorizationAddress`](https://viem.sh/docs/eip7702/recoverAuthorizationAddress) to recover the signing address from the signed Authorization object.
2313
-
2314
- **Examples**
2315
-
2316
- ```ts
2317
- import { createWalletClient, http } from 'viem'
2318
- import { privateKeyToAccount } from 'viem/accounts'
2319
- import { mainnet } from 'viem/chains'
2320
-
2321
- const client = createWalletClient({
2322
- chain: mainnet,
2323
- transport: http(),
2324
- })
2325
-
2326
- const signature = await client.signAuthorization({
2327
- account: privateKeyToAccount('0x..'),
2328
- contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2329
- })
2330
- ```
2331
-
2332
- ```ts
2333
- // Account Hoisting
2334
- import { createWalletClient, http } from 'viem'
2335
- import { privateKeyToAccount } from 'viem/accounts'
2336
- import { mainnet } from 'viem/chains'
2337
-
2338
- const client = createWalletClient({
2339
- account: privateKeyToAccount('0x…'),
2340
- chain: mainnet,
2341
- transport: http(),
2342
- })
2343
-
2344
- const signature = await client.signAuthorization({
2345
- contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2346
- })
2347
- ```
2348
-
2349
- ##### signMessage
2350
-
2351
- (`args`) => `Promise`\<`` `0x${string}` ``\>
2352
-
2353
- Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.
2354
-
2355
- - Docs: https://viem.sh/docs/actions/wallet/signMessage
2356
- - JSON-RPC Methods:
2357
- - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign)
2358
- - Local Accounts: Signs locally. No JSON-RPC request.
2359
-
2360
- With the calculated signature, you can:
2361
- - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,
2362
- - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature.
2363
-
2364
- **Examples**
2365
-
2366
- ```ts
2367
- import { createWalletClient, custom } from 'viem'
2368
- import { mainnet } from 'viem/chains'
2369
-
2370
- const client = createWalletClient({
2371
- chain: mainnet,
2372
- transport: custom(window.ethereum),
2373
- })
2374
- const signature = await client.signMessage({
2375
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2376
- message: 'hello world',
2377
- })
2378
- ```
2379
-
2380
- ```ts
2381
- // Account Hoisting
2382
- import { createWalletClient, http } from 'viem'
2383
- import { privateKeyToAccount } from 'viem/accounts'
2384
- import { mainnet } from 'viem/chains'
2385
-
2386
- const client = createWalletClient({
2387
- account: privateKeyToAccount('0x…'),
2388
- chain: mainnet,
2389
- transport: http(),
2390
- })
2391
- const signature = await client.signMessage({
2392
- message: 'hello world',
2393
- })
2394
- ```
2395
-
2396
- ##### signTransaction
2397
-
2398
- \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>
2399
-
2400
- Signs a transaction.
2401
-
2402
- - Docs: https://viem.sh/docs/actions/wallet/signTransaction
2403
- - JSON-RPC Methods:
2404
- - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/)
2405
- - Local Accounts: Signs locally. No JSON-RPC request.
2406
-
2407
- **Examples**
2408
-
2409
- ```ts
2410
- import { createWalletClient, custom } from 'viem'
2411
- import { mainnet } from 'viem/chains'
2412
-
2413
- const client = createWalletClient({
2414
- chain: mainnet,
2415
- transport: custom(window.ethereum),
2416
- })
2417
- const request = await client.prepareTransactionRequest({
2418
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2419
- to: '0x0000000000000000000000000000000000000000',
2420
- value: 1n,
2421
- })
2422
- const signature = await client.signTransaction(request)
2423
- ```
2424
-
2425
- ```ts
2426
- // Account Hoisting
2427
- import { createWalletClient, http } from 'viem'
2428
- import { privateKeyToAccount } from 'viem/accounts'
2429
- import { mainnet } from 'viem/chains'
2430
-
2431
- const client = createWalletClient({
2432
- account: privateKeyToAccount('0x…'),
2433
- chain: mainnet,
2434
- transport: custom(window.ethereum),
2435
- })
2436
- const request = await client.prepareTransactionRequest({
2437
- to: '0x0000000000000000000000000000000000000000',
2438
- value: 1n,
2439
- })
2440
- const signature = await client.signTransaction(request)
2441
- ```
2442
-
2443
- ##### signTypedData
2444
-
2445
- \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>
2446
-
2447
- Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.
2448
-
2449
- - Docs: https://viem.sh/docs/actions/wallet/signTypedData
2450
- - JSON-RPC Methods:
2451
- - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4)
2452
- - Local Accounts: Signs locally. No JSON-RPC request.
2453
-
2454
- **Examples**
2455
-
2456
- ```ts
2457
- import { createWalletClient, custom } from 'viem'
2458
- import { mainnet } from 'viem/chains'
2459
-
2460
- const client = createWalletClient({
2461
- chain: mainnet,
2462
- transport: custom(window.ethereum),
2463
- })
2464
- const signature = await client.signTypedData({
2465
- account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
2466
- domain: {
2467
- name: 'Ether Mail',
2468
- version: '1',
2469
- chainId: 1,
2470
- verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
2471
- },
2472
- types: {
2473
- Person: [
2474
- { name: 'name', type: 'string' },
2475
- { name: 'wallet', type: 'address' },
2476
- ],
2477
- Mail: [
2478
- { name: 'from', type: 'Person' },
2479
- { name: 'to', type: 'Person' },
2480
- { name: 'contents', type: 'string' },
2481
- ],
2482
- },
2483
- primaryType: 'Mail',
2484
- message: {
2485
- from: {
2486
- name: 'Cow',
2487
- wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
2488
- },
2489
- to: {
2490
- name: 'Bob',
2491
- wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
2492
- },
2493
- contents: 'Hello, Bob!',
2494
- },
2495
- })
2496
- ```
2497
-
2498
- ```ts
2499
- // Account Hoisting
2500
- import { createWalletClient, http } from 'viem'
2501
- import { privateKeyToAccount } from 'viem/accounts'
2502
- import { mainnet } from 'viem/chains'
2503
-
2504
- const client = createWalletClient({
2505
- account: privateKeyToAccount('0x…'),
2506
- chain: mainnet,
2507
- transport: http(),
2508
- })
2509
- const signature = await client.signTypedData({
2510
- domain: {
2511
- name: 'Ether Mail',
2512
- version: '1',
2513
- chainId: 1,
2514
- verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
2515
- },
2516
- types: {
2517
- Person: [
2518
- { name: 'name', type: 'string' },
2519
- { name: 'wallet', type: 'address' },
2520
- ],
2521
- Mail: [
2522
- { name: 'from', type: 'Person' },
2523
- { name: 'to', type: 'Person' },
2524
- { name: 'contents', type: 'string' },
2525
- ],
2526
- },
2527
- primaryType: 'Mail',
2528
- message: {
2529
- from: {
2530
- name: 'Cow',
2531
- wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
2532
- },
2533
- to: {
2534
- name: 'Bob',
2535
- wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
2536
- },
2537
- contents: 'Hello, Bob!',
2538
- },
2539
- })
2540
- ```
2541
-
2542
- ##### switchChain
2543
-
2544
- (`args`) => `Promise`\<`void`\>
2545
-
2546
- Switch the target chain in a wallet.
2547
-
2548
- - Docs: https://viem.sh/docs/actions/wallet/switchChain
2549
- - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326)
2550
-
2551
- **Example**
2552
-
2553
- ```ts
2554
- import { createWalletClient, custom } from 'viem'
2555
- import { mainnet, optimism } from 'viem/chains'
2556
-
2557
- const client = createWalletClient({
2558
- chain: mainnet,
2559
- transport: custom(window.ethereum),
2560
- })
2561
- await client.switchChain({ id: optimism.id })
2562
- ```
2563
-
2564
- ##### transport
2565
-
2566
- [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>
2567
-
2568
- The RPC transport
2569
-
2570
- ##### type
2571
-
2572
- `string`
2573
-
2574
- The type of client.
2575
-
2576
- ##### uid
2577
-
2578
- `string`
2579
-
2580
- A unique ID for the client.
2581
-
2582
- ##### waitForCallsStatus
2583
-
2584
- (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>
2585
-
2586
- Waits for the status & receipts of a call bundle that was sent via `sendCalls`.
2587
-
2588
- - Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus
2589
- - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)
2590
-
2591
- **Example**
2592
-
2593
- ```ts
2594
- import { createWalletClient, custom } from 'viem'
2595
- import { mainnet } from 'viem/chains'
2596
-
2597
- const client = createWalletClient({
2598
- chain: mainnet,
2599
- transport: custom(window.ethereum),
2600
- })
2601
-
2602
- const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' })
2603
- ```
2604
-
2605
- ##### watchAsset
2606
-
2607
- (`args`) => `Promise`\<`boolean`\>
2608
-
2609
- Adds an EVM chain to the wallet.
2610
-
2611
- - Docs: https://viem.sh/docs/actions/wallet/watchAsset
2612
- - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747)
2613
-
2614
- **Example**
2615
-
2616
- ```ts
2617
- import { createWalletClient, custom } from 'viem'
2618
- import { mainnet } from 'viem/chains'
2619
-
2620
- const client = createWalletClient({
2621
- chain: mainnet,
2622
- transport: custom(window.ethereum),
2623
- })
2624
- const success = await client.watchAsset({
2625
- type: 'ERC20',
2626
- options: {
2627
- address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
2628
- decimals: 18,
2629
- symbol: 'WETH',
2630
- },
2631
- })
2632
- ```
2633
-
2634
- ##### writeContract
2635
-
2636
- \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>
2637
-
2638
- Executes a write function on a contract.
2639
-
2640
- - Docs: https://viem.sh/docs/contract/writeContract
2641
- - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts
2642
-
2643
- A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state.
2644
-
2645
- Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
2646
-
2647
- __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__
2648
-
2649
- **Examples**
2650
-
2651
- ```ts
2652
- import { createWalletClient, custom, parseAbi } from 'viem'
2653
- import { mainnet } from 'viem/chains'
2654
-
2655
- const client = createWalletClient({
2656
- chain: mainnet,
2657
- transport: custom(window.ethereum),
2658
- })
2659
- const hash = await client.writeContract({
2660
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
2661
- abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
2662
- functionName: 'mint',
2663
- args: [69420],
2664
- })
2665
- ```
2666
-
2667
- ```ts
2668
- // With Validation
2669
- import { createWalletClient, custom, parseAbi } from 'viem'
2670
- import { mainnet } from 'viem/chains'
2671
-
2672
- const client = createWalletClient({
2673
- chain: mainnet,
2674
- transport: custom(window.ethereum),
2675
- })
2676
- const { request } = await client.simulateContract({
2677
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
2678
- abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
2679
- functionName: 'mint',
2680
- args: [69420],
2681
- }
2682
- const hash = await client.writeContract(request)
2683
- ```
2684
-
2685
- ##### writeContractSync
2686
-
2687
- \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>
2688
-
2689
- Executes a write function on a contract synchronously.
2690
- Returns the transaction receipt.
2691
-
2692
- - Docs: https://viem.sh/docs/contract/writeContract
2693
-
2694
- A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state.
2695
-
2696
- Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
2697
-
2698
- __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__
2699
-
2700
- **Example**
2701
-
2702
- ```ts
2703
- import { createWalletClient, custom, parseAbi } from 'viem'
2704
- import { mainnet } from 'viem/chains'
2705
-
2706
- const client = createWalletClient({
2707
- chain: mainnet,
2708
- transport: custom(window.ethereum),
2709
- })
2710
- const receipt = await client.writeContractSync({
2711
- address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
2712
- abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
2713
- functionName: 'mint',
2714
- args: [69420],
2715
- })
2716
- ```
2717
-
2718
- ### Returns
2719
-
2720
- [`RegistryActions`](../type-aliases/RegistryActions.md)