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