@aastar/sdk 0.16.6 → 0.16.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -245
- package/dist/account/src/accounts/simple.d.ts +18 -0
- package/{packages/account/src/accounts/simple.ts → dist/account/src/accounts/simple.js} +12 -47
- package/dist/account/src/eoa.d.ts +10 -0
- package/dist/account/src/eoa.js +21 -0
- package/dist/account/src/index.d.ts +19 -0
- package/dist/account/src/index.js +49 -0
- package/dist/core/src/abis/BLSAggregator.json +686 -0
- package/dist/core/src/abis/BLSValidator.json +42 -0
- package/dist/core/src/abis/DVTValidator.json +368 -0
- package/dist/core/src/abis/EntryPoint.json +1382 -0
- package/dist/core/src/abis/GToken.json +513 -0
- package/dist/core/src/abis/GTokenStaking.json +949 -0
- package/dist/core/src/abis/MySBT.json +1518 -0
- package/dist/core/src/abis/Paymaster.json +1143 -0
- package/dist/core/src/abis/PaymasterFactory.json +640 -0
- package/dist/core/src/abis/Registry.json +1942 -0
- package/dist/core/src/abis/ReputationSystem.json +699 -0
- package/dist/core/src/abis/SimpleAccount.json +560 -0
- package/dist/core/src/abis/SimpleAccountFactory.json +111 -0
- package/dist/core/src/abis/SuperPaymaster.json +1781 -0
- package/dist/core/src/abis/index.d.ts +1126 -0
- package/{packages/core/src/abis/index.ts → dist/core/src/abis/index.js} +7 -20
- package/dist/core/src/abis/xPNTsFactory.json +718 -0
- package/dist/core/src/abis/xPNTsToken.json +1280 -0
- package/dist/core/src/actions/StateValidator.d.ts +68 -0
- package/{packages/core/src/actions/StateValidator.ts → dist/core/src/actions/StateValidator.js} +68 -134
- package/dist/core/src/actions/account.d.ts +55 -0
- package/dist/core/src/actions/account.js +133 -0
- package/dist/core/src/actions/aggregator.d.ts +17 -0
- package/dist/core/src/actions/aggregator.js +31 -0
- package/dist/core/src/actions/dvt.d.ts +30 -0
- package/dist/core/src/actions/dvt.js +41 -0
- package/dist/core/src/actions/entryPoint.d.ts +90 -0
- package/dist/core/src/actions/entryPoint.js +211 -0
- package/dist/core/src/actions/factory.d.ts +215 -0
- package/dist/core/src/actions/factory.js +442 -0
- package/dist/core/src/actions/faucet.d.ts +48 -0
- package/{packages/core/src/actions/faucet.ts → dist/core/src/actions/faucet.js} +58 -142
- package/dist/core/src/actions/gtokenExtended.d.ts +39 -0
- package/dist/core/src/actions/gtokenExtended.js +115 -0
- package/dist/core/src/actions/index.d.ts +15 -0
- package/{packages/core/src/actions/index.ts → dist/core/src/actions/index.js} +0 -1
- package/dist/core/src/actions/paymasterV4.d.ts +170 -0
- package/dist/core/src/actions/paymasterV4.js +334 -0
- package/dist/core/src/actions/registry.d.ts +246 -0
- package/dist/core/src/actions/registry.js +667 -0
- package/dist/core/src/actions/reputation.d.ts +129 -0
- package/dist/core/src/actions/reputation.js +281 -0
- package/dist/core/src/actions/sbt.d.ts +191 -0
- package/dist/core/src/actions/sbt.js +533 -0
- package/dist/core/src/actions/staking.d.ts +132 -0
- package/{packages/core/src/actions/staking.ts → dist/core/src/actions/staking.js} +83 -174
- package/dist/core/src/actions/superPaymaster.d.ts +237 -0
- package/dist/core/src/actions/superPaymaster.js +644 -0
- package/dist/core/src/actions/tokens.d.ts +229 -0
- package/dist/core/src/actions/tokens.js +415 -0
- package/dist/core/src/branding.d.ts +30 -0
- package/dist/core/src/branding.js +30 -0
- package/dist/core/src/clients/BaseClient.d.ts +25 -0
- package/{packages/core/src/clients/BaseClient.ts → dist/core/src/clients/BaseClient.js} +16 -28
- package/{packages/core/src/clients/types.ts → dist/core/src/clients/types.d.ts} +0 -9
- package/dist/core/src/clients/types.js +1 -0
- package/dist/core/src/clients.d.ts +5 -0
- package/dist/core/src/clients.js +11 -0
- package/dist/core/src/communities.d.ts +52 -0
- package/dist/core/src/communities.js +73 -0
- package/dist/core/src/config/ContractConfigManager.d.ts +20 -0
- package/{packages/core/src/config/ContractConfigManager.ts → dist/core/src/config/ContractConfigManager.js} +8 -23
- package/dist/core/src/constants.d.ts +88 -0
- package/dist/core/src/constants.js +125 -0
- package/dist/core/src/contract-addresses.d.ts +110 -0
- package/dist/core/src/contract-addresses.js +99 -0
- package/dist/core/src/contracts.d.ts +424 -0
- package/dist/core/src/contracts.js +343 -0
- package/dist/core/src/crypto/blsSigner.d.ts +64 -0
- package/{packages/core/src/crypto/blsSigner.ts → dist/core/src/crypto/blsSigner.js} +23 -49
- package/dist/core/src/crypto/index.js +1 -0
- package/dist/core/src/index.d.ts +21 -0
- package/{packages/core/src/index.ts → dist/core/src/index.js} +0 -1
- package/dist/core/src/networks.d.ts +127 -0
- package/{lib/shared-config/src/networks.ts → dist/core/src/networks.js} +34 -33
- package/dist/core/src/requirementChecker.d.ts +38 -0
- package/{packages/core/src/requirementChecker.ts → dist/core/src/requirementChecker.js} +26 -74
- package/dist/core/src/roles.d.ts +204 -0
- package/{packages/core/src/roles.ts → dist/core/src/roles.js} +23 -67
- package/dist/core/src/utils/validation.d.ts +24 -0
- package/{packages/core/src/utils/validation.ts → dist/core/src/utils/validation.js} +6 -16
- package/{packages/dapp/src/index.ts → dist/dapp/src/index.d.ts} +0 -1
- package/dist/dapp/src/index.js +3 -0
- package/dist/dapp/src/ui/hooks/useCreditScore.d.ts +13 -0
- package/{packages/dapp/src/ui/hooks/useCreditScore.ts → dist/dapp/src/ui/hooks/useCreditScore.js} +11 -23
- package/dist/dapp/src/ui/hooks/useSuperPaymaster.d.ts +8 -0
- package/{packages/dapp/src/ui/hooks/useSuperPaymaster.ts → dist/dapp/src/ui/hooks/useSuperPaymaster.js} +9 -17
- package/dist/dapp/src/ui/index.d.ts +4 -0
- package/{packages/dapp/src/ui/index.ts → dist/dapp/src/ui/index.js} +3 -8
- package/dist/identity/src/index.d.ts +46 -0
- package/{packages/identity/src/index.ts → dist/identity/src/index.js} +21 -41
- package/dist/identity/src/mysbt.d.ts +13 -0
- package/{packages/identity/src/mysbt.ts → dist/identity/src/mysbt.js} +9 -20
- package/dist/paymaster/src/SuperPaymaster/index.d.ts +44 -0
- package/{packages/paymaster/src/SuperPaymaster/index.ts → dist/paymaster/src/SuperPaymaster/index.js} +27 -62
- package/dist/paymaster/src/V4/PaymasterClient.d.ts +79 -0
- package/{packages/paymaster/src/V4/PaymasterClient.ts → dist/paymaster/src/V4/PaymasterClient.js} +63 -133
- package/dist/paymaster/src/V4/PaymasterOperator.d.ts +41 -0
- package/{packages/paymaster/src/V4/PaymasterOperator.ts → dist/paymaster/src/V4/PaymasterOperator.js} +66 -107
- package/dist/paymaster/src/V4/PaymasterUtils.d.ts +55 -0
- package/{packages/paymaster/src/V4/PaymasterUtils.ts → dist/paymaster/src/V4/PaymasterUtils.js} +19 -80
- package/dist/paymaster/src/V4/SuperPaymasterClient.d.ts +21 -0
- package/{packages/paymaster/src/V4/SuperPaymasterClient.ts → dist/paymaster/src/V4/SuperPaymasterClient.js} +18 -68
- package/dist/paymaster/src/V4/index.js +4 -0
- package/dist/paymaster/src/index.d.ts +2 -0
- package/{packages/paymaster/src/index.ts → dist/paymaster/src/index.js} +0 -1
- package/dist/sdk/src/clients/ExperimentClient.d.ts +34 -0
- package/{packages/sdk/src/clients/ExperimentClient.ts → dist/sdk/src/clients/ExperimentClient.js} +11 -33
- package/dist/sdk/src/clients/ExperimentClient.test.d.ts +1 -0
- package/{packages/sdk/src/clients/ExperimentClient.test.ts → dist/sdk/src/clients/ExperimentClient.test.js} +4 -16
- package/dist/sdk/src/clients/admin.d.ts +57 -0
- package/dist/sdk/src/clients/admin.js +105 -0
- package/dist/sdk/src/clients/admin.test.d.ts +1 -0
- package/{packages/sdk/src/clients/admin.test.ts → dist/sdk/src/clients/admin.test.js} +18 -37
- package/dist/sdk/src/clients/clients.test.d.ts +1 -0
- package/{packages/sdk/src/clients/clients.test.ts → dist/sdk/src/clients/clients.test.js} +22 -35
- package/dist/sdk/src/clients/community.d.ts +48 -0
- package/{packages/sdk/src/clients/community.ts → dist/sdk/src/clients/community.js} +63 -156
- package/dist/sdk/src/clients/community.test.d.ts +1 -0
- package/dist/sdk/src/clients/community.test.js +99 -0
- package/dist/sdk/src/clients/endUser.d.ts +95 -0
- package/dist/sdk/src/clients/endUser.js +388 -0
- package/dist/sdk/src/clients/endUser.test.d.ts +1 -0
- package/dist/sdk/src/clients/endUser.test.js +188 -0
- package/dist/sdk/src/clients/operator.d.ts +96 -0
- package/{packages/sdk/src/clients/operator.ts → dist/sdk/src/clients/operator.js} +70 -178
- package/dist/sdk/src/clients/operator.test.d.ts +1 -0
- package/dist/sdk/src/clients/operator.test.js +139 -0
- package/dist/sdk/src/errors/AAStarError.d.ts +26 -0
- package/dist/sdk/src/errors/AAStarError.js +32 -0
- package/dist/sdk/src/errors/AAStarError.test.d.ts +1 -0
- package/{packages/sdk/src/errors/AAStarError.test.ts → dist/sdk/src/errors/AAStarError.test.js} +0 -18
- package/dist/sdk/src/errors/decoder.d.ts +1 -0
- package/{packages/sdk/src/errors/decoder.ts → dist/sdk/src/errors/decoder.js} +20 -28
- package/dist/sdk/src/errors/decoder.test.d.ts +1 -0
- package/{packages/sdk/src/errors/decoder.test.ts → dist/sdk/src/errors/decoder.test.js} +10 -27
- package/dist/sdk/src/index.d.ts +16 -0
- package/{packages/sdk/src/index.ts → dist/sdk/src/index.js} +0 -3
- package/{packages/sdk/src/node/index.ts → dist/sdk/src/node/index.d.ts} +0 -1
- package/dist/sdk/src/node/index.js +7 -0
- package/dist/sdk/src/types/result.d.ts +15 -0
- package/{packages/sdk/src/types/result.ts → dist/sdk/src/types/result.js} +5 -11
- package/dist/sdk/src/utils/errorHandler.d.ts +40 -0
- package/{packages/sdk/src/utils/errorHandler.ts → dist/sdk/src/utils/errorHandler.js} +22 -75
- package/dist/sdk/src/utils/errorHandler.test.d.ts +1 -0
- package/{packages/sdk/src/utils/errorHandler.test.ts → dist/sdk/src/utils/errorHandler.test.js} +1 -14
- package/dist/sdk/src/utils/eventDecoder.d.ts +7 -0
- package/{packages/sdk/src/utils/eventDecoder.ts → dist/sdk/src/utils/eventDecoder.js} +14 -26
- package/dist/sdk/src/utils/eventDecoder.test.d.ts +1 -0
- package/{packages/sdk/src/utils/eventDecoder.test.ts → dist/sdk/src/utils/eventDecoder.test.js} +10 -18
- package/dist/sdk/src/utils/funding.d.ts +115 -0
- package/{packages/sdk/src/utils/funding.ts → dist/sdk/src/utils/funding.js} +27 -119
- package/dist/sdk/src/utils/funding.test.d.ts +1 -0
- package/{packages/sdk/src/utils/funding.test.ts → dist/sdk/src/utils/funding.test.js} +18 -30
- package/dist/sdk/src/utils/keys.d.ts +73 -0
- package/{packages/sdk/src/utils/keys.ts → dist/sdk/src/utils/keys.js} +17 -54
- package/dist/sdk/src/utils/keys.test.d.ts +1 -0
- package/{packages/sdk/src/utils/keys.test.ts → dist/sdk/src/utils/keys.test.js} +13 -37
- package/dist/sdk/src/utils/roleData.d.ts +66 -0
- package/{packages/sdk/src/utils/roleData.ts → dist/sdk/src/utils/roleData.js} +28 -53
- package/dist/sdk/src/utils/roleData.test.d.ts +1 -0
- package/{packages/sdk/src/utils/roleData.test.ts → dist/sdk/src/utils/roleData.test.js} +2 -13
- package/dist/sdk/src/utils/testScenarios.d.ts +33 -0
- package/dist/sdk/src/utils/testScenarios.js +85 -0
- package/dist/sdk/src/utils/testScenarios.test.d.ts +1 -0
- package/{packages/sdk/src/utils/testScenarios.test.ts → dist/sdk/src/utils/testScenarios.test.js} +19 -30
- package/dist/sdk/src/utils/userOp.d.ts +78 -0
- package/{packages/sdk/src/utils/userOp.ts → dist/sdk/src/utils/userOp.js} +61 -131
- package/dist/sdk/src/utils/userOp.test.d.ts +1 -0
- package/{packages/sdk/src/utils/userOp.test.ts → dist/sdk/src/utils/userOp.test.js} +55 -93
- package/dist/tokens/src/index.d.ts +56 -0
- package/{packages/tokens/src/index.ts → dist/tokens/src/index.js} +52 -95
- package/examples/regression_test.d.ts +2 -0
- package/examples/regression_test.d.ts.map +1 -0
- package/examples/regression_test.js +89 -0
- package/examples/regression_test.js.map +1 -0
- package/package.json +40 -58
- package/scripts/v2_regression/01_setup_and_fund.ts +1 -1
- package/scripts/v2_regression/02_operator_onboarding.ts +1 -1
- package/scripts/v2_regression/03_community_registry.ts +1 -1
- package/scripts/v2_regression/04_enduser_flow.ts +1 -1
- package/scripts/v2_regression/05_admin_audit.ts +1 -1
- package/.eslintrc.cjs +0 -30
- package/.gitmodules +0 -9
- package/aastar-sdk.code-workspace +0 -14
- package/abis/BLSAggregator.json +0 -572
- package/abis/BLSValidator.json +0 -39
- package/abis/DVTValidator.json +0 -383
- package/abis/Eip7702Support.json +0 -24
- package/abis/EntryPoint.json +0 -1379
- package/abis/GToken.json +0 -510
- package/abis/GTokenStaking.json +0 -918
- package/abis/LegacyAccount.json +0 -625
- package/abis/MySBT.json +0 -1547
- package/abis/Paymaster.json +0 -1192
- package/abis/PaymasterFactory.json +0 -637
- package/abis/PaymasterV4_2.json +0 -1193
- package/abis/Registry.json +0 -1677
- package/abis/ReputationSystem.json +0 -659
- package/abis/SenderCreator.json +0 -99
- package/abis/Simple7702Account.json +0 -395
- package/abis/SimpleAccount.json +0 -625
- package/abis/SimpleAccountFactory.json +0 -108
- package/abis/SimpleAccountFactoryV08.json +0 -87
- package/abis/SimpleAccountV08.json +0 -557
- package/abis/SuperPaymaster.json +0 -1568
- package/abis/UserOperationLib.json +0 -57
- package/abis/aPNTs.json +0 -1160
- package/abis/xPNTsFactory.json +0 -715
- package/abis/xPNTsToken.json +0 -1160
- package/config/networks/README.md +0 -54
- package/config/networks/mainnet.env.example +0 -39
- package/config/networks/optimism-sepolia.env.example +0 -35
- package/config/networks/optimism.env.example +0 -36
- package/config/networks/sepolia.env.example +0 -36
- package/config.anvil.json +0 -1
- package/config.sepolia.json +0 -1
- package/config.test.json +0 -27
- package/data/experiment_data.csv +0 -36
- package/data/industry_baseline_2025-12-23.json +0 -154
- package/data/industry_baseline_latest.json +0 -154
- package/docs/ABI_Change_Tracking_Workflow.md +0 -41
- package/docs/ABI_MAINTENANCE_PLAN.md +0 -132
- package/docs/API_REFERENCE.md +0 -956
- package/docs/Configuration_Sync.md +0 -47
- package/docs/DAO_Mining_Distribution_Plan.md +0 -522
- package/docs/DEMO_REFACTOR_PLAN.md +0 -289
- package/docs/DOCUMENTATION_PLAN.md +0 -455
- package/docs/ENV_SEPOLIA_UPDATE.md +0 -68
- package/docs/Faucet_Gasless_Plan.md +0 -56
- package/docs/L2_BUSINESS_CLIENTS_PLAN.md +0 -394
- package/docs/L4_Manual_Test_CheatSheet.md +0 -215
- package/docs/Plan.md +0 -266
- package/docs/Regression_Testing_Guide.md +0 -70
- package/docs/SDK_ABI_COVERAGE.md +0 -839
- package/docs/SDK_COVERAGE_STRATEGY.md +0 -397
- package/docs/SDK_Optimization_Evaluation_Plan.md +0 -51
- package/docs/SDK_REGRESSION_AND_API_PLAN.md +0 -98
- package/docs/SDK_STAGE3_PLAN.md +0 -151
- package/docs/SEPOLIA_ENV_REFERENCE.md +0 -51
- package/docs/STAGE3.md +0 -191
- package/docs/Script_Comparison_Report.md +0 -91
- package/docs/Sepolia_Latest_Deployment.md +0 -117
- package/docs/TESTER_GUIDE_GASLESS.md +0 -663
- package/docs/TEST_COVERAGE_MATRIX.md +0 -72
- package/docs/TODO_SDK_COVERAGE.md +0 -55
- package/docs/USER_CASE_DESIGN.md +0 -110
- package/docs/Verifier_L4_Gasless_Plan.md +0 -454
- package/docs/api/@aastar/account.md +0 -235
- package/docs/api/@aastar/analytics.md +0 -219
- package/docs/api/@aastar/core.md +0 -26830
- package/docs/api/@aastar/dapp.md +0 -130
- package/docs/api/@aastar/identity.md +0 -482
- package/docs/api/@aastar/paymaster.md +0 -1387
- package/docs/api/@aastar/sdk/README.md +0 -155
- package/docs/api/@aastar/sdk/node.md +0 -4044
- package/docs/api/@aastar/tokens.md +0 -1971
- package/docs/api/README.md +0 -10
- package/docs/changelog.md +0 -99
- package/docs/examples/README.md +0 -18
- package/docs/examples/community-flow.md +0 -28
- package/docs/examples/enduser-flow.md +0 -24
- package/docs/examples/index.md +0 -18
- package/docs/examples/multi-chain.md +0 -31
- package/docs/examples/operator-flow.md +0 -28
- package/docs/guide/CLI_GUIDE.md +0 -65
- package/docs/guide/DOCUMENTATION_PLAN.md +0 -455
- package/docs/guide/Security-solution.md +0 -106
- package/docs/guide/TEST_COMMANDS.md +0 -320
- package/docs/guide/concepts/account-abstraction.md +0 -95
- package/docs/guide/concepts/rainbow-bridge.md +0 -68
- package/docs/guide/concepts/reputation.md +0 -95
- package/docs/guide/concepts/superpaymaster.md +0 -141
- package/docs/guide/getting-started.md +0 -133
- package/docs/guide/installation.md +0 -40
- package/docs/guide/paper-data-collection.md +0 -69
- package/docs/guide/quick-start.md +0 -52
- package/docs/guide/task_breakdown.md +0 -121
- package/docs/guide/use-cases/community-management.md +0 -141
- package/docs/guide/use-cases/gasless-transactions.md +0 -71
- package/docs/guide/use-cases/operator-staking.md +0 -84
- package/docs/guide/use-cases/yop.md +0 -72
- package/docs/old-solution.md +0 -1078
- package/docs/paper-data-collection.md +0 -69
- package/docs/refactor/2026-01-13-221242-trae-refactor.md +0 -224
- package/docs/refactor/2026-01-13-audit-analysis.md +0 -96
- package/docs/refactor/2026-01-13-audit-report-v0.16.2.md +0 -76
- package/docs/refactor/2026-01-13-audit-report-v0.17.0.md +0 -74
- package/docs/refactor/2026-01-13-cursor-refactor.md +0 -511
- package/docs/refactor/2026-01-13-refactor-plan.md +0 -88
- package/docs/refactor/2026-01-13-refactor-response-plan.md +0 -77
- package/docs/refactor/2026-01-13-refactor-review.md +0 -39
- package/docs/refactor/2026-01-13-sdk-enhancement-plan.md +0 -120
- package/docs/refactor/2026-01-14-audit-response.md +0 -242
- package/docs/refactor/2026-01-14-audit-summary.md +0 -133
- package/docs/refactor/cursor-2026-01-13-14-00-audit-report.md +0 -267
- package/docs/technical_plan.md +0 -510
- package/docs/zh/examples/community-flow.md +0 -38
- package/docs/zh/examples/complete-workflow.md +0 -10
- package/docs/zh/examples/enduser-flow.md +0 -33
- package/docs/zh/examples/index.md +0 -18
- package/docs/zh/examples/multi-chain.md +0 -46
- package/docs/zh/examples/operator-flow.md +0 -37
- package/docs/zh/guide/CLI_GUIDE.md +0 -48
- package/docs/zh/guide/DOCUMENTATION_PLAN.md +0 -455
- package/docs/zh/guide/Plan.md +0 -266
- package/docs/zh/guide/SDK_Optimization_Evaluation_Plan.md +0 -51
- package/docs/zh/guide/Security-solution.md +0 -106
- package/docs/zh/guide/TEST_COMMANDS.md +0 -125
- package/docs/zh/guide/TEST_COVERAGE_MATRIX.md +0 -72
- package/docs/zh/guide/concepts/account-abstraction.md +0 -95
- package/docs/zh/guide/concepts/rainbow-bridge.md +0 -68
- package/docs/zh/guide/concepts/reputation.md +0 -95
- package/docs/zh/guide/concepts/superpaymaster.md +0 -141
- package/docs/zh/guide/getting-started.md +0 -133
- package/docs/zh/guide/installation.md +0 -107
- package/docs/zh/guide/old-solution.md +0 -1078
- package/docs/zh/guide/paper-data-collection.md +0 -69
- package/docs/zh/guide/quick-start.md +0 -134
- package/docs/zh/guide/sdk-readme.md +0 -253
- package/docs/zh/guide/task_breakdown.md +0 -76
- package/docs/zh/guide/technical_plan.md +0 -510
- package/docs/zh/guide/use-cases/community-management.md +0 -141
- package/docs/zh/guide/use-cases/gasless-transactions.md +0 -71
- package/docs/zh/guide/use-cases/operator-staking.md +0 -84
- package/docs/zh/guide/use-cases/yop.md +0 -72
- package/env.template +0 -32
- package/examples/l1-api-demo.ts +0 -184
- package/examples/l2-clients-demo.ts +0 -138
- package/examples/l3-user-onboarding.ts +0 -74
- package/examples/prepare-gasless.ts +0 -89
- package/examples/sdk-demo/DEVELOPER_GUIDE.md +0 -159
- package/examples/sdk-demo/README.md +0 -30
- package/examples/sdk-demo/usage.ts +0 -137
- package/examples/simple-gasless-demo.ts +0 -80
- package/examples/simple-superpaymaster-demo.ts +0 -96
- package/ext/aastar-shared-config/.env.example +0 -6
- package/ext/aastar-shared-config/.github/workflows/check-secrets.yml +0 -257
- package/ext/aastar-shared-config/AGENTS.md +0 -21
- package/ext/aastar-shared-config/CHANGELOG.md +0 -99
- package/ext/aastar-shared-config/LICENSE +0 -21
- package/ext/aastar-shared-config/QUICK_START.md +0 -215
- package/ext/aastar-shared-config/README.md +0 -412
- package/ext/aastar-shared-config/SHARED_CONFIG_SUMMARY.md +0 -273
- package/ext/aastar-shared-config/check-locker-status.mjs +0 -7
- package/ext/aastar-shared-config/favicon.ico +0 -0
- package/ext/aastar-shared-config/generate-comparison-table.sh +0 -67
- package/ext/aastar-shared-config/package.json +0 -46
- package/ext/aastar-shared-config/pnpm-lock.yaml +0 -1182
- package/ext/aastar-shared-config/src/abis/BLSAggregator.json +0 -1
- package/ext/aastar-shared-config/src/abis/DVTValidator.json +0 -1
- package/ext/aastar-shared-config/src/abis/GToken.json +0 -1
- package/ext/aastar-shared-config/src/abis/GTokenStaking.json +0 -1
- package/ext/aastar-shared-config/src/abis/MySBT.json +0 -1
- package/ext/aastar-shared-config/src/abis/PaymasterFactory.json +0 -1
- package/ext/aastar-shared-config/src/abis/PaymasterV4.json +0 -1098
- package/ext/aastar-shared-config/src/abis/Registry.json +0 -1
- package/ext/aastar-shared-config/src/abis/SimpleAccount.json +0 -557
- package/ext/aastar-shared-config/src/abis/SimpleAccountFactory.json +0 -87
- package/ext/aastar-shared-config/src/abis/SuperPaymasterV2.json +0 -1
- package/ext/aastar-shared-config/src/abis/index.ts +0 -45
- package/ext/aastar-shared-config/src/abis/xPNTsFactory.json +0 -1
- package/ext/aastar-shared-config/src/abis/xPNTsToken.json +0 -1
- package/ext/aastar-shared-config/src/branding.ts +0 -32
- package/ext/aastar-shared-config/src/communities.ts +0 -93
- package/ext/aastar-shared-config/src/constants.ts +0 -67
- package/ext/aastar-shared-config/src/contract-addresses.ts +0 -95
- package/ext/aastar-shared-config/src/contract-versions.ts +0 -374
- package/ext/aastar-shared-config/src/contracts.ts +0 -414
- package/ext/aastar-shared-config/src/index.ts +0 -14
- package/ext/aastar-shared-config/src/networks.ts +0 -117
- package/ext/aastar-shared-config/sync-abis.sh +0 -92
- package/ext/aastar-shared-config/sync-versions.mjs +0 -150
- package/ext/aastar-shared-config/tsconfig.json +0 -18
- package/ext/aastar-shared-config/tsup.config.ts +0 -10
- package/ext/aastar-shared-config/verify-all.sh +0 -207
- package/ext/aastar-shared-config/verify-contracts.sh +0 -85
- package/ext/aastar-shared-config/verify-mysbt-v243.mjs +0 -27
- package/ext/aastar-shared-config/verify-onchain-versions.mjs +0 -93
- package/l4-setup.sh +0 -11
- package/lib/SHARED_CONFIG_REFERENCE.md +0 -133
- package/lib/shared-config/.env.example +0 -6
- package/lib/shared-config/.github/workflows/check-secrets.yml +0 -257
- package/lib/shared-config/AGENTS.md +0 -21
- package/lib/shared-config/CHANGELOG.md +0 -99
- package/lib/shared-config/LICENSE +0 -21
- package/lib/shared-config/QUICK_START.md +0 -215
- package/lib/shared-config/README.md +0 -412
- package/lib/shared-config/SHARED_CONFIG_SUMMARY.md +0 -273
- package/lib/shared-config/check-locker-status.mjs +0 -7
- package/lib/shared-config/favicon.ico +0 -0
- package/lib/shared-config/generate-comparison-table.sh +0 -67
- package/lib/shared-config/package.json +0 -46
- package/lib/shared-config/pnpm-lock.yaml +0 -1182
- package/lib/shared-config/src/abis/BLSAggregator.json +0 -1
- package/lib/shared-config/src/abis/DVTValidator.json +0 -1
- package/lib/shared-config/src/abis/GToken.json +0 -1
- package/lib/shared-config/src/abis/GTokenStaking.json +0 -1
- package/lib/shared-config/src/abis/MySBT.json +0 -1
- package/lib/shared-config/src/abis/PaymasterFactory.json +0 -1
- package/lib/shared-config/src/abis/PaymasterV4.json +0 -1098
- package/lib/shared-config/src/abis/Registry.json +0 -1
- package/lib/shared-config/src/abis/SimpleAccount.json +0 -557
- package/lib/shared-config/src/abis/SimpleAccountFactory.json +0 -87
- package/lib/shared-config/src/abis/SuperPaymasterV2.json +0 -1
- package/lib/shared-config/src/abis/index.ts +0 -45
- package/lib/shared-config/src/abis/xPNTsFactory.json +0 -1
- package/lib/shared-config/src/abis/xPNTsToken.json +0 -1
- package/lib/shared-config/src/branding.ts +0 -32
- package/lib/shared-config/src/communities.ts +0 -93
- package/lib/shared-config/src/constants.ts +0 -67
- package/lib/shared-config/src/contract-addresses.ts +0 -95
- package/lib/shared-config/src/contract-versions.ts +0 -374
- package/lib/shared-config/src/contracts.ts +0 -414
- package/lib/shared-config/src/index.ts +0 -14
- package/lib/shared-config/sync-abis.sh +0 -92
- package/lib/shared-config/sync-versions.mjs +0 -150
- package/lib/shared-config/tsconfig.json +0 -18
- package/lib/shared-config/tsup.config.ts +0 -10
- package/lib/shared-config/verify-all.sh +0 -207
- package/lib/shared-config/verify-contracts.sh +0 -85
- package/lib/shared-config/verify-mysbt-v243.mjs +0 -27
- package/lib/shared-config/verify-onchain-versions.mjs +0 -93
- package/packages/account/package.json +0 -23
- package/packages/account/src/accounts/simple.test.ts +0 -93
- package/packages/account/src/eoa.test.ts +0 -37
- package/packages/account/src/eoa.ts +0 -33
- package/packages/account/src/index.test.ts +0 -34
- package/packages/account/src/index.ts +0 -61
- package/packages/account/tsconfig.json +0 -11
- package/packages/analytics/package.json +0 -28
- package/packages/analytics/src/index.ts +0 -145
- package/packages/analytics/tsconfig.json +0 -11
- package/packages/core/package.json +0 -32
- package/packages/core/scripts/audit-abi-coverage.ts +0 -165
- package/packages/core/scripts/debug-regex.ts +0 -36
- package/packages/core/src/abis/.abi-hashes.json +0 -26
- package/packages/core/src/abis/BLSAggregator.json +0 -686
- package/packages/core/src/abis/BLSValidator.json +0 -42
- package/packages/core/src/abis/DVTValidator.json +0 -368
- package/packages/core/src/abis/Eip7702Support.json +0 -24
- package/packages/core/src/abis/EntryPoint.json +0 -1382
- package/packages/core/src/abis/GToken.json +0 -513
- package/packages/core/src/abis/GTokenStaking.json +0 -949
- package/packages/core/src/abis/LegacyAccount.json +0 -625
- package/packages/core/src/abis/MySBT.json +0 -1518
- package/packages/core/src/abis/Paymaster.json +0 -1143
- package/packages/core/src/abis/PaymasterFactory.json +0 -640
- package/packages/core/src/abis/Registry.json +0 -1942
- package/packages/core/src/abis/ReputationSystem.json +0 -699
- package/packages/core/src/abis/SenderCreator.json +0 -99
- package/packages/core/src/abis/Simple7702Account.json +0 -395
- package/packages/core/src/abis/SimpleAccount.json +0 -560
- package/packages/core/src/abis/SimpleAccountFactory.json +0 -111
- package/packages/core/src/abis/SimpleAccountFactoryV08.json +0 -87
- package/packages/core/src/abis/SimpleAccountV08.json +0 -557
- package/packages/core/src/abis/SuperPaymaster.json +0 -1781
- package/packages/core/src/abis/UserOperationLib.json +0 -57
- package/packages/core/src/abis/abi.config.json +0 -24
- package/packages/core/src/abis/xPNTsFactory.json +0 -718
- package/packages/core/src/abis/xPNTsToken.json +0 -1280
- package/packages/core/src/actions/StateValidator.test.ts +0 -175
- package/packages/core/src/actions/account.test.ts +0 -155
- package/packages/core/src/actions/account.ts +0 -179
- package/packages/core/src/actions/aggregator.test.ts +0 -88
- package/packages/core/src/actions/aggregator.ts +0 -41
- package/packages/core/src/actions/dvt.test.ts +0 -124
- package/packages/core/src/actions/dvt.ts +0 -53
- package/packages/core/src/actions/entryPoint.test.ts +0 -176
- package/packages/core/src/actions/entryPoint.ts +0 -266
- package/packages/core/src/actions/factory.test.ts +0 -250
- package/packages/core/src/actions/factory.ts +0 -613
- package/packages/core/src/actions/faucet.test.ts +0 -202
- package/packages/core/src/actions/gtokenExtended.test.ts +0 -162
- package/packages/core/src/actions/gtokenExtended.ts +0 -153
- package/packages/core/src/actions/paymasterV4.test.ts +0 -209
- package/packages/core/src/actions/paymasterV4.ts +0 -455
- package/packages/core/src/actions/registry.test.ts +0 -443
- package/packages/core/src/actions/registry.ts +0 -860
- package/packages/core/src/actions/reputation.test.ts +0 -225
- package/packages/core/src/actions/reputation.ts +0 -378
- package/packages/core/src/actions/sbt.test.ts +0 -322
- package/packages/core/src/actions/sbt.ts +0 -681
- package/packages/core/src/actions/staking.test.ts +0 -273
- package/packages/core/src/actions/superPaymaster.test.ts +0 -356
- package/packages/core/src/actions/superPaymaster.ts +0 -828
- package/packages/core/src/actions/tokens.test.ts +0 -60
- package/packages/core/src/actions/tokens.ts +0 -527
- package/packages/core/src/actions/validators.test.ts +0 -239
- package/packages/core/src/actions/validators.ts +0 -590
- package/packages/core/src/branding.ts +0 -32
- package/packages/core/src/clients.ts +0 -13
- package/packages/core/src/communities.ts +0 -93
- package/packages/core/src/constants.ts +0 -145
- package/packages/core/src/contract-addresses.ts +0 -125
- package/packages/core/src/contracts.test.ts +0 -58
- package/packages/core/src/contracts.ts +0 -414
- package/packages/core/src/networks.ts +0 -127
- package/packages/core/src/requirementChecker.test.ts +0 -71
- package/packages/core/src/roles.test.ts +0 -34
- package/packages/core/src/utils/validation.test.ts +0 -50
- package/packages/core/src/utils.ts +0 -23
- package/packages/core/tsconfig.json +0 -12
- package/packages/core/vitest.config.ts +0 -14
- package/packages/dapp/package.json +0 -30
- package/packages/dapp/src/ui/components/EvaluationPanel.tsx +0 -40
- package/packages/dapp/tsconfig.json +0 -12
- package/packages/identity/package.json +0 -25
- package/packages/identity/tsconfig.json +0 -11
- package/packages/paymaster/package.json +0 -25
- package/packages/paymaster/src/V4/PaymasterClient.test.ts +0 -114
- package/packages/paymaster/src/V4/PaymasterOperator.test.ts +0 -80
- package/packages/paymaster/src/V4/PaymasterUtils.test.ts +0 -54
- package/packages/paymaster/src/V4/SuperPaymasterClient.test.ts +0 -79
- package/packages/paymaster/tsconfig.json +0 -11
- package/packages/sdk/README.md +0 -150
- package/packages/sdk/aastar/package.json +0 -21
- package/packages/sdk/aastar/src/index.ts +0 -3
- package/packages/sdk/aastar/tsconfig.json +0 -7
- package/packages/sdk/coverage_output.txt +0 -393
- package/packages/sdk/coverage_output_final.txt +0 -739
- package/packages/sdk/coverage_output_final_v2.txt +0 -722
- package/packages/sdk/coverage_output_final_v3.txt +0 -722
- package/packages/sdk/package.json +0 -44
- package/packages/sdk/src/clients/admin.ts +0 -154
- package/packages/sdk/src/clients/community.test.ts +0 -118
- package/packages/sdk/src/clients/endUser.test.ts +0 -221
- package/packages/sdk/src/clients/endUser.ts +0 -551
- package/packages/sdk/src/clients/operator.test.ts +0 -162
- package/packages/sdk/src/errors/AAStarError.ts +0 -70
- package/packages/sdk/src/utils/testScenarios.ts +0 -128
- package/packages/sdk/tests/scenarios/01_onboard_community.ts +0 -62
- package/packages/sdk/tests/scenarios/02_onboard_operator.ts +0 -109
- package/packages/sdk/tests/scenarios/03_onboard_user.ts +0 -53
- package/packages/sdk/tests/scenarios/04_gasless_tx_flow.ts +0 -68
- package/packages/sdk/tests/scenarios/check_entrypoint.ts +0 -19
- package/packages/sdk/tests/scenarios/check_initialization.ts +0 -65
- package/packages/sdk/tests/scenarios/debug_addresses.ts +0 -26
- package/packages/sdk/tests/scenarios/diagnose_scenario4.ts +0 -55
- package/packages/sdk/tests/scenarios/setup.ts +0 -33
- package/packages/sdk/tests/scenarios/test_entrypoint_nonce.ts +0 -46
- package/packages/sdk/tsconfig.json +0 -11
- package/packages/tokens/package.json +0 -25
- package/packages/tokens/tsconfig.json +0 -11
- package/pnpm-workspace.yaml +0 -2
- package/run_l4_gasless_regression.sh +0 -79
- package/run_sdk_regression.sh +0 -238
- package/scripts/00_utils.ts +0 -59
- package/scripts/00_verify_phase1.ts +0 -130
- package/scripts/01_1_prep_gtoken.ts +0 -81
- package/scripts/01_2_register_sbt.ts +0 -88
- package/scripts/01_3_prep_tokens_paymaster.ts +0 -102
- package/scripts/01_prepare_all.ts +0 -222
- package/scripts/02_test_eoa.ts +0 -53
- package/scripts/03_test_standard_aa.ts +0 -68
- package/scripts/04_0_check_deploy.ts +0 -24
- package/scripts/04_1_check_allowance.ts +0 -44
- package/scripts/04_2_construct_verify.ts +0 -96
- package/scripts/04_3_verify_estimate.ts +0 -66
- package/scripts/04_4_verify_pack.ts +0 -74
- package/scripts/04_test_paymaster_v4.ts +0 -60
- package/scripts/05_1_deposit.ts +0 -48
- package/scripts/05_test_superpaymaster.ts +0 -58
- package/scripts/06_local_test_v3_admin.ts +0 -163
- package/scripts/06_local_test_v3_execution.ts +0 -132
- package/scripts/06_local_test_v3_full.ts +0 -490
- package/scripts/06_local_test_v3_funding.ts +0 -124
- package/scripts/06_local_test_v3_reputation.ts +0 -234
- package/scripts/07_local_test_v3_audit.ts +0 -181
- package/scripts/08_local_test_registry_lifecycle.ts +0 -382
- package/scripts/09_local_test_community_lifecycle.ts +0 -385
- package/scripts/09_local_test_community_simple.ts +0 -108
- package/scripts/09_scenario_bread_independent.ts +0 -247
- package/scripts/10_scenario_super_shared.ts +0 -196
- package/scripts/10_test_protocol_admin_full.ts +0 -173
- package/scripts/11_scenario_hacker_defense.ts +0 -104
- package/scripts/11_test_core_flows_full.ts +0 -157
- package/scripts/12_test_slash_mechanism.ts +0 -205
- package/scripts/12_test_slash_queries.ts +0 -83
- package/scripts/12_test_staking_exit.ts +0 -152
- package/scripts/12_test_staking_slash.ts +0 -301
- package/scripts/12_test_tier2_slash.ts +0 -139
- package/scripts/13_test_sbt_burn_linkage.ts +0 -266
- package/scripts/14_test_credit_redesign.ts +0 -266
- package/scripts/15_test_bls_full.ts +0 -148
- package/scripts/15_test_dvt_bls_full.ts +0 -140
- package/scripts/17_test_cross_role_collaboration.ts +0 -95
- package/scripts/18_sdk_e2e_verification.ts +0 -67
- package/scripts/18_test_dvt_sdk_flow.ts +0 -138
- package/scripts/18_test_lifecycle_completion.ts +0 -144
- package/scripts/19_sdk_experiment_runner.ts +0 -114
- package/scripts/19_sdk_experiment_runner.ts.backup +0 -391
- package/scripts/20_sdk_full_capability.ts +0 -93
- package/scripts/20_test_superpaymaster_new_apis.ts +0 -193
- package/scripts/21_test_paymasterv4_complete.ts +0 -341
- package/scripts/22_test_bls_signing.ts +0 -260
- package/scripts/23_test_middleware.ts +0 -197
- package/scripts/98_edge_reentrancy.ts +0 -85
- package/scripts/99_bug_hunting_fast.ts +0 -99
- package/scripts/analyze_abi_coverage.ts +0 -169
- package/scripts/check-admin.ts +0 -95
- package/scripts/check-jason-status.ts +0 -184
- package/scripts/check-roles.ts +0 -36
- package/scripts/clear-nonce.ts +0 -47
- package/scripts/collect_industry_baseline.ts +0 -236
- package/scripts/complete-jack-superpaymaster.ts +0 -171
- package/scripts/complete_env_config.ts +0 -97
- package/scripts/debug-addr.ts +0 -43
- package/scripts/debug-community-registration.ts +0 -92
- package/scripts/debug-deploy-v4.ts +0 -116
- package/scripts/debug-paymaster.ts +0 -127
- package/scripts/debug-register-role.ts +0 -101
- package/scripts/debug-version.ts +0 -71
- package/scripts/debug_account_c.ts +0 -43
- package/scripts/debug_bls.ts +0 -58
- package/scripts/debug_config_v036.ts +0 -13
- package/scripts/debug_contracts.ts +0 -2
- package/scripts/debug_env.ts +0 -69
- package/scripts/debug_find_paymaster.ts +0 -98
- package/scripts/debug_isolated_registration.ts +0 -256
- package/scripts/debug_paymaster_config.ts +0 -19
- package/scripts/debug_pim_addr.ts +0 -23
- package/scripts/debug_pm_status.ts +0 -51
- package/scripts/debug_registry.ts +0 -39
- package/scripts/debug_registry_setup.ts +0 -129
- package/scripts/debug_sanity.ts +0 -32
- package/scripts/debug_shared_config.ts +0 -10
- package/scripts/debug_token_compat.ts +0 -51
- package/scripts/debug_tokens.ts +0 -41
- package/scripts/debug_vcheck.ts +0 -33
- package/scripts/deploy-sync.ts +0 -104
- package/scripts/deploy_and_init_v3.sh +0 -134
- package/scripts/deploy_anvil_accounts.ts +0 -144
- package/scripts/deploy_paymaster_v4.ts +0 -139
- package/scripts/deploy_test_accounts.ts +0 -401
- package/scripts/deprecated/check_aa_entrypoint.ts +0 -29
- package/scripts/deprecated/check_paymaster_deposits.ts +0 -45
- package/scripts/deprecated/debug_aoa_function.ts +0 -28
- package/scripts/deprecated/debug_aoa_issue.ts +0 -16
- package/scripts/deprecated/debug_pimlico_aa23.ts +0 -40
- package/scripts/deprecated/debug_summary.ts +0 -34
- package/scripts/deprecated/deploy_v07_aa.ts +0 -99
- package/scripts/deprecated/fix_all_issues.ts +0 -61
- package/scripts/deprecated/fund_bpnts.ts +0 -52
- package/scripts/deprecated/get_factory_addresses.ts +0 -28
- package/scripts/deprecated/recheck_pim.ts +0 -34
- package/scripts/dev_tools/extract_abis.sh +0 -151
- package/scripts/dev_tools/extract_addresses_to_env.sh +0 -67
- package/scripts/dev_tools/final_safe_harmonize.py +0 -77
- package/scripts/dev_tools/safe_harmonize.py +0 -107
- package/scripts/dev_tools/surgical_harmonize.py +0 -83
- package/scripts/experiment/stage3/SETUP_GUIDE.md +0 -258
- package/scripts/experiment/stage3/archived_scripts/00_token_distribution.ts +0 -78
- package/scripts/experiment/stage3/archived_scripts/01_dao_launch.ts +0 -96
- package/scripts/experiment/stage3/archived_scripts/01b_bread_launch.ts +0 -112
- package/scripts/experiment/stage3/archived_scripts/02_operator_setup.ts +0 -84
- package/scripts/experiment/stage3/archived_scripts/02b_operator_b_setup.ts +0 -104
- package/scripts/experiment/stage3/archived_scripts/02c_finalize_operators.ts +0 -86
- package/scripts/experiment/stage3/archived_scripts/02d_operator_collateral.ts +0 -89
- package/scripts/experiment/stage3/archived_scripts/03_user_onboarding.ts +0 -83
- package/scripts/experiment/stage3/archived_scripts/03b_deploy_aa_account.ts +0 -61
- package/scripts/experiment/stage3/archived_scripts/03c_aa_onboarding.ts +0 -104
- package/scripts/experiment/stage3/archived_scripts/03d_mint_points.ts +0 -60
- package/scripts/experiment/stage3/archived_scripts/04_benchmarking.ts +0 -100
- package/scripts/experiment/stage3/archived_scripts/05_multi_op_setup.ts +0 -149
- package/scripts/experiment/stage3/archived_scripts/README.md +0 -58
- package/scripts/experiment/stage3/archived_scripts/check_roles.ts +0 -29
- package/scripts/experiment/stage3/archived_scripts/decode_error.ts +0 -23
- package/scripts/experiment/stage3/archived_scripts/fund_user.ts +0 -51
- package/scripts/experiment/stage3/archived_scripts/gen_b_key.ts +0 -3
- package/scripts/experiment/stage3/archived_scripts/gen_keys.ts +0 -4
- package/scripts/experiment/stage3/archived_scripts/setup.ts +0 -105
- package/scripts/experiment/stage3/archived_scripts/test_key.ts +0 -4
- package/scripts/experiment/stage3/archived_scripts/verify_state.ts +0 -59
- package/scripts/experiment/stage3/refactored/00_token_distribution.ts +0 -46
- package/scripts/experiment/stage3/refactored/02_operator_setup.ts +0 -65
- package/scripts/experiment/stage3/refactored/03_user_onboarding.ts +0 -68
- package/scripts/experiment/stage3/refactored/05_multi_op_setup.ts +0 -63
- package/scripts/experiment/stage3/refactored/README.md +0 -71
- package/scripts/extract-docs.sh +0 -141
- package/scripts/fund-jack.ts +0 -38
- package/scripts/generate_env_from_deployment.ts +0 -109
- package/scripts/inspect-anni-token.ts +0 -116
- package/scripts/inspect-factory.ts +0 -83
- package/scripts/l4-paymasterv4-transfer-test.ts +0 -228
- package/scripts/l4-setup.ts +0 -453
- package/scripts/l4-state.json +0 -80
- package/scripts/phase1_verify_contracts.ts +0 -207
- package/scripts/pre_test_sync.ts +0 -83
- package/scripts/prepare_sepolia_resources.ts +0 -154
- package/scripts/publish_all.sh +0 -39
- package/scripts/query-jack-token.ts +0 -22
- package/scripts/quick_setup.ts +0 -124
- package/scripts/quick_setup_account.ts +0 -80
- package/scripts/run_automated_experiment.sh +0 -121
- package/scripts/run_daily_experiment.ts +0 -70
- package/scripts/run_l4_gasless_regression.sh +0 -32
- package/scripts/run_sdk_experiment.sh +0 -13
- package/scripts/run_sdk_regression-v2.sh +0 -38
- package/scripts/sdk_regression_v2.ts +0 -162
- package/scripts/security_audit.sh +0 -172
- package/scripts/setup-bbq-community.ts +0 -187
- package/scripts/setup-dancing-community.ts +0 -223
- package/scripts/setup_test_accounts.ts +0 -88
- package/scripts/setup_test_environment.ts +0 -147
- package/scripts/sync_anvil_config.cjs +0 -44
- package/scripts/sync_config_to_env.ts +0 -88
- package/scripts/sync_contract_addresses.ts +0 -186
- package/scripts/sync_sepolia_config.cjs +0 -90
- package/scripts/sync_sepolia_config.mjs +0 -74
- package/scripts/test-brown-v4-deploy.ts +0 -90
- package/scripts/test-faucet-and-gasless.ts +0 -170
- package/scripts/test-jack-gasless.ts +0 -119
- package/scripts/test-jack-registration.ts +0 -133
- package/scripts/test-jack-superpaymaster-api.ts +0 -112
- package/scripts/test-kms-gasless.ts +0 -138
- package/scripts/test_groups.ts +0 -138
- package/scripts/test_multi_community_anvil.ts +0 -276
- package/scripts/test_new_sdk_apis_sepolia.ts +0 -193
- package/scripts/test_sdk_join_idempotent.ts +0 -233
- package/scripts/test_simple_sepolia.ts +0 -44
- package/scripts/update_env_from_config.ts +0 -83
- package/scripts/v2_regression/README.md +0 -161
- package/scripts/verify-tx-status.ts +0 -81
- package/scripts/verify_onchain_milestone.ts +0 -114
- package/scripts/verify_phase1.ts +0 -66
- package/scripts/verify_phase2.ts +0 -66
- package/sdk_experiment_data.csv +0 -4
- package/simple-test-paymaster.sh +0 -2
- package/simple-test-superpaymaster.sh +0 -1
- package/tests/l1-regression.test.ts +0 -458
- package/tests/l4-test-anni-gasless.ts +0 -105
- package/tests/l4-test-jason1-gasless.ts +0 -150
- package/tests/l4-test-jason2-gasless.ts +0 -174
- package/tests/l4-test-pmv4-deposit.ts +0 -111
- package/tests/l4-test-pmv4-gasless.ts +0 -166
- package/tests/l4-test-pmv4-submit.ts +0 -223
- package/tests/regression/README.md +0 -168
- package/tests/regression/config.ts +0 -215
- package/tests/regression/display-versions.ts +0 -85
- package/tests/regression/index.ts +0 -67
- package/tests/regression/l1-tests.ts +0 -267
- package/tests/regression/l2-tests.ts +0 -171
- package/tests/regression/l3-tests.ts +0 -125
- package/tests/regression/l4-gasless.ts +0 -897
- package/tests/regression/l4-runner.ts +0 -52
- package/tests/reports/phase1_contract_verification.md +0 -45
- package/tests/utils/contractVerifier.ts +0 -237
- package/tests/utils/userOpHelper.ts +0 -194
- package/tsconfig.json +0 -41
- package/typedoc.json +0 -59
- package/vitest.config.ts +0 -16
- /package/{packages/core/src/crypto/index.ts → dist/core/src/crypto/index.d.ts} +0 -0
- /package/{packages/paymaster/src/V4/index.ts → dist/paymaster/src/V4/index.d.ts} +0 -0
- /package/{packages/sdk/examples → examples}/config.json +0 -0
- /package/{packages/sdk/examples → examples}/regression_test.ts +0 -0
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
## Classes
|
|
2
|
-
|
|
3
|
-
### UserOpClient
|
|
4
|
-
|
|
5
|
-
Defined in: [packages/account/src/index.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/index.ts#L40)
|
|
6
|
-
|
|
7
|
-
UserOperation Client for handling high-level flows
|
|
8
|
-
|
|
9
|
-
#### Constructors
|
|
10
|
-
|
|
11
|
-
##### Constructor
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
new UserOpClient(): UserOpClient;
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
###### Returns
|
|
18
|
-
|
|
19
|
-
[`UserOpClient`](#useropclient)
|
|
20
|
-
|
|
21
|
-
#### Methods
|
|
22
|
-
|
|
23
|
-
##### estimateGas()
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
static estimateGas(
|
|
27
|
-
bundler,
|
|
28
|
-
op,
|
|
29
|
-
entryPoint): Promise<any>;
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Defined in: [packages/account/src/index.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/index.ts#L41)
|
|
33
|
-
|
|
34
|
-
###### Parameters
|
|
35
|
-
|
|
36
|
-
| Parameter | Type |
|
|
37
|
-
| ------ | ------ |
|
|
38
|
-
| `bundler` | `any` |
|
|
39
|
-
| `op` | `any` |
|
|
40
|
-
| `entryPoint` | `` `0x${string}` `` |
|
|
41
|
-
|
|
42
|
-
###### Returns
|
|
43
|
-
|
|
44
|
-
`Promise`\<`any`\>
|
|
45
|
-
|
|
46
|
-
##### getReceipt()
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
static getReceipt(bundler, hash): Promise<any>;
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Defined in: [packages/account/src/index.ts:55](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/index.ts#L55)
|
|
53
|
-
|
|
54
|
-
###### Parameters
|
|
55
|
-
|
|
56
|
-
| Parameter | Type |
|
|
57
|
-
| ------ | ------ |
|
|
58
|
-
| `bundler` | `any` |
|
|
59
|
-
| `hash` | `` `0x${string}` `` |
|
|
60
|
-
|
|
61
|
-
###### Returns
|
|
62
|
-
|
|
63
|
-
`Promise`\<`any`\>
|
|
64
|
-
|
|
65
|
-
##### sendUserOp()
|
|
66
|
-
|
|
67
|
-
```ts
|
|
68
|
-
static sendUserOp(
|
|
69
|
-
bundler,
|
|
70
|
-
op,
|
|
71
|
-
entryPoint): Promise<any>;
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Defined in: [packages/account/src/index.ts:48](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/index.ts#L48)
|
|
75
|
-
|
|
76
|
-
###### Parameters
|
|
77
|
-
|
|
78
|
-
| Parameter | Type |
|
|
79
|
-
| ------ | ------ |
|
|
80
|
-
| `bundler` | `any` |
|
|
81
|
-
| `op` | `any` |
|
|
82
|
-
| `entryPoint` | `` `0x${string}` `` |
|
|
83
|
-
|
|
84
|
-
###### Returns
|
|
85
|
-
|
|
86
|
-
`Promise`\<`any`\>
|
|
87
|
-
|
|
88
|
-
## Type Aliases
|
|
89
|
-
|
|
90
|
-
### EOAWalletClient
|
|
91
|
-
|
|
92
|
-
```ts
|
|
93
|
-
type EOAWalletClient = WalletClient & object;
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Defined in: [packages/account/src/eoa.ts:4](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/eoa.ts#L4)
|
|
97
|
-
|
|
98
|
-
#### Type Declaration
|
|
99
|
-
|
|
100
|
-
| Name | Type | Defined in |
|
|
101
|
-
| ------ | ------ | ------ |
|
|
102
|
-
| `getAddress()` | () => `Address` | [packages/account/src/eoa.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/eoa.ts#L6) |
|
|
103
|
-
| `sendTransaction()` | (`args`) => `Promise`\<`Hash`\> | [packages/account/src/eoa.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/eoa.ts#L5) |
|
|
104
|
-
|
|
105
|
-
***
|
|
106
|
-
|
|
107
|
-
### SimpleSmartAccount
|
|
108
|
-
|
|
109
|
-
```ts
|
|
110
|
-
type SimpleSmartAccount = LocalAccount & object;
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Defined in: [packages/account/src/accounts/simple.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/accounts/simple.ts#L15)
|
|
114
|
-
|
|
115
|
-
#### Type Declaration
|
|
116
|
-
|
|
117
|
-
| Name | Type | Defined in |
|
|
118
|
-
| ------ | ------ | ------ |
|
|
119
|
-
| `entryPoint` | `Address` | [packages/account/src/accounts/simple.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/accounts/simple.ts#L19) |
|
|
120
|
-
| `getDummySignature()` | () => `Promise`\<`Hex`\> | [packages/account/src/accounts/simple.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/accounts/simple.ts#L18) |
|
|
121
|
-
| `getInitCode()` | () => `Promise`\<`Hex`\> | [packages/account/src/accounts/simple.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/accounts/simple.ts#L17) |
|
|
122
|
-
| `signUserOperation()` | (`userOp`) => `Promise`\<`Hex`\> | [packages/account/src/accounts/simple.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/accounts/simple.ts#L16) |
|
|
123
|
-
|
|
124
|
-
## Functions
|
|
125
|
-
|
|
126
|
-
### createEOAWalletClient()
|
|
127
|
-
|
|
128
|
-
```ts
|
|
129
|
-
function createEOAWalletClient(
|
|
130
|
-
privateKey,
|
|
131
|
-
chain,
|
|
132
|
-
transport): EOAWalletClient;
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Defined in: [packages/account/src/eoa.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/eoa.ts#L9)
|
|
136
|
-
|
|
137
|
-
#### Parameters
|
|
138
|
-
|
|
139
|
-
| Parameter | Type |
|
|
140
|
-
| ------ | ------ |
|
|
141
|
-
| `privateKey` | `` `0x${string}` `` |
|
|
142
|
-
| `chain` | `Chain` |
|
|
143
|
-
| `transport` | `Transport` |
|
|
144
|
-
|
|
145
|
-
#### Returns
|
|
146
|
-
|
|
147
|
-
[`EOAWalletClient`](#eoawalletclient)
|
|
148
|
-
|
|
149
|
-
***
|
|
150
|
-
|
|
151
|
-
### getUserOpHash()
|
|
152
|
-
|
|
153
|
-
```ts
|
|
154
|
-
function getUserOpHash(
|
|
155
|
-
op,
|
|
156
|
-
ep,
|
|
157
|
-
chainId): `0x${string}`;
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Defined in: [packages/account/src/index.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/index.ts#L16)
|
|
161
|
-
|
|
162
|
-
Local implementation of EntryPoint v0.7 getUserOpHash
|
|
163
|
-
|
|
164
|
-
#### Parameters
|
|
165
|
-
|
|
166
|
-
| Parameter | Type |
|
|
167
|
-
| ------ | ------ |
|
|
168
|
-
| `op` | `any` |
|
|
169
|
-
| `ep` | `` `0x${string}` `` |
|
|
170
|
-
| `chainId` | `number` |
|
|
171
|
-
|
|
172
|
-
#### Returns
|
|
173
|
-
|
|
174
|
-
`` `0x${string}` ``
|
|
175
|
-
|
|
176
|
-
***
|
|
177
|
-
|
|
178
|
-
### packUserOpLimits()
|
|
179
|
-
|
|
180
|
-
```ts
|
|
181
|
-
function packUserOpLimits(high, low): `0x${string}`;
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
Defined in: [packages/account/src/index.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/index.ts#L9)
|
|
185
|
-
|
|
186
|
-
Common Pack Logic for v0.7 UserOperations
|
|
187
|
-
|
|
188
|
-
#### Parameters
|
|
189
|
-
|
|
190
|
-
| Parameter | Type |
|
|
191
|
-
| ------ | ------ |
|
|
192
|
-
| `high` | `bigint` |
|
|
193
|
-
| `low` | `bigint` |
|
|
194
|
-
|
|
195
|
-
#### Returns
|
|
196
|
-
|
|
197
|
-
`` `0x${string}` ``
|
|
198
|
-
|
|
199
|
-
***
|
|
200
|
-
|
|
201
|
-
### toSimpleSmartAccount()
|
|
202
|
-
|
|
203
|
-
```ts
|
|
204
|
-
function toSimpleSmartAccount(parameters): Promise<SimpleSmartAccount>;
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
Defined in: [packages/account/src/accounts/simple.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/account/src/accounts/simple.ts#L22)
|
|
208
|
-
|
|
209
|
-
#### Parameters
|
|
210
|
-
|
|
211
|
-
| Parameter | Type |
|
|
212
|
-
| ------ | ------ |
|
|
213
|
-
| `parameters` | \{ `client`: `any`; `entryPoint`: \{ `address`: `` `0x${string}` ``; `version`: `"0.6"` \| `"0.7"`; \}; `factoryAddress`: `` `0x${string}` ``; `index?`: `bigint`; `owner`: \{ `address`: `` `0x${string}` ``; `nonceManager?`: `NonceManager`; `publicKey`: `` `0x${string}` ``; `sign?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; `signAuthorization?`: (`parameters`) => `Promise`\<`SignAuthorizationReturnType`\>; `signMessage`: (`__namedParameters`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`serializer`, `transaction`\>(`transaction`, `options?`) => `Promise`\<`` `0x${string}` ``\>; `signTypedData`: \<`typedData`, `primaryType`\>(`parameters`) => `Promise`\<`` `0x${string}` ``\>; `source`: `string`; `type`: `"local"`; \}; `salt?`: `bigint`; \} |
|
|
214
|
-
| `parameters.client` | `any` |
|
|
215
|
-
| `parameters.entryPoint` | \{ `address`: `` `0x${string}` ``; `version`: `"0.6"` \| `"0.7"`; \} |
|
|
216
|
-
| `parameters.entryPoint.address` | `` `0x${string}` `` |
|
|
217
|
-
| `parameters.entryPoint.version` | `"0.6"` \| `"0.7"` |
|
|
218
|
-
| `parameters.factoryAddress` | `` `0x${string}` `` |
|
|
219
|
-
| `parameters.index?` | `bigint` |
|
|
220
|
-
| `parameters.owner` | \{ `address`: `` `0x${string}` ``; `nonceManager?`: `NonceManager`; `publicKey`: `` `0x${string}` ``; `sign?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; `signAuthorization?`: (`parameters`) => `Promise`\<`SignAuthorizationReturnType`\>; `signMessage`: (`__namedParameters`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`serializer`, `transaction`\>(`transaction`, `options?`) => `Promise`\<`` `0x${string}` ``\>; `signTypedData`: \<`typedData`, `primaryType`\>(`parameters`) => `Promise`\<`` `0x${string}` ``\>; `source`: `string`; `type`: `"local"`; \} |
|
|
221
|
-
| `parameters.owner.address` | `` `0x${string}` `` |
|
|
222
|
-
| `parameters.owner.nonceManager?` | `NonceManager` |
|
|
223
|
-
| `parameters.owner.publicKey` | `` `0x${string}` `` |
|
|
224
|
-
| `parameters.owner.sign?` | (`parameters`) => `Promise`\<`` `0x${string}` ``\> |
|
|
225
|
-
| `parameters.owner.signAuthorization?` | (`parameters`) => `Promise`\<`SignAuthorizationReturnType`\> |
|
|
226
|
-
| `parameters.owner.signMessage` | (`__namedParameters`) => `Promise`\<`` `0x${string}` ``\> |
|
|
227
|
-
| `parameters.owner.signTransaction` | \<`serializer`, `transaction`\>(`transaction`, `options?`) => `Promise`\<`` `0x${string}` ``\> |
|
|
228
|
-
| `parameters.owner.signTypedData` | \<`typedData`, `primaryType`\>(`parameters`) => `Promise`\<`` `0x${string}` ``\> |
|
|
229
|
-
| `parameters.owner.source` | `string` |
|
|
230
|
-
| `parameters.owner.type` | `"local"` |
|
|
231
|
-
| `parameters.salt?` | `bigint` |
|
|
232
|
-
|
|
233
|
-
#### Returns
|
|
234
|
-
|
|
235
|
-
`Promise`\<[`SimpleSmartAccount`](#simplesmartaccount)\>
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
## Classes
|
|
2
|
-
|
|
3
|
-
### AnalyticsClient
|
|
4
|
-
|
|
5
|
-
Defined in: [packages/analytics/src/index.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/analytics/src/index.ts#L16)
|
|
6
|
-
|
|
7
|
-
Analytics client for monitoring and statistics
|
|
8
|
-
|
|
9
|
-
#### Role Required
|
|
10
|
-
|
|
11
|
-
None (public query APIs)
|
|
12
|
-
|
|
13
|
-
#### Description
|
|
14
|
-
|
|
15
|
-
Dashboard and monitoring tools
|
|
16
|
-
|
|
17
|
-
## No Permission Required - All Public Queries
|
|
18
|
-
|
|
19
|
-
## Typical Users:
|
|
20
|
-
- Dashboard Developers
|
|
21
|
-
- Community Analytics
|
|
22
|
-
- Investors & Researchers
|
|
23
|
-
|
|
24
|
-
#### Constructors
|
|
25
|
-
|
|
26
|
-
##### Constructor
|
|
27
|
-
|
|
28
|
-
```ts
|
|
29
|
-
new AnalyticsClient(publicClient, addresses?): AnalyticsClient;
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Defined in: [packages/analytics/src/index.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/analytics/src/index.ts#L21)
|
|
33
|
-
|
|
34
|
-
###### Parameters
|
|
35
|
-
|
|
36
|
-
| Parameter | Type | Description |
|
|
37
|
-
| ------ | ------ | ------ |
|
|
38
|
-
| `publicClient` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: \| `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<`CallReturnType`\>; `ccipRead?`: \| `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: `Chain` \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: `AccessList`; `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: `EIP1193RequestFn`\<readonly \[\{ `Method`: `"eth_getFilterChanges"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `` `0x${string}` ``[] \| `RpcLog`[]; \}, \{ `Method`: `"eth_getFilterLogs"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `RpcLog`[]; \}, \{ `Method`: `"eth_uninstallFilter"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `boolean`; \}\]\>; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<`CreateContractEventFilterReturnType`\<`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`\<readonly \[\{ `Method`: `"eth_getFilterChanges"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `` `0x${string}` ``[] \| `RpcLog`[]; \}, \{ `Method`: `"eth_getFilterLogs"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `RpcLog`[]; \}, \{ `Method`: `"eth_uninstallFilter"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `boolean`; \}\]\>; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<`EstimateFeesPerGasReturnType`\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: `BlockTag`; `extend`: \<`client`\>(`fn`) => `Client`\<`Transport`, `Chain` \| `undefined`, `undefined`, `PublicRpcSchema`, \{ \[K in string \| number \| symbol\]: client\[K\] \} & `PublicActions`\<`Transport`, `Chain` \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<`FillTransactionReturnType`\<`Chain` \| `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`: `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`; `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`; `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`; `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`; `authorizationList`: `SignedAuthorizationList`; `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`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: `Withdrawal`[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<`GetCodeReturnType`\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<`GetCodeReturnType`\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<`GetContractEventsReturnType`\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<`GetEip712DomainReturnType`\>; `getEnsAddress`: (`args`) => `Promise`\<`GetEnsAddressReturnType`\>; `getEnsAvatar`: (`args`) => `Promise`\<`GetEnsAvatarReturnType`\>; `getEnsName`: (`args`) => `Promise`\<`GetEnsNameReturnType`\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<`GetEnsTextReturnType`\>; `getFeeHistory`: (`args`) => `Promise`\<`GetFeeHistoryReturnType`\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<`GetFilterChangesReturnType`\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<`GetFilterLogsReturnType`\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<`GetLogsReturnType`\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<`GetProofReturnType`\>; `getStorageAt`: (`args`) => `Promise`\<`GetStorageAtReturnType`\>; `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`; `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`; `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`; `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`; `authorizationList`: `SignedAuthorizationList`; `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`\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<`MulticallReturnType`\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\<Extract\<UnionOmit\<(...), (...)\> & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\<request\["parameters"\] extends readonly PrepareTransactionRequestParameterType\[\] ? any\[any\]\[number\] : "type" \| "nonce" \| "chainId" \| "gas" \| "fees" \| "blobVersionedHashes"\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\<request, "kzg"\>))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<`ReadContractReturnType`\<`abi`, `functionName`, `args`\>\>; `request`: `EIP1193RequestFn`\<`PublicRpcSchema`\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<`TransactionReceipt`\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<`SimulateBlocksReturnType`\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<`SimulateBlocksReturnType`\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<`SimulateCallsReturnType`\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<`SimulateContractReturnType`\<`abi`, `functionName`, `args`, `Chain` \| `undefined`, `Account` \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: `TransportConfig`\<`string`, `EIP1193RequestFn`\> & `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`\>; `watchBlockNumber`: (`args`) => `WatchBlockNumberReturnType`; `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => `WatchBlocksReturnType`; `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => `WatchContractEventReturnType`; `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => `WatchEventReturnType`; `watchPendingTransactions`: (`args`) => `WatchPendingTransactionsReturnType`; \} | - |
|
|
39
|
-
| `publicClient.account` | `undefined` | The Account of the Client. |
|
|
40
|
-
| `publicClient.batch?` | \{ `multicall?`: \| `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. |
|
|
41
|
-
| `publicClient.batch.multicall?` | \| `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. |
|
|
42
|
-
| `publicClient.cacheTime?` | `number` | Time (in ms) that cached data will remain in memory. |
|
|
43
|
-
| `publicClient.call?` | (`parameters`) => `Promise`\<`CallReturnType`\> | Executes a new message call immediately without submitting a transaction to the network. - Docs: https://viem.sh/docs/actions/public/call - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const data = await client.call({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', })` |
|
|
44
|
-
| `publicClient.ccipRead?` | \| `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. |
|
|
45
|
-
| `publicClient.chain?` | `Chain` \| `undefined` | Chain for the client. |
|
|
46
|
-
| `publicClient.createAccessList?` | (`parameters`) => `Promise`\<\{ `accessList`: `AccessList`; `gasUsed`: `bigint`; \}\> | Creates an EIP-2930 access list that you can include in a transaction. - Docs: https://viem.sh/docs/actions/public/createAccessList - JSON-RPC Methods: `eth_createAccessList` **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const data = await client.createAccessList({ data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', })` |
|
|
47
|
-
| `publicClient.createBlockFilter?` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: `EIP1193RequestFn`\<readonly \[\{ `Method`: `"eth_getFilterChanges"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `` `0x${string}` ``[] \| `RpcLog`[]; \}, \{ `Method`: `"eth_getFilterLogs"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `RpcLog`[]; \}, \{ `Method`: `"eth_uninstallFilter"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `boolean`; \}\]\>; `type`: `"block"`; \}\> | Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges). - Docs: https://viem.sh/docs/actions/public/createBlockFilter - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter) **Example** `import { createPublicClient, createBlockFilter, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await createBlockFilter(client) // { id: "0x345a6572337856574a76364e457a4366", type: 'block' }` |
|
|
48
|
-
| `publicClient.createContractEventFilter?` | \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<`CreateContractEventFilterReturnType`\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\> | 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). - Docs: https://viem.sh/docs/contract/createContractEventFilter **Example** `import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), })` |
|
|
49
|
-
| `publicClient.createEventFilter?` | \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\> | 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). - Docs: https://viem.sh/docs/actions/public/createEventFilter - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2', })` |
|
|
50
|
-
| `publicClient.createPendingTransactionFilter?` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: `EIP1193RequestFn`\<readonly \[\{ `Method`: `"eth_getFilterChanges"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `` `0x${string}` ``[] \| `RpcLog`[]; \}, \{ `Method`: `"eth_getFilterLogs"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `RpcLog`[]; \}, \{ `Method`: `"eth_uninstallFilter"`; `Parameters`: \[`` `0x${string}` ``\]; `ReturnType`: `boolean`; \}\]\>; `type`: `"transaction"`; \}\> | Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' }` |
|
|
51
|
-
| `publicClient.estimateContractGas?` | \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas **Remarks** 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). **Example** `import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gas = await client.estimateContractGas({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint() public']), functionName: 'mint', account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', })` |
|
|
52
|
-
| `publicClient.estimateFeesPerGas?` | \<`chainOverride`, `type`\>(`args?`) => `Promise`\<`EstimateFeesPerGasReturnType`\<`type`\>\> | Returns an estimate for the fees per gas for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateFeesPerGas() // { maxFeePerGas: ..., maxPriorityFeePerGas: ... }` |
|
|
53
|
-
| `publicClient.estimateGas?` | (`args`) => `Promise`\<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas) **Example** `import { createPublicClient, http, parseEther } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasEstimate = await client.estimateGas({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), })` |
|
|
54
|
-
| `publicClient.estimateMaxPriorityFeePerGas?` | \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\> | Returns an estimate for the max priority fee per gas (in wei) for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas() // 10000000n` |
|
|
55
|
-
| `publicClient.experimental_blockTag?` | `BlockTag` | Default block tag to use for RPC requests. |
|
|
56
|
-
| `publicClient.extend?` | \<`client`\>(`fn`) => `Client`\<`Transport`, `Chain` \| `undefined`, `undefined`, `PublicRpcSchema`, \{ \[K in string \| number \| symbol\]: client\[K\] \} & `PublicActions`\<`Transport`, `Chain` \| `undefined`\>\> | - |
|
|
57
|
-
| `publicClient.fillTransaction?` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<`FillTransactionReturnType`\<`Chain` \| `undefined`, `chainOverride`\>\> | Fills a transaction request with the necessary fields to be signed over. - Docs: https://viem.sh/docs/actions/public/fillTransaction **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.fillTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), })` |
|
|
58
|
-
| `publicClient.getBalance?` | (`args`) => `Promise`\<`bigint`\> | Returns the balance of an address in wei. - Docs: https://viem.sh/docs/actions/public/getBalance - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance) **Remarks** You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther). `const balance = await getBalance(client, { address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', blockTag: 'safe' }) const balanceAsEther = formatEther(balance) // "6.942"` **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const balance = await client.getBalance({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) // 10000000000000000000000n (wei)` |
|
|
59
|
-
| `publicClient.getBlobBaseFee?` | () => `Promise`\<`bigint`\> | Returns the base fee per blob gas in wei. - Docs: https://viem.sh/docs/actions/public/getBlobBaseFee - JSON-RPC Methods: [`eth_blobBaseFee`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blobBaseFee) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getBlobBaseFee } from 'viem/public' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blobBaseFee = await client.getBlobBaseFee()` |
|
|
60
|
-
| `publicClient.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`: `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`; `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`; `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`; `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`; `authorizationList`: `SignedAuthorizationList`; `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`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: `Withdrawal`[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_fetching-blocks - JSON-RPC Methods: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getBlock()` |
|
|
61
|
-
| `publicClient.getBlockNumber?` | (`args?`) => `Promise`\<`bigint`\> | Returns the number of the most recent block seen. - Docs: https://viem.sh/docs/actions/public/getBlockNumber - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_fetching-blocks - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blockNumber = await client.getBlockNumber() // 69420n` |
|
|
62
|
-
| `publicClient.getBlockTransactionCount?` | (`args?`) => `Promise`\<`number`\> | Returns the number of Transactions at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount - JSON-RPC Methods: - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const count = await client.getBlockTransactionCount()` |
|
|
63
|
-
| `publicClient.getBytecode?` | (`args`) => `Promise`\<`GetCodeReturnType`\> | **Deprecated** Use `getCode` instead. |
|
|
64
|
-
| `publicClient.getChainId?` | () => `Promise`\<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const chainId = await client.getChainId() // 1` |
|
|
65
|
-
| `publicClient.getCode?` | (`args`) => `Promise`\<`GetCodeReturnType`\> | Retrieves the bytecode at an address. - Docs: https://viem.sh/docs/contract/getCode - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getCode({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', })` |
|
|
66
|
-
| `publicClient.getContractEvents?` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<`GetContractEventsReturnType`\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { wagmiAbi } from './abi' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getContractEvents(client, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: wagmiAbi, eventName: 'Transfer' })` |
|
|
67
|
-
| `publicClient.getEip712Domain?` | (`args`) => `Promise`\<`GetEip712DomainReturnType`\> | Reads the EIP-712 domain from a contract, based on the ERC-5267 specification. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const domain = await client.getEip712Domain({ address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', }) // { // domain: { // name: 'ExampleContract', // version: '1', // chainId: 1, // verifyingContract: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // }, // fields: '0x0f', // extensions: [], // }` |
|
|
68
|
-
| `publicClient.getEnsAddress?` | (`args`) => `Promise`\<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **Remarks** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. 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. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAddress = await client.getEnsAddress({ name: normalize('wevm.eth'), }) // '0xd2135CfB216b74109775236E36d4b433F1DF507B'` |
|
|
69
|
-
| `publicClient.getEnsAvatar?` | (`args`) => `Promise`\<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **Remarks** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText) with `key` set to `'avatar'`. 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. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAvatar = await client.getEnsAvatar({ name: normalize('wevm.eth'), }) // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio'` |
|
|
70
|
-
| `publicClient.getEnsName?` | (`args`) => `Promise`\<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **Remarks** Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensName = await client.getEnsName({ address: '0xd2135CfB216b74109775236E36d4b433F1DF507B', }) // 'wevm.eth'` |
|
|
71
|
-
| `publicClient.getEnsResolver?` | (`args`) => `Promise`\<`` `0x${string}` ``\> | Gets resolver for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **Remarks** Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name. 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. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const resolverAddress = await client.getEnsResolver({ name: normalize('wevm.eth'), }) // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'` |
|
|
72
|
-
| `publicClient.getEnsText?` | (`args`) => `Promise`\<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **Remarks** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. 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. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const twitterRecord = await client.getEnsText({ name: normalize('wevm.eth'), key: 'com.twitter', }) // 'wevm_dev'` |
|
|
73
|
-
| `publicClient.getFeeHistory?` | (`args`) => `Promise`\<`GetFeeHistoryReturnType`\> | Returns a collection of historical gas information. - Docs: https://viem.sh/docs/actions/public/getFeeHistory - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const feeHistory = await client.getFeeHistory({ blockCount: 4, rewardPercentiles: [25, 75], })` |
|
|
74
|
-
| `publicClient.getFilterChanges?` | \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<`GetFilterChangesReturnType`\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> | Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called. - Docs: https://viem.sh/docs/actions/public/getFilterChanges - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) **Remarks** A Filter can be created from the following actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter) Depending on the type of filter, the return value will be different: - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs. - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes. - If the filter was created with `createBlockFilter`, it returns a list of block hashes. **Examples** `// Blocks import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createBlockFilter() const hashes = await client.getFilterChanges({ filter })` `// Contract Events import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), eventName: 'Transfer', }) const logs = await client.getFilterChanges({ filter })` `// Raw Events import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterChanges({ filter })` `// Transactions import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() const hashes = await client.getFilterChanges({ filter })` |
|
|
75
|
-
| `publicClient.getFilterLogs?` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<`GetFilterLogsReturnType`\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> | Returns a list of event logs since the filter was created. - Docs: https://viem.sh/docs/actions/public/getFilterLogs - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs) **Remarks** `getFilterLogs` is only compatible with **event filters**. **Example** `import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterLogs({ filter })` |
|
|
76
|
-
| `publicClient.getGasPrice?` | () => `Promise`\<`bigint`\> | Returns the current price of gas (in wei). - Docs: https://viem.sh/docs/actions/public/getGasPrice - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasPrice = await client.getGasPrice()` |
|
|
77
|
-
| `publicClient.getLogs?` | \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<`GetLogsReturnType`\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\> | Returns a list of event logs matching the provided parameters. - Docs: https://viem.sh/docs/actions/public/getLogs - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/logs_event-logs - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **Example** `import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getLogs()` |
|
|
78
|
-
| `publicClient.getProof?` | (`args`) => `Promise`\<`GetProofReturnType`\> | Returns the account and storage values of the specified account including the Merkle-proof. - Docs: https://viem.sh/docs/actions/public/getProof - JSON-RPC Methods: - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getProof({ address: '0x...', storageKeys: ['0x...'], })` |
|
|
79
|
-
| `publicClient.getStorageAt?` | (`args`) => `Promise`\<`GetStorageAtReturnType`\> | Returns the value from a storage slot at a given address. - Docs: https://viem.sh/docs/contract/getStorageAt - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getStorageAt } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getStorageAt({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', slot: toHex(0), })` |
|
|
80
|
-
| `publicClient.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`; `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`; `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`; `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`; `authorizationList`: `SignedAuthorizationList`; `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`; \}\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transaction = await client.getTransaction({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', })` |
|
|
81
|
-
| `publicClient.getTransactionConfirmations?` | (`args`) => `Promise`\<`bigint`\> | Returns the number of blocks passed (confirmations) since the transaction was processed on a block. - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const confirmations = await client.getTransactionConfirmations({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', })` |
|
|
82
|
-
| `publicClient.getTransactionCount?` | (`args`) => `Promise`\<`number`\> | Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionCount = await client.getTransactionCount({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` |
|
|
83
|
-
| `publicClient.getTransactionReceipt?` | (`args`) => `Promise`\<`TransactionReceipt`\> | Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.getTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', })` |
|
|
84
|
-
| `publicClient.key?` | `string` | A key for the client. |
|
|
85
|
-
| `publicClient.multicall?` | \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<`MulticallReturnType`\<`contracts`, `allowFailure`\>\> | 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). - Docs: https://viem.sh/docs/contract/multicall **Example** `import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const abi = parseAbi([ 'function balanceOf(address) view returns (uint256)', 'function totalSupply() view returns (uint256)', ]) const result = await client.multicall({ contracts: [ { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'totalSupply', }, ], }) // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]` |
|
|
86
|
-
| `publicClient.name?` | `string` | A name for the client. |
|
|
87
|
-
| `publicClient.pollingInterval?` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. |
|
|
88
|
-
| `publicClient.prepareTransactionRequest?` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\<Extract\<UnionOmit\<(...), (...)\> & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\<request\["parameters"\] extends readonly PrepareTransactionRequestParameterType\[\] ? any\[any\]\[number\] : "type" \| "nonce" \| "chainId" \| "gas" \| "fees" \| "blobVersionedHashes"\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\<request, "kzg"\>))\[K\] \}\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, })` `// Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, })` |
|
|
89
|
-
| `publicClient.readContract?` | \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<`ReadContractReturnType`\<`abi`, `functionName`, `args`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_reading-contracts **Remarks** 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. 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). **Example** `import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' import { readContract } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.readContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function balanceOf(address) view returns (uint256)']), functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }) // 424122n` |
|
|
90
|
-
| `publicClient.request?` | `EIP1193RequestFn`\<`PublicRpcSchema`\> | Request function wrapped with friendly error handling |
|
|
91
|
-
| `publicClient.sendRawTransaction?` | (`args`) => `Promise`\<`` `0x${string}` ``\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' })` |
|
|
92
|
-
| `publicClient.sendRawTransactionSync?` | (`args`) => `Promise`\<`TransactionReceipt`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransactionSync - JSON-RPC Method: [`eth_sendRawTransactionSync`](https://eips.ethereum.org/EIPS/eip-7966) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransactionSync } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.sendRawTransactionSync({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' })` |
|
|
93
|
-
| `publicClient.simulate?` | \<`calls`\>(`args`) => `Promise`\<`SimulateBlocksReturnType`\<`calls`\>\> | **Deprecated** Use `simulateBlocks` instead. |
|
|
94
|
-
| `publicClient.simulateBlocks?` | \<`calls`\>(`args`) => `Promise`\<`SimulateBlocksReturnType`\<`calls`\>\> | Simulates a set of calls on block(s) with optional block and state overrides. **Example** `import { createPublicClient, http, parseEther } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.simulateBlocks({ blocks: [{ blockOverrides: { number: 69420n, }, calls: [{ { account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929', data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), }, }], stateOverrides: [{ address: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929', balance: parseEther('10'), }], }] })` |
|
|
95
|
-
| `publicClient.simulateCalls?` | \<`calls`\>(`args`) => `Promise`\<`SimulateCallsReturnType`\<`calls`\>\> | Simulates a set of calls. **Example** `import { createPublicClient, http, parseEther } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.simulateCalls({ account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929', calls: [{ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), }, ] })` |
|
|
96
|
-
| `publicClient.simulateContract?` | \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<`SimulateContractReturnType`\<`abi`, `functionName`, `args`, `Chain` \| `undefined`, `Account` \| `undefined`, `chainOverride`, `accountOverride`\>\> | Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions. - Docs: https://viem.sh/docs/contract/simulateContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts **Remarks** 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. 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). **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32) view returns (uint32)']), functionName: 'mint', args: ['69420'], account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` |
|
|
97
|
-
| `publicClient.transport?` | `TransportConfig`\<`string`, `EIP1193RequestFn`\> & `Record`\<`string`, `any`\> | The RPC transport |
|
|
98
|
-
| `publicClient.type?` | `string` | The type of client. |
|
|
99
|
-
| `publicClient.uid?` | `string` | A unique ID for the client. |
|
|
100
|
-
| `publicClient.uninstallFilter?` | (`args`) => `Promise`\<`boolean`\> | Destroys a Filter that was created from one of the following Actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter) - Docs: https://viem.sh/docs/actions/public/uninstallFilter - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { createPendingTransactionFilter, uninstallFilter } from 'viem/public' const filter = await client.createPendingTransactionFilter() const uninstalled = await client.uninstallFilter({ filter }) // true` |
|
|
101
|
-
| `publicClient.verifyHash?` | (`args`) => `Promise`\<`boolean`\> | Verify that a hash was signed by the provided address. - Docs [https://viem.sh/docs/actions/public/verifyHash](https://viem.sh/docs/actions/public/verifyHash) |
|
|
102
|
-
| `publicClient.verifyMessage?` | (`args`) => `Promise`\<`boolean`\> | Verify that a message was signed by the provided address. Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492). - Docs [https://viem.sh/docs/actions/public/verifyMessage](https://viem.sh/docs/actions/public/verifyMessage) |
|
|
103
|
-
| `publicClient.verifySiweMessage?` | (`args`) => `Promise`\<`boolean`\> | Verifies [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361) formatted message was signed. Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492). - Docs [https://viem.sh/docs/siwe/actions/verifySiweMessage](https://viem.sh/docs/siwe/actions/verifySiweMessage) |
|
|
104
|
-
| `publicClient.verifyTypedData?` | (`args`) => `Promise`\<`boolean`\> | Verify that typed data was signed by the provided address. - Docs [https://viem.sh/docs/actions/public/verifyTypedData](https://viem.sh/docs/actions/public/verifyTypedData) |
|
|
105
|
-
| `publicClient.waitForTransactionReceipt?` | (`args`) => `Promise`\<`TransactionReceipt`\> | 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. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed. - If a Transaction has been replaced: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions - Checks if one of the Transactions is a replacement - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt). **Remarks** The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions). 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. There are 3 types of Transaction Replacement reasons: - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`) - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`) - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`) **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.waitForTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', })` |
|
|
106
|
-
| `publicClient.watchBlockNumber?` | (`args`) => `WatchBlockNumberReturnType` | Watches and returns incoming block numbers. - Docs: https://viem.sh/docs/actions/public/watchBlockNumber - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlockNumber({ onBlockNumber: (blockNumber) => console.log(blockNumber), })` |
|
|
107
|
-
| `publicClient.watchBlocks?` | \<`includeTransactions`, `blockTag`\>(`args`) => `WatchBlocksReturnType` | Watches and returns information for incoming blocks. - Docs: https://viem.sh/docs/actions/public/watchBlocks - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlocks({ onBlock: (block) => console.log(block), })` |
|
|
108
|
-
| `publicClient.watchContractEvent?` | \<`abi`, `eventName`, `strict`\>(`args`) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent **Remarks** 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). `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. **Example** `import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchContractEvent({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']), eventName: 'Transfer', args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' }, onLogs: (logs) => console.log(logs), })` |
|
|
109
|
-
| `publicClient.watchEvent?` | \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent - JSON-RPC Methods: - **RPC Provider supports `eth_newFilter`:** - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize). - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). - **RPC Provider does not support `eth_newFilter`:** - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval. **Remarks** 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). `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. **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchEvent({ onLogs: (logs) => console.log(logs), })` |
|
|
110
|
-
| `publicClient.watchPendingTransactions?` | (`args`) => `WatchPendingTransactionsReturnType` | Watches and returns pending transaction hashes. - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions - JSON-RPC Methods: - When `poll: true` - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter. - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newPendingTransactions"` event. **Remarks** 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). **Example** `import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchPendingTransactions({ onTransactions: (hashes) => console.log(hashes), })` |
|
|
111
|
-
| `addresses?` | \{ `gtoken?`: `` `0x${string}` ``; `registry?`: `` `0x${string}` ``; \} | - |
|
|
112
|
-
| `addresses.gtoken?` | `` `0x${string}` `` | - |
|
|
113
|
-
| `addresses.registry?` | `` `0x${string}` `` | - |
|
|
114
|
-
|
|
115
|
-
###### Returns
|
|
116
|
-
|
|
117
|
-
[`AnalyticsClient`](#analyticsclient)
|
|
118
|
-
|
|
119
|
-
#### Methods
|
|
120
|
-
|
|
121
|
-
##### getRoleEntranceCost()
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
getRoleEntranceCost(roleId): Promise<{
|
|
125
|
-
entryBurn: bigint;
|
|
126
|
-
exitFee: {
|
|
127
|
-
minFee: bigint;
|
|
128
|
-
percent: number;
|
|
129
|
-
};
|
|
130
|
-
minStake: bigint;
|
|
131
|
-
totalRequired: bigint;
|
|
132
|
-
}>;
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Defined in: [packages/analytics/src/index.ts:119](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/analytics/src/index.ts#L119)
|
|
136
|
-
|
|
137
|
-
Get role entrance cost breakdown
|
|
138
|
-
|
|
139
|
-
###### Parameters
|
|
140
|
-
|
|
141
|
-
| Parameter | Type |
|
|
142
|
-
| ------ | ------ |
|
|
143
|
-
| `roleId` | `` `0x${string}` `` |
|
|
144
|
-
|
|
145
|
-
###### Returns
|
|
146
|
-
|
|
147
|
-
`Promise`\<\{
|
|
148
|
-
`entryBurn`: `bigint`;
|
|
149
|
-
`exitFee`: \{
|
|
150
|
-
`minFee`: `bigint`;
|
|
151
|
-
`percent`: `number`;
|
|
152
|
-
\};
|
|
153
|
-
`minStake`: `bigint`;
|
|
154
|
-
`totalRequired`: `bigint`;
|
|
155
|
-
\}\>
|
|
156
|
-
|
|
157
|
-
###### Role Required
|
|
158
|
-
|
|
159
|
-
None (public view)
|
|
160
|
-
|
|
161
|
-
##### getSupplyMetrics()
|
|
162
|
-
|
|
163
|
-
```ts
|
|
164
|
-
getSupplyMetrics(): Promise<{
|
|
165
|
-
cap: bigint;
|
|
166
|
-
deflationRate: number;
|
|
167
|
-
remainingMintable: bigint;
|
|
168
|
-
totalLifetimeBurned: bigint;
|
|
169
|
-
totalSupply: bigint;
|
|
170
|
-
}>;
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Defined in: [packages/analytics/src/index.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/analytics/src/index.ts#L37)
|
|
174
|
-
|
|
175
|
-
Get complete supply metrics
|
|
176
|
-
|
|
177
|
-
###### Returns
|
|
178
|
-
|
|
179
|
-
`Promise`\<\{
|
|
180
|
-
`cap`: `bigint`;
|
|
181
|
-
`deflationRate`: `number`;
|
|
182
|
-
`remainingMintable`: `bigint`;
|
|
183
|
-
`totalLifetimeBurned`: `bigint`;
|
|
184
|
-
`totalSupply`: `bigint`;
|
|
185
|
-
\}\>
|
|
186
|
-
|
|
187
|
-
###### Role Required
|
|
188
|
-
|
|
189
|
-
None (public view)
|
|
190
|
-
|
|
191
|
-
##### subscribeToBurnEvents()
|
|
192
|
-
|
|
193
|
-
```ts
|
|
194
|
-
subscribeToBurnEvents(callback): () => void;
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Defined in: [packages/analytics/src/index.ts:85](https://github.com/AAStarCommunity/aastar-sdk/blob/9355f214d4f7ac03755d574206ded22f6097f351/packages/analytics/src/index.ts#L85)
|
|
198
|
-
|
|
199
|
-
Subscribe to real-time burn events
|
|
200
|
-
|
|
201
|
-
###### Parameters
|
|
202
|
-
|
|
203
|
-
| Parameter | Type |
|
|
204
|
-
| ------ | ------ |
|
|
205
|
-
| `callback` | (`event`) => `void` |
|
|
206
|
-
|
|
207
|
-
###### Returns
|
|
208
|
-
|
|
209
|
-
```ts
|
|
210
|
-
(): void;
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
###### Returns
|
|
214
|
-
|
|
215
|
-
`void`
|
|
216
|
-
|
|
217
|
-
###### Role Required
|
|
218
|
-
|
|
219
|
-
None (public events)
|