@aastar/sdk 0.16.11 → 0.16.12

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