@aastar/sdk 0.16.8 → 0.16.11

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 (1091) hide show
  1. package/.github/workflows/gas-analytics-daily.yml +52 -0
  2. package/.gitmodules +9 -0
  3. package/CHANGELOG.md +43 -0
  4. package/README.md +147 -98
  5. package/aastar-sdk.code-workspace +14 -0
  6. package/abis/BLSAggregator.json +572 -0
  7. package/abis/BLSValidator.json +39 -0
  8. package/abis/DVTValidator.json +383 -0
  9. package/abis/Eip7702Support.json +24 -0
  10. package/abis/EntryPoint.json +1379 -0
  11. package/abis/GToken.json +510 -0
  12. package/abis/GTokenStaking.json +918 -0
  13. package/abis/LegacyAccount.json +625 -0
  14. package/abis/MySBT.json +1547 -0
  15. package/abis/Paymaster.json +1192 -0
  16. package/abis/PaymasterFactory.json +637 -0
  17. package/abis/PaymasterV4_2.json +1193 -0
  18. package/abis/Registry.json +1677 -0
  19. package/abis/ReputationSystem.json +659 -0
  20. package/abis/SenderCreator.json +99 -0
  21. package/abis/Simple7702Account.json +395 -0
  22. package/abis/SimpleAccount.json +625 -0
  23. package/abis/SimpleAccountFactory.json +108 -0
  24. package/abis/SimpleAccountFactoryV08.json +87 -0
  25. package/abis/SimpleAccountV08.json +557 -0
  26. package/abis/SuperPaymaster.json +1568 -0
  27. package/abis/UserOperationLib.json +57 -0
  28. package/abis/aPNTs.json +1160 -0
  29. package/abis/xPNTsFactory.json +715 -0
  30. package/abis/xPNTsToken.json +1160 -0
  31. package/backup/run_sdk_regression.sh +135 -0
  32. package/config/networks/README.md +54 -0
  33. package/config/networks/mainnet.env.example +39 -0
  34. package/config/networks/optimism-sepolia.env.example +35 -0
  35. package/config/networks/optimism.env.example +36 -0
  36. package/config/networks/sepolia.env.example +36 -0
  37. package/config.anvil.json +1 -0
  38. package/config.sepolia.json +19 -0
  39. package/config.test.json +27 -0
  40. package/data/experiment_data.csv +36 -0
  41. package/data/industry_baseline_2025-12-23.json +154 -0
  42. package/data/industry_baseline_latest.json +154 -0
  43. package/docs/ABI_MAINTENANCE_PLAN.md +132 -0
  44. package/docs/API_REFERENCE.md +796 -0
  45. package/docs/Configuration_Sync.md +47 -0
  46. package/docs/DAO_Mining_Distribution_Plan.md +522 -0
  47. package/docs/DEMO_REFACTOR_PLAN.md +289 -0
  48. package/docs/DOCUMENTATION_PLAN.md +455 -0
  49. package/docs/ENV_SEPOLIA_UPDATE.md +68 -0
  50. package/docs/L2_BUSINESS_CLIENTS_PLAN.md +394 -0
  51. package/docs/L4_Manual_Test_CheatSheet.md +172 -0
  52. package/docs/Plan.md +266 -0
  53. package/docs/Regression_Testing_Guide.md +70 -0
  54. package/docs/Reputation-to-Credit_Mapping_Whitepaper.md +242 -0
  55. package/docs/SDK_ABI_COVERAGE.md +839 -0
  56. package/docs/SDK_COVERAGE_STRATEGY.md +397 -0
  57. package/docs/SDK_Optimization_Evaluation_Plan.md +51 -0
  58. package/docs/SDK_REGRESSION_AND_API_PLAN.md +98 -0
  59. package/docs/SDK_STAGE3_PLAN.md +151 -0
  60. package/docs/SEPOLIA_ENV_REFERENCE.md +51 -0
  61. package/docs/STAGE3.md +191 -0
  62. package/docs/Script_Comparison_Report.md +91 -0
  63. package/docs/Sepolia_Latest_Deployment.md +117 -0
  64. package/docs/TESTER_GUIDE_GASLESS.md +409 -0
  65. package/docs/TEST_COVERAGE_MATRIX.md +72 -0
  66. package/docs/TODO_SDK_COVERAGE.md +55 -0
  67. package/docs/USER_CASE_DESIGN.md +110 -0
  68. package/docs/Verifier_L4_Gasless_Plan.md +454 -0
  69. package/docs/api/@aastar/account/README.md +15 -0
  70. package/docs/api/@aastar/account/classes/UserOpClient.md +87 -0
  71. package/docs/api/@aastar/account/functions/createEOAWalletClient.md +21 -0
  72. package/docs/api/@aastar/account/functions/getUserOpHash.md +23 -0
  73. package/docs/api/@aastar/account/functions/packUserOpLimits.md +19 -0
  74. package/docs/api/@aastar/account/functions/toSimpleSmartAccount.md +83 -0
  75. package/docs/api/@aastar/account/type-aliases/EOAWalletClient.md +37 -0
  76. package/docs/api/@aastar/account/type-aliases/SimpleSmartAccount.md +39 -0
  77. package/docs/api/@aastar/core/README.md +211 -0
  78. package/docs/api/@aastar/core/classes/BLSSigner.md +147 -0
  79. package/docs/api/@aastar/core/classes/BaseClient.md +9657 -0
  80. package/docs/api/@aastar/core/classes/ContractConfigManager.md +25 -0
  81. package/docs/api/@aastar/core/classes/RequirementChecker.md +1837 -0
  82. package/docs/api/@aastar/core/classes/SepoliaFaucetAPI.md +13661 -0
  83. package/docs/api/@aastar/core/classes/StateValidator.md +133 -0
  84. package/docs/api/@aastar/core/enumerations/EntryPointVersion.md +17 -0
  85. package/docs/api/@aastar/core/enumerations/NodeType.md +33 -0
  86. package/docs/api/@aastar/core/enumerations/RolePermissionLevel.md +43 -0
  87. package/docs/api/@aastar/core/functions/accountActions.md +2720 -0
  88. package/docs/api/@aastar/core/functions/accountFactoryActions.md +2720 -0
  89. package/docs/api/@aastar/core/functions/aggregatorActions.md +2720 -0
  90. package/docs/api/@aastar/core/functions/createAAStarPublicClient.md +3105 -0
  91. package/docs/api/@aastar/core/functions/dvtActions.md +2720 -0
  92. package/docs/api/@aastar/core/functions/entryPointActions.md +2724 -0
  93. package/docs/api/@aastar/core/functions/gTokenActions.md +2714 -0
  94. package/docs/api/@aastar/core/functions/gTokenExtendedActions.md +2720 -0
  95. package/docs/api/@aastar/core/functions/getAddressUrl.md +32 -0
  96. package/docs/api/@aastar/core/functions/getAllCommunityConfigs.md +9 -0
  97. package/docs/api/@aastar/core/functions/getAllV2Contracts.md +20 -0
  98. package/docs/api/@aastar/core/functions/getBlockExplorer.md +26 -0
  99. package/docs/api/@aastar/core/functions/getChainId.md +26 -0
  100. package/docs/api/@aastar/core/functions/getCommunities.md +76 -0
  101. package/docs/api/@aastar/core/functions/getCommunity.md +32 -0
  102. package/docs/api/@aastar/core/functions/getCommunityConfig.md +15 -0
  103. package/docs/api/@aastar/core/functions/getContract.md +37 -0
  104. package/docs/api/@aastar/core/functions/getContractNetworks.md +18 -0
  105. package/docs/api/@aastar/core/functions/getContracts.md +194 -0
  106. package/docs/api/@aastar/core/functions/getCoreContracts.md +71 -0
  107. package/docs/api/@aastar/core/functions/getDeploymentDate.md +32 -0
  108. package/docs/api/@aastar/core/functions/getEntryPoint.md +25 -0
  109. package/docs/api/@aastar/core/functions/getNetwork.md +26 -0
  110. package/docs/api/@aastar/core/functions/getPaymasterV4_1.md +25 -0
  111. package/docs/api/@aastar/core/functions/getRoleName.md +15 -0
  112. package/docs/api/@aastar/core/functions/getRpcUrl.md +25 -0
  113. package/docs/api/@aastar/core/functions/getSimpleAccountFactory.md +25 -0
  114. package/docs/api/@aastar/core/functions/getSuperPaymasterV2.md +25 -0
  115. package/docs/api/@aastar/core/functions/getTestAccounts.md +30 -0
  116. package/docs/api/@aastar/core/functions/getTestTokenContracts.md +38 -0
  117. package/docs/api/@aastar/core/functions/getTokenContracts.md +31 -0
  118. package/docs/api/@aastar/core/functions/getTxUrl.md +32 -0
  119. package/docs/api/@aastar/core/functions/getV2ContractByAddress.md +28 -0
  120. package/docs/api/@aastar/core/functions/getV2ContractByName.md +28 -0
  121. package/docs/api/@aastar/core/functions/getV2ContractsByDate.md +26 -0
  122. package/docs/api/@aastar/core/functions/isContractNetworkSupported.md +27 -0
  123. package/docs/api/@aastar/core/functions/isRegisteredCommunity.md +15 -0
  124. package/docs/api/@aastar/core/functions/isV2Contract.md +27 -0
  125. package/docs/api/@aastar/core/functions/paymasterActions.md +2720 -0
  126. package/docs/api/@aastar/core/functions/paymasterFactoryActions.md +2720 -0
  127. package/docs/api/@aastar/core/functions/registryActions.md +2720 -0
  128. package/docs/api/@aastar/core/functions/reputationActions.md +2720 -0
  129. package/docs/api/@aastar/core/functions/sbtActions.md +2720 -0
  130. package/docs/api/@aastar/core/functions/stakingActions.md +2720 -0
  131. package/docs/api/@aastar/core/functions/superPaymasterActions.md +2720 -0
  132. package/docs/api/@aastar/core/functions/tokenActions.md +2714 -0
  133. package/docs/api/@aastar/core/functions/xPNTsFactoryActions.md +2720 -0
  134. package/docs/api/@aastar/core/interfaces/AccountBalance.md +41 -0
  135. package/docs/api/@aastar/core/interfaces/BalanceValidationParams.md +51 -0
  136. package/docs/api/@aastar/core/interfaces/ClientConfig.md +4841 -0
  137. package/docs/api/@aastar/core/interfaces/CommunityConfig.md +81 -0
  138. package/docs/api/@aastar/core/interfaces/ContractVersion.md +63 -0
  139. package/docs/api/@aastar/core/interfaces/DeploymentValidationParams.md +39 -0
  140. package/docs/api/@aastar/core/interfaces/RoleConfig.md +83 -0
  141. package/docs/api/@aastar/core/interfaces/RoleRequirement.md +43 -0
  142. package/docs/api/@aastar/core/interfaces/RoleValidationParams.md +55 -0
  143. package/docs/api/@aastar/core/interfaces/SuperPaymasterConfig.md +57 -0
  144. package/docs/api/@aastar/core/interfaces/TokenBalanceValidationParams.md +63 -0
  145. package/docs/api/@aastar/core/interfaces/TransactionOptions.md +24 -0
  146. package/docs/api/@aastar/core/interfaces/ValidationParams.md +25 -0
  147. package/docs/api/@aastar/core/interfaces/ValidationResult.md +25 -0
  148. package/docs/api/@aastar/core/type-aliases/AccountActions.md +151 -0
  149. package/docs/api/@aastar/core/type-aliases/AccountFactoryActions.md +55 -0
  150. package/docs/api/@aastar/core/type-aliases/AggregatorActions.md +471 -0
  151. package/docs/api/@aastar/core/type-aliases/BusinessResult.md +12 -0
  152. package/docs/api/@aastar/core/type-aliases/ContractCategory.md +5 -0
  153. package/docs/api/@aastar/core/type-aliases/ContractNetwork.md +5 -0
  154. package/docs/api/@aastar/core/type-aliases/DVTActions.md +319 -0
  155. package/docs/api/@aastar/core/type-aliases/EntryPointActions.md +103 -0
  156. package/docs/api/@aastar/core/type-aliases/GTokenExtendedActions.md +239 -0
  157. package/docs/api/@aastar/core/type-aliases/NetworkContracts.md +5 -0
  158. package/docs/api/@aastar/core/type-aliases/PaymasterActions.md +1087 -0
  159. package/docs/api/@aastar/core/type-aliases/PaymasterFactoryActions.md +263 -0
  160. package/docs/api/@aastar/core/type-aliases/RegistryActions.md +1543 -0
  161. package/docs/api/@aastar/core/type-aliases/ReputationActions.md +811 -0
  162. package/docs/api/@aastar/core/type-aliases/SBTActions.md +1199 -0
  163. package/docs/api/@aastar/core/type-aliases/StakingActions.md +703 -0
  164. package/docs/api/@aastar/core/type-aliases/SuperPaymasterActions.md +1311 -0
  165. package/docs/api/@aastar/core/type-aliases/SupportedNetwork.md +3 -0
  166. package/docs/api/@aastar/core/type-aliases/TokenActions.md +1227 -0
  167. package/docs/api/@aastar/core/type-aliases/XPNTsFactoryActions.md +395 -0
  168. package/docs/api/@aastar/core/variables/AASTAR_COMMUNITY.md +8 -0
  169. package/docs/api/@aastar/core/variables/ALL_ADDRESSES.md +75 -0
  170. package/docs/api/@aastar/core/variables/ALL_ROLES.md +5 -0
  171. package/docs/api/@aastar/core/variables/APNTS_ADDRESS.md +3 -0
  172. package/docs/api/@aastar/core/variables/BLSAggregatorABI.md +3 -0
  173. package/docs/api/@aastar/core/variables/BLSAggregatorArtifact.md +13 -0
  174. package/docs/api/@aastar/core/variables/BLSHelpers.md +101 -0
  175. package/docs/api/@aastar/core/variables/BLSValidatorABI.md +3 -0
  176. package/docs/api/@aastar/core/variables/BLSValidatorArtifact.md +13 -0
  177. package/docs/api/@aastar/core/variables/BLS_AGGREGATOR_ADDRESS.md +3 -0
  178. package/docs/api/@aastar/core/variables/BLS_VALIDATOR_ADDRESS.md +3 -0
  179. package/docs/api/@aastar/core/variables/BPS_DENOMINATOR.md +5 -0
  180. package/docs/api/@aastar/core/variables/BRANDING.md +67 -0
  181. package/docs/api/@aastar/core/variables/BREAD_COMMUNITY.md +8 -0
  182. package/docs/api/@aastar/core/variables/CHAIN_MAINNET.md +3 -0
  183. package/docs/api/@aastar/core/variables/CHAIN_SEPOLIA.md +5 -0
  184. package/docs/api/@aastar/core/variables/COMMUNITIES.md +5 -0
  185. package/docs/api/@aastar/core/variables/COMMUNITY_OWNERS.md +15 -0
  186. package/docs/api/@aastar/core/variables/CONTRACTS.md +179 -0
  187. package/docs/api/@aastar/core/variables/CONTRACT_METADATA.md +67 -0
  188. package/docs/api/@aastar/core/variables/CONTRACT_SRC_HASH.md +5 -0
  189. package/docs/api/@aastar/core/variables/CORE_ADDRESSES.md +51 -0
  190. package/docs/api/@aastar/core/variables/DEFAULT_ADMIN_ROLE.md +17 -0
  191. package/docs/api/@aastar/core/variables/DEFAULT_APNTS_PRICE_USD.md +5 -0
  192. package/docs/api/@aastar/core/variables/DEFAULT_CALL_GAS_LIMIT.md +3 -0
  193. package/docs/api/@aastar/core/variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md +5 -0
  194. package/docs/api/@aastar/core/variables/DEFAULT_PRE_VERIFICATION_GAS.md +3 -0
  195. package/docs/api/@aastar/core/variables/DEFAULT_TIMEOUT_MS.md +5 -0
  196. package/docs/api/@aastar/core/variables/DEFAULT_TOKEN_NAME.md +3 -0
  197. package/docs/api/@aastar/core/variables/DEFAULT_TOKEN_SYMBOL.md +5 -0
  198. package/docs/api/@aastar/core/variables/DEFAULT_USDT_MINT_AMOUNT.md +5 -0
  199. package/docs/api/@aastar/core/variables/DEFAULT_VERIFICATION_GAS_LIMIT.md +5 -0
  200. package/docs/api/@aastar/core/variables/DVTValidatorABI.md +3 -0
  201. package/docs/api/@aastar/core/variables/DVTValidatorArtifact.md +13 -0
  202. package/docs/api/@aastar/core/variables/DVT_VALIDATOR_ADDRESS.md +3 -0
  203. package/docs/api/@aastar/core/variables/ENTRY_POINT_0_8_ADDRESS.md +3 -0
  204. package/docs/api/@aastar/core/variables/ENTRY_POINT_0_9_ADDRESS.md +3 -0
  205. package/docs/api/@aastar/core/variables/ENTRY_POINT_ADDRESS.md +3 -0
  206. package/docs/api/@aastar/core/variables/EntryPointABI.md +3 -0
  207. package/docs/api/@aastar/core/variables/EntryPointArtifact.md +13 -0
  208. package/docs/api/@aastar/core/variables/FAUCET_API_URL.md +5 -0
  209. package/docs/api/@aastar/core/variables/GTOKEN_ADDRESS.md +3 -0
  210. package/docs/api/@aastar/core/variables/GTOKEN_STAKING_ADDRESS.md +3 -0
  211. package/docs/api/@aastar/core/variables/GTokenABI.md +3 -0
  212. package/docs/api/@aastar/core/variables/GTokenArtifact.md +13 -0
  213. package/docs/api/@aastar/core/variables/GTokenStakingABI.md +3 -0
  214. package/docs/api/@aastar/core/variables/GTokenStakingArtifact.md +13 -0
  215. package/docs/api/@aastar/core/variables/INITIAL_ROLE_STAKES.md +13 -0
  216. package/docs/api/@aastar/core/variables/LINKS.md +33 -0
  217. package/docs/api/@aastar/core/variables/MAX_SERVICE_FEE.md +5 -0
  218. package/docs/api/@aastar/core/variables/MONITORING_ADDRESSES.md +15 -0
  219. package/docs/api/@aastar/core/variables/MySBTABI.md +3 -0
  220. package/docs/api/@aastar/core/variables/MySBTArtifact.md +13 -0
  221. package/docs/api/@aastar/core/variables/NETWORKS.md +79 -0
  222. package/docs/api/@aastar/core/variables/NODE_STAKE_AMOUNTS.md +31 -0
  223. package/docs/api/@aastar/core/variables/OFFICIAL_ADDRESSES.md +11 -0
  224. package/docs/api/@aastar/core/variables/PAYMASTER_ADDRESSES.md +15 -0
  225. package/docs/api/@aastar/core/variables/PAYMASTER_FACTORY_ADDRESS.md +3 -0
  226. package/docs/api/@aastar/core/variables/PAYMASTER_V4_IMPL_ADDRESS.md +3 -0
  227. package/docs/api/@aastar/core/variables/PaymasterABI.md +3 -0
  228. package/docs/api/@aastar/core/variables/PaymasterArtifact.md +13 -0
  229. package/docs/api/@aastar/core/variables/PaymasterFactoryABI.md +3 -0
  230. package/docs/api/@aastar/core/variables/PaymasterFactoryArtifact.md +13 -0
  231. package/docs/api/@aastar/core/variables/PaymasterV4ABI.md +3 -0
  232. package/docs/api/@aastar/core/variables/PaymasterV4Artifact.md +13 -0
  233. package/docs/api/@aastar/core/variables/REGISTRY_ADDRESS.md +3 -0
  234. package/docs/api/@aastar/core/variables/REPUTATION_SYSTEM_ADDRESS.md +3 -0
  235. package/docs/api/@aastar/core/variables/ROLE_ANODE.md +29 -0
  236. package/docs/api/@aastar/core/variables/ROLE_COMMUNITY.md +29 -0
  237. package/docs/api/@aastar/core/variables/ROLE_DVT.md +29 -0
  238. package/docs/api/@aastar/core/variables/ROLE_ENDUSER.md +33 -0
  239. package/docs/api/@aastar/core/variables/ROLE_KMS.md +29 -0
  240. package/docs/api/@aastar/core/variables/ROLE_NAMES.md +3 -0
  241. package/docs/api/@aastar/core/variables/ROLE_PAYMASTER_AOA.md +29 -0
  242. package/docs/api/@aastar/core/variables/ROLE_PAYMASTER_SUPER.md +33 -0
  243. package/docs/api/@aastar/core/variables/ROLE_PERMISSION_LEVELS.md +3 -0
  244. package/docs/api/@aastar/core/variables/RegistryABI.md +3 -0
  245. package/docs/api/@aastar/core/variables/RegistryArtifact.md +13 -0
  246. package/docs/api/@aastar/core/variables/ReputationSystemABI.md +3 -0
  247. package/docs/api/@aastar/core/variables/ReputationSystemArtifact.md +13 -0
  248. package/docs/api/@aastar/core/variables/SBT_ADDRESS.md +3 -0
  249. package/docs/api/@aastar/core/variables/SEPOLIA_CONTRACTS.md +175 -0
  250. package/docs/api/@aastar/core/variables/SEPOLIA_V2_VERSIONS.md +67 -0
  251. package/docs/api/@aastar/core/variables/SERVICE_FEE_RATE.md +5 -0
  252. package/docs/api/@aastar/core/variables/SUPER_PAYMASTER_ADDRESS.md +3 -0
  253. package/docs/api/@aastar/core/variables/SimpleAccountABI.md +3 -0
  254. package/docs/api/@aastar/core/variables/SimpleAccountArtifact.md +13 -0
  255. package/docs/api/@aastar/core/variables/SimpleAccountFactoryABI.md +3 -0
  256. package/docs/api/@aastar/core/variables/SimpleAccountFactoryArtifact.md +13 -0
  257. package/docs/api/@aastar/core/variables/SuperPaymasterABI.md +3 -0
  258. package/docs/api/@aastar/core/variables/SuperPaymasterArtifact.md +13 -0
  259. package/docs/api/@aastar/core/variables/TEST_ACCOUNT_ADDRESSES.md +11 -0
  260. package/docs/api/@aastar/core/variables/TEST_ACCOUNT_POOL_SIZE.md +5 -0
  261. package/docs/api/@aastar/core/variables/TEST_COMMUNITIES.md +19 -0
  262. package/docs/api/@aastar/core/variables/TEST_TOKEN_ADDRESSES.md +19 -0
  263. package/docs/api/@aastar/core/variables/TOKEN_ADDRESSES.md +11 -0
  264. package/docs/api/@aastar/core/variables/V2_SUMMARY.md +39 -0
  265. package/docs/api/@aastar/core/variables/XPNTS_FACTORY_ADDRESS.md +3 -0
  266. package/docs/api/@aastar/core/variables/xPNTsFactoryABI.md +3 -0
  267. package/docs/api/@aastar/core/variables/xPNTsFactoryArtifact.md +13 -0
  268. package/docs/api/@aastar/core/variables/xPNTsTokenABI.md +3 -0
  269. package/docs/api/@aastar/core/variables/xPNTsTokenArtifact.md +13 -0
  270. package/docs/api/@aastar/paymaster/README.md +23 -0
  271. package/docs/api/@aastar/paymaster/classes/PaymasterClient.md +388 -0
  272. package/docs/api/@aastar/paymaster/classes/PaymasterOperator.md +451 -0
  273. package/docs/api/@aastar/paymaster/classes/SuperPaymasterAdminClient.md +189 -0
  274. package/docs/api/@aastar/paymaster/classes/SuperPaymasterClient.md +55 -0
  275. package/docs/api/@aastar/paymaster/functions/buildPaymasterData.md +34 -0
  276. package/docs/api/@aastar/paymaster/functions/buildSuperPaymasterData.md +30 -0
  277. package/docs/api/@aastar/paymaster/functions/checkEligibility.md +28 -0
  278. package/docs/api/@aastar/paymaster/functions/formatUserOpV07.md +15 -0
  279. package/docs/api/@aastar/paymaster/functions/getPaymasterV4Middleware.md +32 -0
  280. package/docs/api/@aastar/paymaster/functions/getSuperPaymasterMiddleware.md +32 -0
  281. package/docs/api/@aastar/paymaster/functions/getUserOpHashV07.md +21 -0
  282. package/docs/api/@aastar/paymaster/type-aliases/GaslessReadinessReport.md +55 -0
  283. package/docs/api/@aastar/paymaster/type-aliases/GaslessTransactionConfig.md +59 -0
  284. package/docs/api/@aastar/paymaster/type-aliases/PaymasterConfig.md +43 -0
  285. package/docs/api/@aastar/paymaster/type-aliases/PaymasterV4MiddlewareConfig.md +35 -0
  286. package/docs/api/@aastar/tokens/README.md +3 -0
  287. package/docs/api/@aastar/tokens/classes/FinanceClient.md +10385 -0
  288. package/docs/api/README.md +6 -0
  289. package/docs/examples/community-flow.md +28 -0
  290. package/docs/examples/enduser-flow.md +24 -0
  291. package/docs/examples/index.md +18 -0
  292. package/docs/examples/multi-chain.md +31 -0
  293. package/docs/examples/operator-flow.md +28 -0
  294. package/docs/guide/CLI_GUIDE.md +65 -0
  295. package/docs/guide/DOCUMENTATION_PLAN.md +455 -0
  296. package/docs/guide/Security-solution.md +106 -0
  297. package/docs/guide/TEST_COMMANDS.md +320 -0
  298. package/docs/guide/getting-started.md +133 -0
  299. package/docs/guide/installation.md +40 -0
  300. package/docs/guide/paper-data-collection.md +69 -0
  301. package/docs/guide/quick-start.md +52 -0
  302. package/docs/guide/task_breakdown.md +121 -0
  303. package/docs/old-solution.md +1078 -0
  304. package/docs/paper-data-collection.md +69 -0
  305. package/docs/technical_plan.md +510 -0
  306. package/docs/zh/examples/community-flow.md +38 -0
  307. package/docs/zh/examples/complete-workflow.md +10 -0
  308. package/docs/zh/examples/enduser-flow.md +33 -0
  309. package/docs/zh/examples/index.md +18 -0
  310. package/docs/zh/examples/multi-chain.md +46 -0
  311. package/docs/zh/examples/operator-flow.md +37 -0
  312. package/docs/zh/guide/CLI_GUIDE.md +48 -0
  313. package/docs/zh/guide/DOCUMENTATION_PLAN.md +455 -0
  314. package/docs/zh/guide/Plan.md +266 -0
  315. package/docs/zh/guide/SDK_Optimization_Evaluation_Plan.md +51 -0
  316. package/docs/zh/guide/Security-solution.md +106 -0
  317. package/docs/zh/guide/TEST_COMMANDS.md +125 -0
  318. package/docs/zh/guide/TEST_COVERAGE_MATRIX.md +72 -0
  319. package/docs/zh/guide/concepts/account-abstraction.md +95 -0
  320. package/docs/zh/guide/concepts/rainbow-bridge.md +68 -0
  321. package/docs/zh/guide/concepts/reputation.md +95 -0
  322. package/docs/zh/guide/concepts/superpaymaster.md +141 -0
  323. package/docs/zh/guide/getting-started.md +133 -0
  324. package/docs/zh/guide/installation.md +107 -0
  325. package/docs/zh/guide/old-solution.md +1078 -0
  326. package/docs/zh/guide/paper-data-collection.md +69 -0
  327. package/docs/zh/guide/quick-start.md +134 -0
  328. package/docs/zh/guide/sdk-readme.md +253 -0
  329. package/docs/zh/guide/task_breakdown.md +76 -0
  330. package/docs/zh/guide/technical_plan.md +510 -0
  331. package/docs/zh/guide/use-cases/community-management.md +141 -0
  332. package/docs/zh/guide/use-cases/gasless-transactions.md +71 -0
  333. package/docs/zh/guide/use-cases/operator-staking.md +84 -0
  334. package/docs/zh/guide/use-cases/yop.md +72 -0
  335. package/env.template +30 -0
  336. package/examples/l1-api-demo.ts +273 -0
  337. package/examples/l2-clients-demo.ts +135 -0
  338. package/examples/l3-community-launch.ts +49 -0
  339. package/examples/l3-user-onboarding.ts +56 -0
  340. package/examples/prepare-gasless.ts +89 -0
  341. package/examples/sdk-demo/DEVELOPER_GUIDE.md +159 -0
  342. package/examples/sdk-demo/README.md +30 -0
  343. package/examples/sdk-demo/usage.ts +137 -0
  344. package/examples/simple-gasless-demo.ts +109 -0
  345. package/examples/simple-superpaymaster-demo.ts +96 -0
  346. package/ext/aastar-shared-config/.env.example +6 -0
  347. package/ext/aastar-shared-config/.github/workflows/check-secrets.yml +257 -0
  348. package/ext/aastar-shared-config/AGENTS.md +21 -0
  349. package/ext/aastar-shared-config/CHANGELOG.md +99 -0
  350. package/ext/aastar-shared-config/LICENSE +21 -0
  351. package/ext/aastar-shared-config/QUICK_START.md +215 -0
  352. package/ext/aastar-shared-config/README.md +412 -0
  353. package/ext/aastar-shared-config/SHARED_CONFIG_SUMMARY.md +273 -0
  354. package/ext/aastar-shared-config/check-locker-status.mjs +7 -0
  355. package/ext/aastar-shared-config/favicon.ico +0 -0
  356. package/ext/aastar-shared-config/generate-comparison-table.sh +67 -0
  357. package/ext/aastar-shared-config/package.json +46 -0
  358. package/ext/aastar-shared-config/pnpm-lock.yaml +1182 -0
  359. package/ext/aastar-shared-config/src/abis/BLSAggregator.json +1 -0
  360. package/ext/aastar-shared-config/src/abis/DVTValidator.json +1 -0
  361. package/ext/aastar-shared-config/src/abis/GToken.json +1 -0
  362. package/ext/aastar-shared-config/src/abis/GTokenStaking.json +1 -0
  363. package/ext/aastar-shared-config/src/abis/MySBT.json +1 -0
  364. package/ext/aastar-shared-config/src/abis/PaymasterFactory.json +1 -0
  365. package/ext/aastar-shared-config/src/abis/PaymasterV4.json +1098 -0
  366. package/ext/aastar-shared-config/src/abis/Registry.json +1 -0
  367. package/ext/aastar-shared-config/src/abis/SimpleAccount.json +557 -0
  368. package/ext/aastar-shared-config/src/abis/SimpleAccountFactory.json +87 -0
  369. package/ext/aastar-shared-config/src/abis/SuperPaymasterV2.json +1 -0
  370. package/ext/aastar-shared-config/src/abis/index.ts +45 -0
  371. package/ext/aastar-shared-config/src/abis/xPNTsFactory.json +1 -0
  372. package/ext/aastar-shared-config/src/abis/xPNTsToken.json +1 -0
  373. package/ext/aastar-shared-config/src/branding.ts +32 -0
  374. package/ext/aastar-shared-config/src/communities.ts +93 -0
  375. package/ext/aastar-shared-config/src/constants.ts +67 -0
  376. package/ext/aastar-shared-config/src/contract-addresses.ts +95 -0
  377. package/ext/aastar-shared-config/src/contract-versions.ts +374 -0
  378. package/ext/aastar-shared-config/src/contracts.ts +414 -0
  379. package/ext/aastar-shared-config/src/index.ts +14 -0
  380. package/ext/aastar-shared-config/src/networks.ts +117 -0
  381. package/ext/aastar-shared-config/sync-abis.sh +92 -0
  382. package/ext/aastar-shared-config/sync-versions.mjs +150 -0
  383. package/ext/aastar-shared-config/tsconfig.json +18 -0
  384. package/ext/aastar-shared-config/tsup.config.ts +10 -0
  385. package/ext/aastar-shared-config/verify-all.sh +207 -0
  386. package/ext/aastar-shared-config/verify-contracts.sh +85 -0
  387. package/ext/aastar-shared-config/verify-mysbt-v243.mjs +27 -0
  388. package/ext/aastar-shared-config/verify-onchain-versions.mjs +93 -0
  389. package/l4-setup.sh +1 -0
  390. package/lib/SHARED_CONFIG_REFERENCE.md +133 -0
  391. package/lib/shared-config/.env.example +6 -0
  392. package/lib/shared-config/.github/workflows/check-secrets.yml +257 -0
  393. package/lib/shared-config/AGENTS.md +21 -0
  394. package/lib/shared-config/CHANGELOG.md +99 -0
  395. package/lib/shared-config/LICENSE +21 -0
  396. package/lib/shared-config/QUICK_START.md +215 -0
  397. package/lib/shared-config/README.md +412 -0
  398. package/lib/shared-config/SHARED_CONFIG_SUMMARY.md +273 -0
  399. package/lib/shared-config/check-locker-status.mjs +7 -0
  400. package/lib/shared-config/favicon.ico +0 -0
  401. package/lib/shared-config/generate-comparison-table.sh +67 -0
  402. package/lib/shared-config/package.json +46 -0
  403. package/lib/shared-config/pnpm-lock.yaml +1182 -0
  404. package/lib/shared-config/src/abis/BLSAggregator.json +1 -0
  405. package/lib/shared-config/src/abis/DVTValidator.json +1 -0
  406. package/lib/shared-config/src/abis/GToken.json +1 -0
  407. package/lib/shared-config/src/abis/GTokenStaking.json +1 -0
  408. package/lib/shared-config/src/abis/MySBT.json +1 -0
  409. package/lib/shared-config/src/abis/PaymasterFactory.json +1 -0
  410. package/lib/shared-config/src/abis/PaymasterV4.json +1098 -0
  411. package/lib/shared-config/src/abis/Registry.json +1 -0
  412. package/lib/shared-config/src/abis/SimpleAccount.json +557 -0
  413. package/lib/shared-config/src/abis/SimpleAccountFactory.json +87 -0
  414. package/lib/shared-config/src/abis/SuperPaymasterV2.json +1 -0
  415. package/lib/shared-config/src/abis/index.ts +45 -0
  416. package/lib/shared-config/src/abis/xPNTsFactory.json +1 -0
  417. package/lib/shared-config/src/abis/xPNTsToken.json +1 -0
  418. package/lib/shared-config/src/branding.ts +32 -0
  419. package/lib/shared-config/src/communities.ts +93 -0
  420. package/lib/shared-config/src/constants.ts +67 -0
  421. package/lib/shared-config/src/contract-addresses.ts +95 -0
  422. package/lib/shared-config/src/contract-versions.ts +374 -0
  423. package/lib/shared-config/src/contracts.ts +414 -0
  424. package/lib/shared-config/src/index.ts +14 -0
  425. package/lib/shared-config/src/networks.ts +117 -0
  426. package/lib/shared-config/sync-abis.sh +92 -0
  427. package/lib/shared-config/sync-versions.mjs +150 -0
  428. package/lib/shared-config/tsconfig.json +18 -0
  429. package/lib/shared-config/tsup.config.ts +10 -0
  430. package/lib/shared-config/verify-all.sh +207 -0
  431. package/lib/shared-config/verify-contracts.sh +85 -0
  432. package/lib/shared-config/verify-mysbt-v243.mjs +27 -0
  433. package/lib/shared-config/verify-onchain-versions.mjs +93 -0
  434. package/package.json +60 -38
  435. package/packages/account/__tests__/index.test.ts +9 -0
  436. package/packages/account/node_modules/.bin/tsc +21 -0
  437. package/packages/account/node_modules/.bin/tsserver +21 -0
  438. package/packages/account/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  439. package/packages/account/package.json +21 -0
  440. package/packages/account/src/accounts/simple.ts +84 -0
  441. package/packages/account/src/eoa.ts +31 -0
  442. package/packages/account/src/index.ts +61 -0
  443. package/packages/account/tsconfig.json +12 -0
  444. package/packages/analytics/README.md +68 -0
  445. package/packages/analytics/__tests__/index.test.ts +25 -0
  446. package/packages/analytics/data/attribution_dataset.csv +29 -0
  447. package/packages/analytics/data/complete_dataset.csv +29 -0
  448. package/packages/analytics/data/eth_price_cache.json +4 -0
  449. package/packages/analytics/data/full_dataset.csv +11 -0
  450. package/packages/analytics/data/full_dataset.json +134 -0
  451. package/packages/analytics/data/parsed_transactions.csv +29 -0
  452. package/packages/analytics/node_modules/.bin/tsc +21 -0
  453. package/packages/analytics/node_modules/.bin/tsserver +21 -0
  454. package/packages/analytics/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  455. package/packages/analytics/package.json +25 -0
  456. package/packages/analytics/reports/full/attribution_analysis_20260119.md +42 -0
  457. package/packages/analytics/reports/full/attribution_analysis_fresh_20260119.md +67 -0
  458. package/packages/analytics/reports/full/competitive_analysis_20260119.md +103 -0
  459. package/packages/analytics/reports/full/comprehensive_analysis_20260119.md +107 -0
  460. package/packages/analytics/reports/full/comprehensive_analysis_v4_1_20260119.md +74 -0
  461. package/packages/analytics/reports/full/economic_audit_v4_2_20260119.md +74 -0
  462. package/packages/analytics/reports/full/profit_audit_v4_3_20260119.md +74 -0
  463. package/packages/analytics/reports/full/profit_audit_v4_4_20260119.md +74 -0
  464. package/packages/analytics/reports/full/profit_audit_v4_5_20260119.md +74 -0
  465. package/packages/analytics/reports/full/profit_audit_v4_6_20260119.md +74 -0
  466. package/packages/analytics/reports/full/profit_audit_v4_final_20260119.md +74 -0
  467. package/packages/analytics/reports/full/profit_audit_v4_final_v2_20260119.md +74 -0
  468. package/packages/analytics/reports/full/profit_audit_v4_final_v3_20260119.md +74 -0
  469. package/packages/analytics/reports/full/profit_audit_v4_final_v4_20260119.md +75 -0
  470. package/packages/analytics/reports/full/profit_audit_v4_final_v5_20260119.md +76 -0
  471. package/packages/analytics/reports/full/two_layer_analysis_20260119.md +81 -0
  472. package/packages/analytics/reports/full/two_layer_analysis_academic_20260119.md +81 -0
  473. package/packages/analytics/reports/full/two_layer_analysis_dynamic_20260119.md +81 -0
  474. package/packages/analytics/reports/full/two_layer_analysis_final_20260119.md +81 -0
  475. package/packages/analytics/reports/full/two_layer_analysis_final_fixed_20260119.md +81 -0
  476. package/packages/analytics/reports/full/two_layer_analysis_fixed_20260119.md +52 -0
  477. package/packages/analytics/reports/full/two_layer_analysis_normalized_20260119.md +81 -0
  478. package/packages/analytics/reports/full/tx_0xc30cfcbb.md +39 -0
  479. package/packages/analytics/src/analyzers/AttributionAnalyzer.ts +124 -0
  480. package/packages/analytics/src/analyzers/ComparisonAnalyzer.ts +89 -0
  481. package/packages/analytics/src/analyzers/TransactionAnalyzer.ts +111 -0
  482. package/packages/analytics/src/analyzers/TrendAnalyzer.ts +107 -0
  483. package/packages/analytics/src/cli-analyze-tx.ts +45 -0
  484. package/packages/analytics/src/cli.ts +39 -0
  485. package/packages/analytics/src/core/BenchmarkLoader.ts +163 -0
  486. package/packages/analytics/src/core/CostCalculator.ts +202 -0
  487. package/packages/analytics/src/core/DataCollector.ts +245 -0
  488. package/packages/analytics/src/gas-analyzer-v4.ts +118 -0
  489. package/packages/analytics/src/gas-analyzer.ts +184 -0
  490. package/packages/analytics/src/index.ts +145 -0
  491. package/packages/analytics/src/test-logparser.ts +63 -0
  492. package/packages/analytics/src/utils/EventDecoder.ts +152 -0
  493. package/packages/analytics/src/utils/LogParser.ts +220 -0
  494. package/packages/analytics/src/utils/PriceOracle.ts +117 -0
  495. package/packages/analytics/test/AttributionAnalyzer.test.ts +42 -0
  496. package/packages/analytics/test/CostCalculator.test.ts +75 -0
  497. package/packages/analytics/tsconfig.json +12 -0
  498. package/packages/community/__tests__/index.test.ts +9 -0
  499. package/packages/community/node_modules/.bin/tsc +21 -0
  500. package/packages/community/node_modules/.bin/tsserver +21 -0
  501. package/packages/community/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  502. package/packages/community/package.json +27 -0
  503. package/packages/community/src/index.ts +326 -0
  504. package/packages/community/tsconfig.json +8 -0
  505. package/packages/core/__tests__/actions/account-comprehensive.test.ts +92 -0
  506. package/packages/core/__tests__/actions/aggregator.test.ts +62 -0
  507. package/packages/core/__tests__/actions/comprehensive-batch1.test.ts +86 -0
  508. package/packages/core/__tests__/actions/comprehensive-batch2.test.ts +39 -0
  509. package/packages/core/__tests__/actions/comprehensive-batch3.test.ts +35 -0
  510. package/packages/core/__tests__/actions/comprehensive-error.test.ts +115 -0
  511. package/packages/core/__tests__/actions/dvt.test.ts +39 -0
  512. package/packages/core/__tests__/actions/edge-cases.test.ts +39 -0
  513. package/packages/core/__tests__/actions/error-paths.test.ts +82 -0
  514. package/packages/core/__tests__/actions/factory.test.ts +81 -0
  515. package/packages/core/__tests__/actions/faucet.test.ts +131 -0
  516. package/packages/core/__tests__/actions/paymaster.test.ts +116 -0
  517. package/packages/core/__tests__/actions/registry.test.ts +81 -0
  518. package/packages/core/__tests__/actions/reputation.test.ts +43 -0
  519. package/packages/core/__tests__/actions/sbt.test.ts +145 -0
  520. package/packages/core/__tests__/actions/staking.test.ts +30 -0
  521. package/packages/core/__tests__/actions/superPaymaster.test.ts +158 -0
  522. package/packages/core/__tests__/actions/tokens-extended.test.ts +18 -0
  523. package/packages/core/__tests__/actions/tokens.test.ts +122 -0
  524. package/packages/core/__tests__/clients.test.ts +77 -0
  525. package/packages/core/__tests__/contracts-config.test.ts +69 -0
  526. package/packages/core/__tests__/index.test.ts +9 -0
  527. package/packages/core/__tests__/mocks/client.ts +40 -0
  528. package/packages/core/node_modules/.bin/tsc +21 -0
  529. package/packages/core/node_modules/.bin/tsserver +21 -0
  530. package/packages/core/node_modules/.bin/tsx +21 -0
  531. package/packages/core/node_modules/.bin/vite +21 -0
  532. package/packages/core/node_modules/.bin/vitest +21 -0
  533. package/packages/core/node_modules/.bin/yaml +21 -0
  534. package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  535. package/packages/core/package.json +25 -0
  536. package/packages/core/src/abis/BLSAggregator.json +686 -0
  537. package/packages/core/src/abis/BLSValidator.json +42 -0
  538. package/packages/core/src/abis/DVTValidator.json +368 -0
  539. package/packages/core/src/abis/Eip7702Support.json +24 -0
  540. package/packages/core/src/abis/EntryPoint.json +1382 -0
  541. package/packages/core/src/abis/GToken.json +513 -0
  542. package/packages/core/src/abis/GTokenStaking.json +949 -0
  543. package/packages/core/src/abis/LegacyAccount.json +625 -0
  544. package/packages/core/src/abis/MySBT.json +1518 -0
  545. package/packages/core/src/abis/Paymaster.json +1143 -0
  546. package/packages/core/src/abis/PaymasterFactory.json +640 -0
  547. package/packages/core/src/abis/Registry.json +1942 -0
  548. package/packages/core/src/abis/ReputationSystem.json +699 -0
  549. package/packages/core/src/abis/SenderCreator.json +99 -0
  550. package/packages/core/src/abis/Simple7702Account.json +395 -0
  551. package/packages/core/src/abis/SimpleAccount.json +560 -0
  552. package/packages/core/src/abis/SimpleAccountFactory.json +111 -0
  553. package/packages/core/src/abis/SimpleAccountFactoryV08.json +87 -0
  554. package/packages/core/src/abis/SimpleAccountV08.json +557 -0
  555. package/packages/core/src/abis/SuperPaymaster.json +1781 -0
  556. package/packages/core/src/abis/UserOperationLib.json +57 -0
  557. package/packages/core/src/abis/aPNTs.json +1160 -0
  558. package/packages/core/src/abis/abi.config.json +24 -0
  559. package/packages/core/src/abis/index.ts +91 -0
  560. package/packages/core/src/abis/xPNTsFactory.json +718 -0
  561. package/packages/core/src/abis/xPNTsToken.json +1280 -0
  562. package/packages/core/src/actions/StateValidator.ts +253 -0
  563. package/packages/core/src/actions/account.ts +190 -0
  564. package/packages/core/src/actions/aggregator.ts +371 -0
  565. package/packages/core/src/actions/dvt.ts +269 -0
  566. package/packages/core/src/actions/entryPoint.ts +89 -0
  567. package/packages/core/src/actions/factory.ts +732 -0
  568. package/packages/core/src/actions/faucet.ts +280 -0
  569. package/packages/core/src/actions/index.ts +15 -0
  570. package/packages/core/src/actions/paymaster.ts +780 -0
  571. package/packages/core/src/actions/registry.ts +961 -0
  572. package/packages/core/src/actions/reputation.ts +668 -0
  573. package/packages/core/src/actions/sbt.ts +916 -0
  574. package/packages/core/src/actions/staking.ts +576 -0
  575. package/packages/core/src/actions/superPaymaster.ts +1093 -0
  576. package/packages/core/src/actions/tokens.ts +481 -0
  577. package/packages/core/src/branding.ts +32 -0
  578. package/packages/core/src/clients/BaseClient.ts +78 -0
  579. package/packages/core/src/clients/BundlerClient.ts +132 -0
  580. package/packages/core/src/clients/types.ts +69 -0
  581. package/packages/core/src/clients.ts +13 -0
  582. package/packages/core/src/communities.ts +93 -0
  583. package/packages/core/src/config/ContractConfigManager.ts +63 -0
  584. package/packages/core/src/constants.ts +114 -0
  585. package/packages/core/src/contract-addresses.ts +118 -0
  586. package/packages/core/src/contract-versions.ts +374 -0
  587. package/packages/core/src/contracts.ts +414 -0
  588. package/packages/core/src/crypto/blsSigner.ts +124 -0
  589. package/packages/core/src/errors/index.ts +173 -0
  590. package/packages/core/src/index.ts +23 -0
  591. package/packages/core/src/networks.ts +127 -0
  592. package/packages/core/src/requirementChecker.ts +225 -0
  593. package/packages/core/src/roles.ts +244 -0
  594. package/packages/core/src/utils.ts +23 -0
  595. package/packages/core/src/validators/index.ts +88 -0
  596. package/packages/core/tsconfig.json +13 -0
  597. package/packages/dapp/__tests__/index.test.ts +9 -0
  598. package/packages/dapp/node_modules/.bin/tsc +21 -0
  599. package/packages/dapp/node_modules/.bin/tsserver +21 -0
  600. package/packages/dapp/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  601. package/packages/dapp/package.json +28 -0
  602. package/packages/dapp/src/index.ts +4 -0
  603. package/packages/dapp/src/ui/components/EvaluationPanel.tsx +40 -0
  604. package/packages/dapp/src/ui/hooks/useCreditScore.ts +44 -0
  605. package/packages/dapp/src/ui/hooks/useSuperPaymaster.ts +31 -0
  606. package/packages/dapp/src/ui/index.ts +22 -0
  607. package/packages/dapp/tsconfig.json +13 -0
  608. package/packages/enduser/__tests__/CommunityClient.test.ts +205 -0
  609. package/packages/enduser/__tests__/UserClient.test.ts +294 -0
  610. package/packages/enduser/__tests__/index.test.ts +16 -0
  611. package/packages/enduser/__tests__/mocks/client.ts +22 -0
  612. package/packages/enduser/node_modules/.bin/tsc +21 -0
  613. package/packages/enduser/node_modules/.bin/tsserver +21 -0
  614. package/packages/enduser/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  615. package/packages/enduser/package.json +26 -0
  616. package/packages/enduser/src/CommunityClient.ts +235 -0
  617. package/packages/enduser/src/UserClient.ts +447 -0
  618. package/packages/enduser/src/index.ts +2 -0
  619. package/packages/enduser/src/testAccountManager.ts +374 -0
  620. package/packages/enduser/tsconfig.json +10 -0
  621. package/packages/identity/__tests__/index.test.ts +9 -0
  622. package/packages/identity/node_modules/.bin/tsc +21 -0
  623. package/packages/identity/node_modules/.bin/tsserver +21 -0
  624. package/packages/identity/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  625. package/packages/identity/package.json +23 -0
  626. package/packages/identity/src/index.ts +114 -0
  627. package/packages/identity/src/mysbt.ts +48 -0
  628. package/packages/identity/tsconfig.json +12 -0
  629. package/packages/operator/__tests__/PaymasterOperatorClient.test.ts +258 -0
  630. package/packages/operator/__tests__/ProtocolClient.test.ts +135 -0
  631. package/packages/operator/__tests__/index.test.ts +16 -0
  632. package/packages/operator/__tests__/mocks/client.ts +22 -0
  633. package/packages/operator/node_modules/.bin/tsc +21 -0
  634. package/packages/operator/node_modules/.bin/tsserver +21 -0
  635. package/packages/operator/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  636. package/packages/operator/package.json +26 -0
  637. package/packages/operator/src/PaymasterOperatorClient.ts +454 -0
  638. package/packages/operator/src/ProtocolClient.ts +154 -0
  639. package/packages/operator/src/index.ts +2 -0
  640. package/packages/operator/tsconfig.json +10 -0
  641. package/packages/patterns/node_modules/.bin/tsc +21 -0
  642. package/packages/patterns/node_modules/.bin/tsserver +21 -0
  643. package/packages/paymaster/__tests__/PaymasterOperator.test.ts +123 -0
  644. package/packages/paymaster/__tests__/index.test.ts +9 -0
  645. package/packages/paymaster/node_modules/.bin/tsc +21 -0
  646. package/packages/paymaster/node_modules/.bin/tsserver +21 -0
  647. package/packages/paymaster/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  648. package/packages/paymaster/package.json +23 -0
  649. package/packages/paymaster/src/SuperPaymaster/index.ts +168 -0
  650. package/packages/paymaster/src/V4/BundlerCompat.ts +47 -0
  651. package/packages/paymaster/src/V4/PaymasterClient.ts +490 -0
  652. package/packages/paymaster/src/V4/PaymasterOperator.ts +282 -0
  653. package/packages/paymaster/src/V4/PaymasterUtils.ts +199 -0
  654. package/packages/paymaster/src/V4/SuperPaymasterClient.ts +129 -0
  655. package/packages/paymaster/src/index.ts +5 -0
  656. package/packages/paymaster/tsconfig.json +16 -0
  657. package/packages/sdk/README.md +171 -0
  658. package/packages/sdk/__tests__/index.test.ts +9 -0
  659. package/packages/sdk/aastar/package.json +21 -0
  660. package/packages/sdk/aastar/src/index.ts +3 -0
  661. package/packages/sdk/aastar/tsconfig.json +8 -0
  662. package/packages/sdk/node_modules/.bin/tsc +21 -0
  663. package/packages/sdk/node_modules/.bin/tsserver +21 -0
  664. package/packages/sdk/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  665. package/packages/sdk/package.json +34 -0
  666. package/packages/sdk/src/clients/ExperimentClient.ts +80 -0
  667. package/packages/sdk/src/clients/admin.ts +56 -0
  668. package/packages/sdk/src/clients/community.ts +403 -0
  669. package/packages/sdk/src/clients/endUser.ts +428 -0
  670. package/packages/sdk/src/clients/operator.ts +280 -0
  671. package/packages/sdk/src/errors/decoder.ts +48 -0
  672. package/packages/sdk/src/index.ts +24 -0
  673. package/packages/sdk/src/utils/errorHandler.ts +167 -0
  674. package/packages/sdk/src/utils/funding.ts +280 -0
  675. package/packages/sdk/src/utils/keys.ts +159 -0
  676. package/packages/sdk/src/utils/roleData.ts +151 -0
  677. package/packages/sdk/src/utils/testScenarios.ts +128 -0
  678. package/packages/sdk/src/utils/userOp.ts +257 -0
  679. package/packages/sdk/tests/scenarios/01_onboard_community.ts +62 -0
  680. package/packages/sdk/tests/scenarios/02_onboard_operator.ts +109 -0
  681. package/packages/sdk/tests/scenarios/03_onboard_user.ts +53 -0
  682. package/packages/sdk/tests/scenarios/04_gasless_tx_flow.ts +68 -0
  683. package/packages/sdk/tests/scenarios/check_entrypoint.ts +19 -0
  684. package/packages/sdk/tests/scenarios/check_initialization.ts +65 -0
  685. package/packages/sdk/tests/scenarios/debug_addresses.ts +26 -0
  686. package/packages/sdk/tests/scenarios/diagnose_scenario4.ts +55 -0
  687. package/packages/sdk/tests/scenarios/setup.ts +33 -0
  688. package/packages/sdk/tests/scenarios/test_entrypoint_nonce.ts +46 -0
  689. package/packages/sdk/tsconfig.json +12 -0
  690. package/packages/tokens/__tests__/index.test.ts +9 -0
  691. package/packages/tokens/node_modules/.bin/tsc +21 -0
  692. package/packages/tokens/node_modules/.bin/tsserver +21 -0
  693. package/packages/tokens/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  694. package/packages/tokens/package.json +23 -0
  695. package/packages/tokens/src/index.ts +258 -0
  696. package/packages/tokens/tsconfig.json +12 -0
  697. package/pnpm-workspace.yaml +2 -0
  698. package/publish.sh +30 -0
  699. package/run_l4_gasless_regression.sh +109 -0
  700. package/run_sdk_regression.sh +232 -0
  701. package/scripts/00_utils.ts +59 -0
  702. package/scripts/00_verify_phase1.ts +130 -0
  703. package/scripts/01_1_prep_gtoken.ts +81 -0
  704. package/scripts/01_2_register_sbt.ts +88 -0
  705. package/scripts/01_3_prep_tokens_paymaster.ts +102 -0
  706. package/scripts/01_prepare_all.ts +271 -0
  707. package/scripts/02_test_eoa.ts +50 -0
  708. package/scripts/03_test_standard_aa.ts +173 -0
  709. package/scripts/04_0_check_deploy.ts +24 -0
  710. package/scripts/04_1_check_allowance.ts +44 -0
  711. package/scripts/04_2_construct_verify.ts +96 -0
  712. package/scripts/04_3_verify_estimate.ts +66 -0
  713. package/scripts/04_4_verify_pack.ts +74 -0
  714. package/scripts/04_test_paymaster_v4.ts +217 -0
  715. package/scripts/05_1_deposit.ts +48 -0
  716. package/scripts/05_test_superpaymaster.ts +380 -0
  717. package/scripts/06_local_test_v3_admin.ts +163 -0
  718. package/scripts/06_local_test_v3_execution.ts +132 -0
  719. package/scripts/06_local_test_v3_full.ts +490 -0
  720. package/scripts/06_local_test_v3_funding.ts +124 -0
  721. package/scripts/06_local_test_v3_reputation.ts +234 -0
  722. package/scripts/07_local_test_v3_audit.ts +181 -0
  723. package/scripts/08_local_test_registry_lifecycle.ts +382 -0
  724. package/scripts/09_local_test_community_lifecycle.ts +385 -0
  725. package/scripts/09_local_test_community_simple.ts +108 -0
  726. package/scripts/09_scenario_bread_independent.ts +247 -0
  727. package/scripts/10_scenario_super_shared.ts +196 -0
  728. package/scripts/10_test_protocol_admin_full.ts +173 -0
  729. package/scripts/11_scenario_hacker_defense.ts +104 -0
  730. package/scripts/11_test_core_flows_full.ts +279 -0
  731. package/scripts/12_test_slash_mechanism.ts +205 -0
  732. package/scripts/12_test_slash_queries.ts +83 -0
  733. package/scripts/12_test_staking_exit.ts +152 -0
  734. package/scripts/12_test_staking_slash.ts +301 -0
  735. package/scripts/12_test_tier2_slash.ts +139 -0
  736. package/scripts/13_test_sbt_burn_linkage.ts +266 -0
  737. package/scripts/14_test_credit_redesign.ts +266 -0
  738. package/scripts/15_test_bls_full.ts +148 -0
  739. package/scripts/15_test_dvt_bls_full.ts +140 -0
  740. package/scripts/17_test_cross_role_collaboration.ts +95 -0
  741. package/scripts/18_sdk_e2e_verification.ts +67 -0
  742. package/scripts/18_test_dvt_sdk_flow.ts +138 -0
  743. package/scripts/18_test_lifecycle_completion.ts +144 -0
  744. package/scripts/19_sdk_experiment_runner.ts +207 -0
  745. package/scripts/19_sdk_experiment_runner.ts.backup +391 -0
  746. package/scripts/20_sdk_full_capability.ts +95 -0
  747. package/scripts/20_test_superpaymaster_new_apis.ts +193 -0
  748. package/scripts/21_test_paymasterv4_complete.ts +341 -0
  749. package/scripts/22_test_bls_signing.ts +260 -0
  750. package/scripts/23_test_middleware.ts +197 -0
  751. package/scripts/98_edge_reentrancy.ts +85 -0
  752. package/scripts/99_bug_hunting_fast.ts +99 -0
  753. package/scripts/analyze_abi_coverage.ts +169 -0
  754. package/scripts/analyze_missing_functions.ts +136 -0
  755. package/scripts/canary-bundler.ts +47 -0
  756. package/scripts/check-admin.ts +95 -0
  757. package/scripts/check-chainlink.ts +28 -0
  758. package/scripts/check-jason-status.ts +85 -0
  759. package/scripts/check-roles.ts +36 -0
  760. package/scripts/clear-nonce.ts +47 -0
  761. package/scripts/collect_industry_baseline.ts +236 -0
  762. package/scripts/complete-jack-superpaymaster.ts +171 -0
  763. package/scripts/complete_env_config.ts +97 -0
  764. package/scripts/deploy-sync.ts +104 -0
  765. package/scripts/deploy_and_init_v3.sh +134 -0
  766. package/scripts/deploy_anvil_accounts.ts +144 -0
  767. package/scripts/deploy_jason_pm.ts +114 -0
  768. package/scripts/deploy_paymaster_v4.ts +139 -0
  769. package/scripts/deploy_test_accounts.ts +401 -0
  770. package/scripts/deprecated/check_aa_entrypoint.ts +29 -0
  771. package/scripts/deprecated/check_paymaster_deposits.ts +45 -0
  772. package/scripts/deprecated/debug_aoa_function.ts +28 -0
  773. package/scripts/deprecated/debug_aoa_issue.ts +16 -0
  774. package/scripts/deprecated/debug_pimlico_aa23.ts +40 -0
  775. package/scripts/deprecated/debug_summary.ts +34 -0
  776. package/scripts/deprecated/deploy_v07_aa.ts +99 -0
  777. package/scripts/deprecated/fix_all_issues.ts +61 -0
  778. package/scripts/deprecated/fund_bpnts.ts +52 -0
  779. package/scripts/deprecated/get_factory_addresses.ts +28 -0
  780. package/scripts/deprecated/recheck_pim.ts +34 -0
  781. package/scripts/dev_tools/extract_abis.sh +151 -0
  782. package/scripts/dev_tools/extract_addresses_to_env.sh +67 -0
  783. package/scripts/dev_tools/final_safe_harmonize.py +77 -0
  784. package/scripts/dev_tools/safe_harmonize.py +107 -0
  785. package/scripts/dev_tools/surgical_harmonize.py +83 -0
  786. package/scripts/experiment/stage3/SETUP_GUIDE.md +258 -0
  787. package/scripts/experiment/stage3/archived_scripts/00_token_distribution.ts +78 -0
  788. package/scripts/experiment/stage3/archived_scripts/01_dao_launch.ts +96 -0
  789. package/scripts/experiment/stage3/archived_scripts/01b_bread_launch.ts +112 -0
  790. package/scripts/experiment/stage3/archived_scripts/02_operator_setup.ts +84 -0
  791. package/scripts/experiment/stage3/archived_scripts/02b_operator_b_setup.ts +104 -0
  792. package/scripts/experiment/stage3/archived_scripts/02c_finalize_operators.ts +86 -0
  793. package/scripts/experiment/stage3/archived_scripts/02d_operator_collateral.ts +89 -0
  794. package/scripts/experiment/stage3/archived_scripts/03_user_onboarding.ts +83 -0
  795. package/scripts/experiment/stage3/archived_scripts/03b_deploy_aa_account.ts +61 -0
  796. package/scripts/experiment/stage3/archived_scripts/03c_aa_onboarding.ts +104 -0
  797. package/scripts/experiment/stage3/archived_scripts/03d_mint_points.ts +60 -0
  798. package/scripts/experiment/stage3/archived_scripts/04_benchmarking.ts +100 -0
  799. package/scripts/experiment/stage3/archived_scripts/05_multi_op_setup.ts +149 -0
  800. package/scripts/experiment/stage3/archived_scripts/README.md +58 -0
  801. package/scripts/experiment/stage3/archived_scripts/check_roles.ts +29 -0
  802. package/scripts/experiment/stage3/archived_scripts/decode_error.ts +23 -0
  803. package/scripts/experiment/stage3/archived_scripts/fund_user.ts +51 -0
  804. package/scripts/experiment/stage3/archived_scripts/gen_b_key.ts +3 -0
  805. package/scripts/experiment/stage3/archived_scripts/gen_keys.ts +4 -0
  806. package/scripts/experiment/stage3/archived_scripts/setup.ts +105 -0
  807. package/scripts/experiment/stage3/archived_scripts/test_key.ts +4 -0
  808. package/scripts/experiment/stage3/archived_scripts/verify_state.ts +59 -0
  809. package/scripts/experiment/stage3/refactored/00_token_distribution.ts +46 -0
  810. package/scripts/experiment/stage3/refactored/02_operator_setup.ts +65 -0
  811. package/scripts/experiment/stage3/refactored/03_user_onboarding.ts +68 -0
  812. package/scripts/experiment/stage3/refactored/05_multi_op_setup.ts +63 -0
  813. package/scripts/experiment/stage3/refactored/README.md +71 -0
  814. package/scripts/extract-docs.sh +72 -0
  815. package/scripts/fund-jack.ts +38 -0
  816. package/scripts/generate_env_from_deployment.ts +109 -0
  817. package/scripts/inspect-anni-token.ts +116 -0
  818. package/scripts/inspect-factory.ts +83 -0
  819. package/scripts/l4-debug-bob.ts +62 -0
  820. package/scripts/l4-paymasterv4-transfer-test.ts +220 -0
  821. package/scripts/l4-setup.ts +1347 -0
  822. package/scripts/l4-state.json +82 -0
  823. package/scripts/manual-update-price.ts +39 -0
  824. package/scripts/phase1_verify_contracts.ts +207 -0
  825. package/scripts/pre_test_sync.ts +83 -0
  826. package/scripts/prepare_sepolia_resources.ts +154 -0
  827. package/scripts/publish_all.sh +39 -0
  828. package/scripts/query-jack-token.ts +22 -0
  829. package/scripts/quick_setup.ts +124 -0
  830. package/scripts/quick_setup_account.ts +80 -0
  831. package/scripts/run_automated_experiment.sh +121 -0
  832. package/scripts/run_daily_experiment.ts +70 -0
  833. package/scripts/run_full_regression.sh +38 -0
  834. package/scripts/run_l4_gasless_regression.sh +32 -0
  835. package/scripts/run_sdk_experiment.sh +13 -0
  836. package/scripts/run_sdk_regression-v2.sh +38 -0
  837. package/scripts/sdk_regression_v2.ts +148 -0
  838. package/scripts/security_audit.sh +172 -0
  839. package/scripts/setup-bbq-community.ts +187 -0
  840. package/scripts/setup-dancing-community.ts +223 -0
  841. package/scripts/setup_test_accounts.ts +88 -0
  842. package/scripts/setup_test_environment.ts +147 -0
  843. package/scripts/sync_anvil_config.cjs +44 -0
  844. package/scripts/sync_config_to_env.ts +88 -0
  845. package/scripts/sync_contract_addresses.ts +186 -0
  846. package/scripts/sync_sepolia_config.cjs +90 -0
  847. package/scripts/sync_sepolia_config.mjs +74 -0
  848. package/scripts/test-brown-v4-deploy.ts +90 -0
  849. package/scripts/test-faucet-and-gasless.ts +150 -0
  850. package/scripts/test-jack-gasless.ts +119 -0
  851. package/scripts/test-jack-registration.ts +133 -0
  852. package/scripts/test-jack-superpaymaster-api.ts +112 -0
  853. package/scripts/test-kms-gasless.ts +352 -0
  854. package/scripts/update-price-dvt.ts +53 -0
  855. package/scripts/update_env_from_config.ts +83 -0
  856. package/scripts/v2_regression/01_setup_and_fund.ts +1 -1
  857. package/scripts/v2_regression/02_operator_onboarding.ts +140 -14
  858. package/scripts/v2_regression/03_community_registry.ts +58 -24
  859. package/scripts/v2_regression/04_enduser_flow.ts +49 -16
  860. package/scripts/v2_regression/05_admin_audit.ts +1 -1
  861. package/scripts/v2_regression/README.md +161 -0
  862. package/scripts/verify-bob-token.ts +41 -0
  863. package/scripts/verify-tx-status.ts +81 -0
  864. package/scripts/verify_onchain_milestone.ts +114 -0
  865. package/scripts/verify_phase1.ts +66 -0
  866. package/scripts/verify_phase2.ts +66 -0
  867. package/sdk-abi-coverage.sh +1 -0
  868. package/sdk-build-and-test.sh +1 -0
  869. package/sdk-test-coverage.sh +1 -0
  870. package/sdk_experiment_data.csv +4 -0
  871. package/simple-test-paymaster.sh +2 -0
  872. package/simple-test-superpaymaster.sh +3 -0
  873. package/tests/check-aa-balance.ts +31 -0
  874. package/tests/l1-regression.test.ts +437 -0
  875. package/tests/l4-test-anni-gasless.ts +517 -0
  876. package/tests/l4-test-jason1-gasless.ts +158 -0
  877. package/tests/l4-test-jason2-gasless.ts +180 -0
  878. package/tests/l4-test-pmv4-deposit.ts +111 -0
  879. package/tests/l4-test-pmv4-gasless.ts +166 -0
  880. package/tests/l4-test-pmv4-submit.ts +223 -0
  881. package/tests/regression/README.md +168 -0
  882. package/tests/regression/config.ts +217 -0
  883. package/tests/regression/display-versions.ts +85 -0
  884. package/tests/regression/index.ts +67 -0
  885. package/tests/regression/l1-tests.ts +248 -0
  886. package/tests/regression/l2-tests.ts +227 -0
  887. package/tests/regression/l3-tests.ts +28 -0
  888. package/tests/regression/l4-comprehensive-gasless.ts +478 -0
  889. package/tests/regression/l4-gasless.ts +999 -0
  890. package/tests/regression/l4-reputation-tiers.ts +102 -0
  891. package/tests/regression/l4-runner.ts +52 -0
  892. package/tests/reports/phase1_contract_verification.md +45 -0
  893. package/tests/test-bundler-compat.ts +132 -0
  894. package/tests/test-candide-bundler.ts +117 -0
  895. package/tests/test-candide-paymaster.ts +101 -0
  896. package/tests/test-candide-sdk.ts +116 -0
  897. package/tests/test-candide-simple.ts +204 -0
  898. package/tests/test-pimlico-complete.ts +134 -0
  899. package/tests/utils/contractVerifier.ts +237 -0
  900. package/tests/utils/userOpHelper.ts +194 -0
  901. package/tsconfig.build.json +23 -0
  902. package/tsconfig.json +27 -0
  903. package/typedoc.json +25 -0
  904. package/update-version.sh +20 -0
  905. package/vitest.config.ts +17 -0
  906. package/dist/account/src/accounts/simple.d.ts +0 -18
  907. package/dist/account/src/accounts/simple.js +0 -49
  908. package/dist/account/src/eoa.d.ts +0 -10
  909. package/dist/account/src/eoa.js +0 -21
  910. package/dist/account/src/index.d.ts +0 -19
  911. package/dist/account/src/index.js +0 -49
  912. package/dist/core/src/abis/BLSAggregator.json +0 -686
  913. package/dist/core/src/abis/BLSValidator.json +0 -42
  914. package/dist/core/src/abis/DVTValidator.json +0 -368
  915. package/dist/core/src/abis/EntryPoint.json +0 -1382
  916. package/dist/core/src/abis/GToken.json +0 -513
  917. package/dist/core/src/abis/GTokenStaking.json +0 -949
  918. package/dist/core/src/abis/MySBT.json +0 -1518
  919. package/dist/core/src/abis/Paymaster.json +0 -1143
  920. package/dist/core/src/abis/PaymasterFactory.json +0 -640
  921. package/dist/core/src/abis/Registry.json +0 -1942
  922. package/dist/core/src/abis/ReputationSystem.json +0 -699
  923. package/dist/core/src/abis/SimpleAccount.json +0 -560
  924. package/dist/core/src/abis/SimpleAccountFactory.json +0 -111
  925. package/dist/core/src/abis/SuperPaymaster.json +0 -1781
  926. package/dist/core/src/abis/index.d.ts +0 -1126
  927. package/dist/core/src/abis/index.js +0 -91
  928. package/dist/core/src/abis/xPNTsFactory.json +0 -718
  929. package/dist/core/src/abis/xPNTsToken.json +0 -1280
  930. package/dist/core/src/actions/StateValidator.d.ts +0 -68
  931. package/dist/core/src/actions/StateValidator.js +0 -187
  932. package/dist/core/src/actions/account.d.ts +0 -55
  933. package/dist/core/src/actions/account.js +0 -133
  934. package/dist/core/src/actions/aggregator.d.ts +0 -17
  935. package/dist/core/src/actions/aggregator.js +0 -31
  936. package/dist/core/src/actions/dvt.d.ts +0 -30
  937. package/dist/core/src/actions/dvt.js +0 -41
  938. package/dist/core/src/actions/entryPoint.d.ts +0 -90
  939. package/dist/core/src/actions/entryPoint.js +0 -211
  940. package/dist/core/src/actions/factory.d.ts +0 -215
  941. package/dist/core/src/actions/factory.js +0 -442
  942. package/dist/core/src/actions/faucet.d.ts +0 -48
  943. package/dist/core/src/actions/faucet.js +0 -337
  944. package/dist/core/src/actions/gtokenExtended.d.ts +0 -39
  945. package/dist/core/src/actions/gtokenExtended.js +0 -115
  946. package/dist/core/src/actions/index.d.ts +0 -15
  947. package/dist/core/src/actions/index.js +0 -17
  948. package/dist/core/src/actions/paymasterV4.d.ts +0 -170
  949. package/dist/core/src/actions/paymasterV4.js +0 -334
  950. package/dist/core/src/actions/registry.d.ts +0 -246
  951. package/dist/core/src/actions/registry.js +0 -667
  952. package/dist/core/src/actions/reputation.d.ts +0 -129
  953. package/dist/core/src/actions/reputation.js +0 -281
  954. package/dist/core/src/actions/sbt.d.ts +0 -191
  955. package/dist/core/src/actions/sbt.js +0 -533
  956. package/dist/core/src/actions/staking.d.ts +0 -132
  957. package/dist/core/src/actions/staking.js +0 -330
  958. package/dist/core/src/actions/superPaymaster.d.ts +0 -237
  959. package/dist/core/src/actions/superPaymaster.js +0 -644
  960. package/dist/core/src/actions/tokens.d.ts +0 -229
  961. package/dist/core/src/actions/tokens.js +0 -415
  962. package/dist/core/src/branding.d.ts +0 -30
  963. package/dist/core/src/branding.js +0 -30
  964. package/dist/core/src/clients/BaseClient.d.ts +0 -25
  965. package/dist/core/src/clients/BaseClient.js +0 -66
  966. package/dist/core/src/clients/types.d.ts +0 -60
  967. package/dist/core/src/clients/types.js +0 -1
  968. package/dist/core/src/clients.d.ts +0 -5
  969. package/dist/core/src/clients.js +0 -11
  970. package/dist/core/src/communities.d.ts +0 -52
  971. package/dist/core/src/communities.js +0 -73
  972. package/dist/core/src/config/ContractConfigManager.d.ts +0 -20
  973. package/dist/core/src/config/ContractConfigManager.js +0 -48
  974. package/dist/core/src/constants.d.ts +0 -88
  975. package/dist/core/src/constants.js +0 -125
  976. package/dist/core/src/contract-addresses.d.ts +0 -110
  977. package/dist/core/src/contract-addresses.js +0 -99
  978. package/dist/core/src/contracts.d.ts +0 -424
  979. package/dist/core/src/contracts.js +0 -343
  980. package/dist/core/src/crypto/blsSigner.d.ts +0 -64
  981. package/dist/core/src/crypto/blsSigner.js +0 -98
  982. package/dist/core/src/crypto/index.js +0 -1
  983. package/dist/core/src/index.d.ts +0 -21
  984. package/dist/core/src/index.js +0 -21
  985. package/dist/core/src/networks.d.ts +0 -127
  986. package/dist/core/src/networks.js +0 -118
  987. package/dist/core/src/requirementChecker.d.ts +0 -38
  988. package/dist/core/src/requirementChecker.js +0 -139
  989. package/dist/core/src/roles.d.ts +0 -204
  990. package/dist/core/src/roles.js +0 -211
  991. package/dist/core/src/utils/validation.d.ts +0 -24
  992. package/dist/core/src/utils/validation.js +0 -56
  993. package/dist/dapp/src/index.d.ts +0 -3
  994. package/dist/dapp/src/index.js +0 -3
  995. package/dist/dapp/src/ui/hooks/useCreditScore.d.ts +0 -13
  996. package/dist/dapp/src/ui/hooks/useCreditScore.js +0 -32
  997. package/dist/dapp/src/ui/hooks/useSuperPaymaster.d.ts +0 -8
  998. package/dist/dapp/src/ui/hooks/useSuperPaymaster.js +0 -23
  999. package/dist/dapp/src/ui/index.d.ts +0 -4
  1000. package/dist/dapp/src/ui/index.js +0 -17
  1001. package/dist/identity/src/index.d.ts +0 -46
  1002. package/dist/identity/src/index.js +0 -94
  1003. package/dist/identity/src/mysbt.d.ts +0 -13
  1004. package/dist/identity/src/mysbt.js +0 -37
  1005. package/dist/paymaster/src/SuperPaymaster/index.d.ts +0 -44
  1006. package/dist/paymaster/src/SuperPaymaster/index.js +0 -133
  1007. package/dist/paymaster/src/V4/PaymasterClient.d.ts +0 -79
  1008. package/dist/paymaster/src/V4/PaymasterClient.js +0 -315
  1009. package/dist/paymaster/src/V4/PaymasterOperator.d.ts +0 -41
  1010. package/dist/paymaster/src/V4/PaymasterOperator.js +0 -241
  1011. package/dist/paymaster/src/V4/PaymasterUtils.d.ts +0 -55
  1012. package/dist/paymaster/src/V4/PaymasterUtils.js +0 -124
  1013. package/dist/paymaster/src/V4/SuperPaymasterClient.d.ts +0 -21
  1014. package/dist/paymaster/src/V4/SuperPaymasterClient.js +0 -73
  1015. package/dist/paymaster/src/V4/index.js +0 -4
  1016. package/dist/paymaster/src/index.d.ts +0 -2
  1017. package/dist/paymaster/src/index.js +0 -4
  1018. package/dist/sdk/src/clients/ExperimentClient.d.ts +0 -34
  1019. package/dist/sdk/src/clients/ExperimentClient.js +0 -58
  1020. package/dist/sdk/src/clients/ExperimentClient.test.d.ts +0 -1
  1021. package/dist/sdk/src/clients/ExperimentClient.test.js +0 -53
  1022. package/dist/sdk/src/clients/admin.d.ts +0 -57
  1023. package/dist/sdk/src/clients/admin.js +0 -105
  1024. package/dist/sdk/src/clients/admin.test.d.ts +0 -1
  1025. package/dist/sdk/src/clients/admin.test.js +0 -79
  1026. package/dist/sdk/src/clients/clients.test.d.ts +0 -1
  1027. package/dist/sdk/src/clients/clients.test.js +0 -91
  1028. package/dist/sdk/src/clients/community.d.ts +0 -48
  1029. package/dist/sdk/src/clients/community.js +0 -244
  1030. package/dist/sdk/src/clients/community.test.d.ts +0 -1
  1031. package/dist/sdk/src/clients/community.test.js +0 -99
  1032. package/dist/sdk/src/clients/endUser.d.ts +0 -95
  1033. package/dist/sdk/src/clients/endUser.js +0 -388
  1034. package/dist/sdk/src/clients/endUser.test.d.ts +0 -1
  1035. package/dist/sdk/src/clients/endUser.test.js +0 -188
  1036. package/dist/sdk/src/clients/operator.d.ts +0 -96
  1037. package/dist/sdk/src/clients/operator.js +0 -247
  1038. package/dist/sdk/src/clients/operator.test.d.ts +0 -1
  1039. package/dist/sdk/src/clients/operator.test.js +0 -139
  1040. package/dist/sdk/src/errors/AAStarError.d.ts +0 -26
  1041. package/dist/sdk/src/errors/AAStarError.js +0 -32
  1042. package/dist/sdk/src/errors/AAStarError.test.d.ts +0 -1
  1043. package/dist/sdk/src/errors/AAStarError.test.js +0 -74
  1044. package/dist/sdk/src/errors/decoder.d.ts +0 -1
  1045. package/dist/sdk/src/errors/decoder.js +0 -83
  1046. package/dist/sdk/src/errors/decoder.test.d.ts +0 -1
  1047. package/dist/sdk/src/errors/decoder.test.js +0 -90
  1048. package/dist/sdk/src/index.d.ts +0 -16
  1049. package/dist/sdk/src/index.js +0 -20
  1050. package/dist/sdk/src/node/index.d.ts +0 -7
  1051. package/dist/sdk/src/node/index.js +0 -7
  1052. package/dist/sdk/src/types/result.d.ts +0 -15
  1053. package/dist/sdk/src/types/result.js +0 -23
  1054. package/dist/sdk/src/utils/errorHandler.d.ts +0 -40
  1055. package/dist/sdk/src/utils/errorHandler.js +0 -114
  1056. package/dist/sdk/src/utils/errorHandler.test.d.ts +0 -1
  1057. package/dist/sdk/src/utils/errorHandler.test.js +0 -89
  1058. package/dist/sdk/src/utils/eventDecoder.d.ts +0 -7
  1059. package/dist/sdk/src/utils/eventDecoder.js +0 -54
  1060. package/dist/sdk/src/utils/eventDecoder.test.d.ts +0 -1
  1061. package/dist/sdk/src/utils/eventDecoder.test.js +0 -48
  1062. package/dist/sdk/src/utils/funding.d.ts +0 -115
  1063. package/dist/sdk/src/utils/funding.js +0 -188
  1064. package/dist/sdk/src/utils/funding.test.d.ts +0 -1
  1065. package/dist/sdk/src/utils/funding.test.js +0 -105
  1066. package/dist/sdk/src/utils/keys.d.ts +0 -73
  1067. package/dist/sdk/src/utils/keys.js +0 -137
  1068. package/dist/sdk/src/utils/keys.test.d.ts +0 -1
  1069. package/dist/sdk/src/utils/keys.test.js +0 -81
  1070. package/dist/sdk/src/utils/roleData.d.ts +0 -66
  1071. package/dist/sdk/src/utils/roleData.js +0 -115
  1072. package/dist/sdk/src/utils/roleData.test.d.ts +0 -1
  1073. package/dist/sdk/src/utils/roleData.test.js +0 -74
  1074. package/dist/sdk/src/utils/testScenarios.d.ts +0 -33
  1075. package/dist/sdk/src/utils/testScenarios.js +0 -85
  1076. package/dist/sdk/src/utils/testScenarios.test.d.ts +0 -1
  1077. package/dist/sdk/src/utils/testScenarios.test.js +0 -68
  1078. package/dist/sdk/src/utils/userOp.d.ts +0 -78
  1079. package/dist/sdk/src/utils/userOp.js +0 -195
  1080. package/dist/sdk/src/utils/userOp.test.d.ts +0 -1
  1081. package/dist/sdk/src/utils/userOp.test.js +0 -152
  1082. package/dist/tokens/src/index.d.ts +0 -56
  1083. package/dist/tokens/src/index.js +0 -230
  1084. package/examples/regression_test.d.ts +0 -2
  1085. package/examples/regression_test.d.ts.map +0 -1
  1086. package/examples/regression_test.js +0 -89
  1087. package/examples/regression_test.js.map +0 -1
  1088. /package/{dist/core/src/crypto/index.d.ts → packages/core/src/crypto/index.ts} +0 -0
  1089. /package/{dist/paymaster/src/V4/index.d.ts → packages/paymaster/src/V4/index.ts} +0 -0
  1090. /package/{examples → packages/sdk/examples}/config.json +0 -0
  1091. /package/{examples → packages/sdk/examples}/regression_test.ts +0 -0
@@ -0,0 +1,2724 @@
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)